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
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:addModule(FocusModule:new())
function onThink()
talk = math.random(1,100)
if talk == 1 then
doCreatureSay(getNpcCid(), "Hear me! Hear me! The mage Wyrdin in the Edron academy is looking for brave adventurers to undertake a task!", TALKTYPE_YELL)
elseif talk == 50 then
doCreatureSay(getNpcCid(), "Hear me! Hear me! The postmaster's guild has open spots for aspiring postmen! Contact Kevin Postner at the post office in the plains south of Kazordoon!", TALKTYPE_YELL)
elseif talk == 100 then
doCreatureSay(getNpcCid(), "Hear me! Hear me! The inquisition is looking for daring people to fight evil! Apply at the inquisition headquarters next to the Thaian jail!", TALKTYPE_YELL)
end
npcHandler:onThink()
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())