local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local myNewPos = {
[1] = {x=32210, y=31157, z=7},
[2] = {x=32297, y=32831, z=7},
[3] = {x=32574, y=32752, z=7},
[4] = {x=33067, y=32880, z=6},
[5] = {x=33239, y=32483, z=7},
[6] = {x=33170, y=31810, z=6},
[7] = {x=32328, y=31782, z=7}
}
local TpTime = 10800 --secs
local myLastTP = 0
local a = 1
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()
if myLastTP == 0 then
myLastTP = os.time()
end
if os.difftime (os.time(), myLastTP) >= TpTime then
myLastTP = os.time()
doCreatureSay(getNpcCid(), "See you, now Im going to the next city!", TALKTYPE_SAY)
doTeleportThing(getNpcCid(), myNewPos[a], FALSE)
if (a + 1) < 7 then
a = a + 1
else
a = 1
end
end
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay("I don't got all day!")
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay("Good bye then.")
focus = 0
end
end
npcHandler:onThink()
end
npcHandler:addModule(FocusModule:new())