local config = {
timeToRemove = 60, -- seconds
message = "Go into the teleport in 60 seconds, else it will disappear.",
teleportId = 9773,
bosses = { -- Monster Name, Teleport Position
["Ushuriel"] = { pos={ x=32805, y=31347, z=11, stackpos=2 }, aid=1001},
["Zugurosh"] = { pos={ x=32837, y=31346, z=11, stackpos=2 }, aid=1002},
["Madareth"] = { pos={ x=32820, y=31387, z=11, stackpos=2 }, aid=1003},
["Annihilon"] = { pos={ x=32895, y=31347, z=11, stackpos=2 }, aid=1005},
["Hellgorak"] = { pos={ x=32900, y=31389, z=11, stackpos=2 }, aid=1006},
["Golgordan"] = {pos={ x=32855, y=31387, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=32855, y=31387, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 32844, y = 31390, z = 11},
toPos = {x = 32866, y = 31374, z = 11} } }
}
local function change(position)
doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", 3000)
return TRUE
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
local position = t.pos
doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(change, 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 position = t.pos
doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", t.aid)
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end