config = {
mana = 100, -- need mana to use spell
tpTime = 5, -- how many seconds teleport working
}
function removeTeleport(x)
doRemoveItem(x[1], 1)
doSendMagicEffect(x[2], 2)
end
function onSay(cid, words, param)
if getPlayerMana(cid) >= config.mana then
if getCreatureCondition(cid, 1024) <= 0 then
teleport = doCreateTeleport(1387, getPlayerMasterPos(cid), getPlayerPosition(cid))
addEvent(removeTeleport, config.tpTime*1000, {teleport, getPlayerPosition(cid)})
else
doPlayerSendCancel(cid, "You cannot goto teleport because you are agressive.")
end
else
doPlayerSendCancel(cid, "You don't have enough mana.")
end
return TRUE
end