local config = {
message = "Now You have 2 minutes to come in the teleport on the north room",
timeToRemove = 120, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["monstername"] = { { x = 35163, y = 31944, z = 7 }, { x = 35168, y = 31897, z = 10, stackpos = 1 } },
}
}
local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end
function onDeath(cid, corpse, killer)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
doSendMagicEffect(pos[2], CONST_ME_TELEPORT)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[2])
end
end
return TRUE
end