Hello
Is there anyone here who could help me in edit NPC to sell random mushrooms?
I tried to edit the Santa Claus script but nothing came out of it
Is there anyone here who could help me in edit NPC to sell random mushrooms?
I tried to edit the Santa Claus script but nothing came out of it
Code:
dofile(getDataDir() .. 'npc/scripts/lib/greeting.lua')
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'white mushroom'}, 2787, 10)
shopModule:addBuyableItem({'red mushroom'}, 2788, 10)
shopModule:addBuyableItem({'brown mushroom'}, 2789, 10)
shopModule:addBuyableItem({'orange mushroom'}, 2790, 10)
shopModule:addBuyableItem({'wood mushroom'}, 2791, 10)
shopModule:addBuyableItem({'dark mushroom'}, 2792, 10)
shopModule:addBuyableItem({'some mushroom'}, 2793, 10)
shopModule:addBuyableItem({'some mushroom'}, 2794, 10)
shopModule:addBuyableItem({'fire mushroom'}, 2795, 10)
shopModule:addBuyableItem({'green mushroom'}, 2796, 10)
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Watch the sky, it will tell you."})
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())