local function doTeleportPlayer(cid)
if isPlayer(cid) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported to the temple.")
end
end
local function doSendEffect(cid, c)
doSendAnimatedText(getCreaturePosition(cid), 10-c, math.random(200))
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "You can't use this when you're in a fight.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end
doRemoveItem(item.uid, 1)
addEvent(doTeleportPlayer, 10 * 1000, cid)
for c = 0, 9 do
addEvent(doSendEffect, c * 1000, cid, c)
end
return true
end