douglasscherner
Member
- Joined
- Aug 15, 2014
- Messages
- 143
- Reaction score
- 24
So when I buyed 1x they sold me 2x. When I buyed 2x sold me 4x and 3x sold me 6x....
I use in scripts/Aldee.lua
--Buyable
shopModule:addBuyableItem({'short sword'},2406,30,'short sword')
shopModule:addBuyableItem({'hand axe'},2380,8,'hand axe')
I tried to use:
shopModule:addBuyableItem({'short sword'},2406,30,'short sword')
shopModule:addBuyableItem({'hand axe'},2380,8,'hand axe')
I guess is something in modules or npchandler.
When I talk buy 1 short sword, is working fine the npc sell me right 1x
Buy when I use trade options he sold me double items.
I guess is something aprox this:
Can someone help me?
Thanks
Solved:
Function in xml and lua repeting
Removed:
<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value="" />
<parameter key="shop_sellable" value="" />
I use in scripts/Aldee.lua
--Buyable
shopModule:addBuyableItem({'short sword'},2406,30,'short sword')
shopModule:addBuyableItem({'hand axe'},2380,8,'hand axe')
I tried to use:
shopModule:addBuyableItem({'short sword'},2406,30,'short sword')
shopModule:addBuyableItem({'hand axe'},2380,8,'hand axe')
I guess is something in modules or npchandler.
When I talk buy 1 short sword, is working fine the npc sell me right 1x
Buy when I use trade options he sold me double items.
I guess is something aprox this:
Lua:
if SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK then
if itemSubType == nil then
itemSubType = 0
end
local shopItem = self:getShopItem(itemid, itemSubType)
if shopItem == nil then
self.npcHandler.shopItems[#self.npcHandler.shopItems + 1] = {id = itemid, buy = -1, sell = cost, subType = itemSubType, name = realName or ItemType(itemid):getName()}
else
shopItem.sell = cost
end
end
Can someone help me?
Thanks
Post automatically merged:
Solved:
Function in xml and lua repeting
Removed:
<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value="" />
<parameter key="shop_sellable" value="" />
Attachments
-
modules.lua42.2 KB · Views: 0 · VirusTotal
-
npchandler.lua22.4 KB · Views: 0 · VirusTotal
Last edited: