local config = {
timeToRemove = 180, -- seconds
message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear",
teleportId = 9773,
bosses = { -- Monster Name, Teleport Position
["Ushuriel"] = { pos={ x=237, y=348, z=12, stackpos=1 }, aid=1001 },
["Zugurosh"] = { pos={ x=314, y=474, z=13, stackpos=1 }, aid=1002},
["Madareth"] = { pos={ x=287, y=365, z=13, stackpos=1 }, aid=1003},
["Annihilon"] = { pos={ x=294, y=681, z=13, stackpos=1 }, aid=1005},
["Hellgorak"] = { pos={ x=255, y=467, z=13, stackpos=1 }, aid=1006}
},
brothers ={
["Golgordan"] = {pos={ x=408, y=413, z=13, stackpos=1 },aid=1004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=408, y=413, z=13, stackpos=1 },aid=1004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 497, y = 339, z = 13},
toPos = {x = 513, y = 351, z = 13} } }
}
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
elseif(config.brothers[getCreatureName(target)]) then
local t = config.brothers[getCreatureName(target)]
local brother = getCreatureByName(t.brother)
if(isMonster(brother) == true) then
if(isInRange(getCreaturePosition(brother), config.brothers.brothersArea.fromPos, config.brothers.brothersArea.toPos) == true) then
return TRUE
end
else
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end