LoveSong
New Member
- Joined
- Dec 16, 2007
- Messages
- 185
- Reaction score
- 0
Hello! I've got a Problem with my Potion NPC!
He sells all potion(normal potion, strong and great)
But the problem is everytime when i say:
Buy srtong potion or buy great poition he says:
Want to buy 1 health potion or want to buy 1 mana potion?
He dont sells the strong and great potions...
How i can fix that?
Here is my Script:
Please help me
He sells all potion(normal potion, strong and great)
But the problem is everytime when i say:
Buy srtong potion or buy great poition he says:
Want to buy 1 health potion or want to buy 1 mana potion?
He dont sells the strong and great potions...
How i can fix that?
Here is my Script:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- OTServ old functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'vial'}, 2006, 10, 'vial')
shopModule:addSellableItem({'flask'}, 2006, 10, 'flask')
shopModule:addBuyableItem({'shovel'}, 2554, 45, 'shovel')
shopModule:addBuyableItem({'torch'}, 2050, 2, 'torch')
shopModule:addBuyableItem({'rope'}, 2120, 50, 'rope')
shopModule:addBuyableItem({'pick'}, 2553, 120, 'pick')
shopModule:addBuyableItem({'brown backpack'}, 1988, 20, 'brown backpack')
shopModule:addBuyableItem({'green backpack'}, 1998, 20, 'green backpack')
shopModule:addBuyableItem({'mana potion'}, 7620, 50, 'mana potion')
shopModule:addBuyableItem({'stong mana potion'}, 7589, 150, 'strong mana potion')
shopModule:addBuyableItem({'great mana potion'}, 7590, 250, 'great mana potion')
shopModule:addBuyableItem({'health potion'}, 7618, 50, 'health potion')
shopModule:addBuyableItem({'strong health potion'}, 7588, 150, 'strong health potion')
shopModule:addBuyableItem({'great health potion'}, 7591, 250, 'great health potion')
npcHandler:addModule(FocusModule:new())
Last edited by a moderator: