• 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 System -- Buying Two items at Once!

QuaS

Cykotitan Pwned =/
Joined
Sep 11, 2008
Messages
838
Reaction score
28
Location
Poland/ Wroclaw
I don't know how to fix it. I even deleted all npc system and copied the one new.

When i am buying via Trade Window Npc is selling 2 items at once and taking for it 2x money.

i mind that:

255qrud.jpg


Anybody know how to solve that?



EDIT:

i solve that. A bug was actived shop module TWICE!

in npc.xml :

PHP:
<parameter key="module_shop" value="1" />

and in npc.lua:

PHP:
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
 
Last edited:
NPC.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>

<npc name="Frodo" script="data/npc/scripts/seller.lua" walkinterval="2000" floorchange="0">
	<mana now="100" max="100"/>
	<health now="100" max="100"/>
	<look type="134" head="114" body="113" legs="113" feet="113" corpse="2212"/>
	<parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. Jezeli Chcesz Zaopatrzyc sie to napisz {trade}. Jezeli Potrzebujesz oleju napisz {buy oil}."/>
		<parameter key="module_shop" value="1" />
		<parameter key="shop_buyable" value="pick,2553,20;Lom,2416,2000;shovel,2554,20;backpack,1988,10;fishing rod,2580,100;torch,2050,2;rope,2120,50;aol,2173,20000;machete,2420,30;obsidian knife,5908,10000;blessed wooden stake,5942,10000;botanist container,4869,100;scythe,2550,50;Zielona Posciel,7904,1250;Czerwona Posciel,7905,1250;Zolta Posciel,7906,1250;Niebieska Posciel,7907,1250" />
	</parameters>
</npc>


Npc.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

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

shopModule:addBuyableItem({'oil'}, 2006, 4400, 11, 'oil')
shopModule:addBuyableItem({'mana fluid', 'manafluid'}, 		2006, 100, 	7, 	'mana fluid')
shopModule:addBuyableItem({'life fluid', 'lifefluid'}, 		2006, 80, 	10,	'life fluid')

npcHandler:addModule(FocusModule:new())
 
Back
Top