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

[XML] NPC, Fluids / Liquids

Rudixx

New Member
Joined
Aug 3, 2007
Messages
246
Reaction score
0
Location
England
The problem comes again, I am trying to make NPC which will sell vials of liquids:
vial of blood
vial of oil
vial of water
Etc.

As I've heard I should make it by this order: name, id, cost, charge/subtype, realname
So it should looks like:

Code:
<parameter key="shop_buyable" value="vial,2006,10,2,vial of blood;vial,2006,10,11,vial of oil;" />
The result is, trade window only show last item and it doesn't show real name, just vial and it's not even oil but beer.

How to make then NPC that's selling liquids? Can someone correct me?
 
Try this one, you just need to edit it:

PHP:
<parameter key="shop_buyable" value="brown bread,2691,8;ham,2671,8;carrot,2684,8;meat,2666,8;apple,2674,8;brown mushroom,2789,8;egg,2695,8"/>

1.- Name
2.- ItemId
3.- Cost
Dont forget that after those 3 points you should end it with ";"
 
Try this one, you just need to edit it:

PHP:
<parameter key="shop_buyable" value="brown bread,2691,8;ham,2671,8;carrot,2684,8;meat,2666,8;apple,2674,8;brown mushroom,2789,8;egg,2695,8"/>

1.- Name
2.- ItemId
3.- Cost
Dont forget that after those 3 points you should end it with ";"

I think you don't get my point, NPC, Fluids / Liquids, I need liquids / fluids not items such food or whatever.
 
I have the same problem, altough I use the Lua version of that, instead of XML:
PHP:
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({'lemonade', 'lemondrink'}, 					2012, 10, 	5, 	'mug of lemonade')
shopModule:addBuyableItem({'fruit juice', 'fruitjuice'}, 					2012, 10, 	21,	'mug of fruit juice')
shopModule:addBuyableItem({'beer', 'booze'}, 					2012, 10, 	3,	'mug of beer')
shopModule:addBuyableItem({'milk'}, 					2012, 10, 	6,	'mug of milk')
shopModule:addBuyableItem({'coconut'}, 					2012, 10, 	14,	'mug of coconut milk')
shopModule:addBuyableItem({'wine'}, 					2012, 10, 	15,	'mug of wine')
shopModule:addBuyableItem({'rum'}, 					2012, 10, 	27,	'mug of rum')
 
npcHandler:addModule(FocusModule:new())

When I say "trade", only mug of rum shows up, however,
I can buy all the liquids by saying "buy wine" or "buy coconut milk"

14:09 Bartender: Do you want to buy a mug of coconut milk for 10 gold coins?
 
Yes, but when you buy it, it appears "You see a mug of water."

Well, it happens here, dunno if you have this bug also :p
 
I Think I figured out why

I have the same problem, altough I use the Lua version of that, instead of XML:
PHP:
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({'lemonade', 'lemondrink'}, 					2012, 10, 	5, 	'mug of lemonade')
shopModule:addBuyableItem({'fruit juice', 'fruitjuice'}, 					2012, 10, 	21,	'mug of fruit juice')
shopModule:addBuyableItem({'beer', 'booze'}, 					2012, 10, 	3,	'mug of beer')
shopModule:addBuyableItem({'milk'}, 					2012, 10, 	6,	'mug of milk')
shopModule:addBuyableItem({'coconut'}, 					2012, 10, 	14,	'mug of coconut milk')
shopModule:addBuyableItem({'wine'}, 					2012, 10, 	15,	'mug of wine')
shopModule:addBuyableItem({'rum'}, 					2012, 10, 	27,	'mug of rum')
 
npcHandler:addModule(FocusModule:new())

When I say "trade", only mug of rum shows up, however,
I can buy all the liquids by saying "buy wine" or "buy coconut milk"

14:09 Bartender: Do you want to buy a mug of coconut milk for 10 gold coins?

This script I use and works as you say but, I tried something and changed all the containers for each and it now shaows in the trade, Somewere there is a part of the original script that will not let you show more than one container. The 2012 part needs to be a different container, I will keep you posted on my progress.
 
This script I use and works as you say but, I tried something and changed all the containers for each and it now shaows in the trade, Somewere there is a part of the original script that will not let you show more than one container. The 2012 part needs to be a different container, I will keep you posted on my progress.
That post is more than a year old, and I solved my problem ages ago.
 
Back
Top