local config = {
timeToRemove = 60, -- seconds
message = "Go into the teleport in 60 seconds, else it will disappear.",
teleportId = 1387,
bosses = { -- Monster Name, Teleport Position
["Ushuriel"] = { pos={ x = 246, y = 351, z = 12, stackpos=2 }, aid=2001},
["Zugurosh"] = { pos={ x = 390, y = 525, z = 13, stackpos=2 }, aid=2002},
["Madareth"] = { pos={ x = 340, y = 460, z = 13, stackpos=2 }, aid=2003},
["Annihilon"] = { pos={ x = 637, y = 472, z = 13, stackpos=2 }, aid=2005},
["Hellgorak"] = { pos={ x = 335, y = 581, z = 10, stackpos=2 }, aid=2006}
},
brothers ={
["Golgordan"] = {pos={ x = 505, y = 345, z = 13, stackpos=1 },aid=2004, brother = "Latrivan"},
["Latrivan"] = {pos={ x = 505, y = 345, z = 13, stackpos=1 },aid=2004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 505, y = 345, z = 13},
toPos = {x = 408, y = 413, z = 13} } }
}
local function change(position)
doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", 7200)
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