local config = {
["bossname"] = {time = 60, toPos = {x = 100, y = 100, z = 7}, tpPos = {x = 100, y = 100, z = 7}}
}
local function deleteTeleport(tp)
local teleport = getTileItemById(tp, 1387).uid
if(teleport > 0) then
doRemoveItem(teleport)
doSendMagicEffect(tp, CONST_ME_POFF)
end
return true
end
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if(isPlayer(target) or not monster) then
return true
end
doCreateTeleport(1387, monster.toPos, monster.tpPos)
doCreatureSay(cid, "You have "..monster.time.." seconds to enter the teleport!", TALKTYPE_ORANGE_1)
addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
return true
end