DRUlD
New Member
- Joined
- Mar 4, 2018
- Messages
- 16
- Reaction score
- 0
Trying to add to the NPC to sell a random bag color
but sth. doesn't work out for me... Can somebody help me?
green bag 1991
yellow bag 1992
red bag 1993
etc.
but sth. doesn't work out for me... Can somebody help me?
green bag 1991
yellow bag 1992
red bag 1993
etc.
Lua:
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: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({'scroll'}, 1949, 5)
shopModule:addBuyableItem({'bag'}, 1994, 5)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())