• 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!

Cannot buy 'egg' from NPC

CastorFlynn

Member
Joined
Aug 29, 2021
Messages
100
Reaction score
15
The item appears correctly in the trade window, looking like the ID is correct too, but when trying to buy nothing happens, no error message.

items.xml
XML:
    <item id="2695" article="an" name="egg" plural="eggs">
        <attribute key="weight" value="30" />
    </item>

npc.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Norma" script="Norma.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100" />
    <look type="136" head="78" body="76" legs="72" feet="96" addons="2" />
    <parameters>
        <parameter key="module_shop" value="1" />
        <parameter key="shop_buyable" value="wine,2006,10,15;bread,2689,3;cheese,2696,5;egg,2695,2;mug of wine,2012,3,15;mug of beer,2012,3,3;mug of milk,2012,2,6;mug of lemonade,2012,2,5;party cake,6280,50;" />
    </parameters>
</npc>

items.otb
egg 2.png
 
Try it in lua script
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'egg'}, 2695, 2, 'egg')
shopModule:addBuyableItem({'wine'}, 2006, 10, 'wine')
shopModule:addBuyableItem({'bread'}, 2689, 3, 'bread')
shopModule:addBuyableItem({'cheese'}, 2696, 5, 'cheese')
shopModule:addBuyableItem({'mug of wine'}, 2012, 3, 15, 'mug of wine')
shopModule:addBuyableItem({'mug of beer'}, 2012, 3, 3, 'mug of beer')
shopModule:addBuyableItem({'mug of milk'}, 2012, 2, 6, 'mug of milk')
shopModule:addBuyableItem({'mug of lemonade'}, 2012, 2, 5, 'mug of lemonade')
shopModule:addBuyableItem({'party cake'}, 6280, 50, 'party cake')

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

npcHandler:addModule(FocusModule:new())

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Norma" script="Norma.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100" />
    <look type="136" head="78" body="76" legs="72" feet="96" addons="2" />
</npc>

Code:
<npc name="Norma" file="data/npc/Norma.xml" />
 
There are 2 eggs using the same client ID "3606". To solve this you need to replicate this egg in a new sprite and attach the new client id on the egg of server id 2328 for example.
 
Back
Top