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

Npc sell/buy items only if storage value X

Massen

Masserv RPG
Joined
Jul 23, 2007
Messages
324
Reaction score
1
Location
Sweden
Well, I'm currently making tibia's djinn quest. The npcs in this quest will work exactly like on real tibia. Which means that I need a npc whom only trades with you if you have a specific Storage value.

The trade system doesn't need to be like the new one where you type "trade" to bring up a window, I'd rather have it like the old version to be honest but any of them would work.

So my question is, is this possible?

If anyone could give me an example then I would really appreciate it.

//Massen
 
if getPlayerStorageValue(cid,xxxxxx) == XX then

you can do npc things

else

you can't


how is your npc script set up? are you using modules or?


Well It's the latest beta, the problem is if i add buy/sellable items then they will display as a list when you say Trade. I could perhaps make an old fashioned npc with the trade system 100 % made inside the lua file?..

ifmsgcontain"sell xxx" then
doPlayerRemoveItem


blabla

But i think that would be alot of work since they buy and sell alot...

//Massen
 
Well It's the latest beta, the problem is if i add buy/sellable items then they will display as a list when you say Trade. I could perhaps make an old fashioned npc with the trade system 100 % made inside the lua file?..

ifmsgcontain"sell xxx" then
doPlayerRemoveItem


blabla

But i think that would be alot of work since they buy and sell alot...

//Massen

if u use the 8.2 npc i believe you can put
Code:
elseif((isFocused(cid)) and (msg == "wares" or msg == "trade")) and (getPlayerStorageValue(cid,XXXXX) == XX) then
		selfSay("Pretty nice, right?", cid)
		openShopWindow(cid, itemWindow, onBuy, onSell)

that way it checks with the storage value b4 opening the trade window
 
Back
Top