local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
elseif msgcontains(msg, 'earthquake') then
npcHandler:say('Well, the earthquake comes from me and my monsters, but because you fought well take this! And get out, now!', cid)
npcHandler:releaseFocus(cid)
doTeleportThing(cid, {x=1000, y=1000, z=7})
doSendMagicEffect({x=1000, y=1000, z=7}, CONST_ME_TELEPORT)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())