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

Solved NPC problem

UpInSmoke

Supreme Ruler
Joined
Nov 16, 2008
Messages
303
Reaction score
21
So i am really confused... can someone please tell me why this NPC's buying option doesnt work:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Willie" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="153" head="77" body="63" legs="58" feet="115" addons="1"/>
   <parameters>
        <parameter key="message_greet" value="Hiho |PLAYERNAME|. I hope you're here to trade." />
        <parameter key="message_sendtrade" value="Ya take a good look." />
		<parameter key="message_farewell" value="Yeah, bye |PLAYERNAME|." />
		<parameter key="message_walkaway" value="Yeah go away!" />
        <parameter key="module_shop" value="1"/>
		<parameter key="shop_buyable" value="bread,2689,3;cheese,2696,5;ham,2671,8;meat,2666,5" />
		<parameter key="shop_sellable" value="bread,2689,1;cheese,2696,2;ham,2671,4;meat,2666,2;carrot,2684,1;cherry,2679,1;egg,2695,1;salmon,2668,2" />
    </parameters>
</npc>
by buying i mean this
Code:
<parameter key="shop_sellable" value="bread,2689,1;cheese,2696,2;ham,2671,4;meat,2666,2;carrot,2684,1;cherry,2679,1;egg,2695,1;salmon,2668,2" />
and this NPC does work...
Code:
<parameter key="module_shop" value="1"/>
        <parameter key="shop_buyable" value="axe,2386,20;dagger,2379,5;hand axe,2380,8;rapier,2384,15;sabre,2385,25;scythe,2550,12;short sword,2406,30;sickle,2405,8;spear,2389,10;" />
        <parameter key="shop_sellable" value="axe,2386,7;bone club,2449,5;dagger,2379,2;hand axe,2380,4;hatchet,2388,25;katana,2412,35;mace,2398,30;machete,2420,6;rapier,2384,5;sabre,2385,12;scythe,2550,3;short sword,2406,10;sickle,2405,2;spear,2389,3;sword,2376,25;" />
I tried replacing the whole NPC code with the working one then simply changing the shop_buyable and shop_sellable to the other but it still doesnt work.. it lets me buy meat from Willie but im not able to sell..
the food comes up in sell screen but it doesnt highlight (meaning it doesnt register that i have any)
 
I remember someone else had a very similar problem to this one a couple of days ago. Maybe search through the last ~5 pages in the Support board?

found the page, sadly there was so solution posted on it.. Remaking the NPC doesnt work either and my other NPC that sells similar stuff also doesnt.. Guess it has to do with the items it sells?
Any suggestions? :/
 
Code:
		<parameter key="shop_buyable" value="bread,2689,3;cheese,2696,5;ham,2671,8;meat,2666,5[COLOR="#FF0000"];[/COLOR]" />
		<parameter key="shop_sellable" value="bread,2689,1;cheese,2696,2;ham,2671,4;meat,2666,2;carrot,2684,1;cherry,2679,1;egg,2695,1;salmon,2668,2[COLOR="#FF0000"];[/COLOR]" />

added; in the end. should work then.
 
Code:
		<parameter key="shop_buyable" value="bread,2689,3;cheese,2696,5;ham,2671,8;meat,2666,5[COLOR="#FF0000"];[/COLOR]" />
		<parameter key="shop_sellable" value="bread,2689,1;cheese,2696,2;ham,2671,4;meat,2666,2;carrot,2684,1;cherry,2679,1;egg,2695,1;salmon,2668,2[COLOR="#FF0000"];[/COLOR]" />

added; in the end. should work then.
nope doesnt work :(
i added an axe to the end and it was able to sell the axe.. idk why but it wont let me sell any of these food products.. does it have something to do with being able to hold multiple of them?
 
compare it to frodo

frodo only sells...
okay so the xml trade module wasnt working so for anyone else who has this problem just take your time and hardcode it in lua and it will work. for example:

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

-- sell to him
shopModule:addSellableItem({'meat'}, 2666, 2, 'meat')
shopModule:addSellableItem({'bread'}, 2689, 1, 'bread')
shopModule:addSellableItem({'cheese'}, 2696, 2, 'cheese')
shopModule:addSellableItem({'ham'}, 2671, 4, 'ham')
shopModule:addSellableItem({'carrot'}, 2684, 1, 'carrot')
shopModule:addSellableItem({'cherry'}, 2679, 1, 'cherry')
shopModule:addSellableItem({'egg'}, 2695, 1, 'egg')
shopModule:addSellableItem({'salmon'}, 2668, 2, 'salmon')
shopModule:addSellableItem({'dead rat'}, 2813, 2, 'dead rat')
-- buy from him
shopModule:addBuyableItem({'meat'}, 2666, 5, 'meat')
shopModule:addBuyableItem({'bread'}, 2689, 3, 'bread')
shopModule:addBuyableItem({'cheese'}, 2696, 5, 'cheese')
shopModule:addBuyableItem({'ham'}, 2671, 8, 'ham')
 
Back
Top