• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Shop module problem

Don Daniello

/root
Staff member
Administrator
Joined
Apr 11, 2008
Messages
3,728
Solutions
16
Reaction score
1,520
Location
Proland
Hi,
I've got problem with my shop module. I have NPC that sells Stone Skin Amulets. It works well but amulets have one charge only (in items.xml it's set to 5).
I can't change charges for sold SSA in NPC script ! How to repair this ?

My NPC:
Code:
<?xml version="1.0"?>

<npc name="Frodo" access="3" lookdir="2" walkinterval="2000">
    <mana now="800" max="800"/>
    <health now="200" max="200"/>
<look type="139" head="132" body="79" legs="97" feet="132"/>
    <parameters>
        <parameter key="module_shop" value="1" />
        <parameter key="message_greet" value="Hello |PLAYERNAME|. I sell rings and amulets. Just 'trade' !" />
        <parameter key="shop_buyable" value="life ring,2168,300;rime ring,2169,300;stealth ring,2165,200;energy ring,2167,100;might ring,2164,200;sword ring,2207,100;club ring,2209,100;axe ring,2208,100;power ring,2169,300;garlic necklace,2199,300;dragon necklace,2201,300;stone skin amulet,2197,100;protection amulet,2200,1000;elven amulet,2198,500;platinum amulet,2171,2000;scarf,2661,100;amulet of loss,2173,10000" />
    </parameters>
</npc>


I rep for help :)
 
Code:
			for temp in string.gmatch(item, '[^,]+') do
				if(i == 1) then
					name = temp
				elseif(i == 2) then
					itemid = tonumber(temp)
				elseif(i == 3) then
					cost = tonumber(temp)
				[B]elseif(i == 4) then
					subType = tonumber(temp)[/B]
				elseif(i == 5) then
					realName = temp
				else
					print('[Warning] NpcSystem:', 'Unknown parameter found in buyable items parameter.', temp, item)
				end
				i = i + 1
			end

So... : stone skin amulet,2197,100,5;
 
I would rather use a Lua script for this, because stone skin amulet,2197,100,5; would set the item's name in trade window to 5.
I don't know why, but this has been happening to me.
 
Back
Top