[COLOR="#008000"]local config = {
createTeleportPos = {x = 980, y = 433, z = 8},
teleportToPos = {x = 984, y = 431, z = 8},
timeBeforeTeleportDisappear = 2 * 60 * 1000,
roomUpperLeftPos = {x = 980, y = 428, z = 8},
roomLowerRightPos = {x = 986, y = 433, z = 8},
bossSpawnPos = {x = 982, y = 430, z = 8},
bossName = "Ghazbaran",
bossSpawnMsg = "Time to go and loot Ghazbaran!"
}[/COLOR]
local function removeBossMonsterFromRoom()
for _x = config.roomUpperLeftPos.x, config.roomLowerRightPos.x do
for _y = config.roomUpperLeftPos.y, config.roomLowerRightPos.y do
for _z = config.roomUpperLeftPos.z, config.roomLowerRightPos.z do
local position = {x = _x, y = _y, z = _z}
local creature = getTopCreature(position)
if creature.type == 2 and getCreatureName(creature.uid) == config.bossName then
doRemoveCreature(creature.uid)
end
end
end
end
end
local function removeTeleport()
local teleportItem = getTileItemById(config.createTeleportPos, 1387)
if teleportItem.itemid == 1387 then
doRemoveItem(teleportItem.uid, 1)
doSendMagicEffect(config.createTeleportPos, CONST_ME_POFF)
end
end
function onThink(cid, interval, lastExecution)
removeBossMonsterFromRoom()
doSummonCreature(config.bossName, config.bossSpawnPos)
doCreateTeleport(1387, config.teleportToPos, config.createTeleportPos)
addEvent(removeTeleport, config.timeBeforeTeleportDisappear)
broadcastMessage(config.bossSpawnMsg, MESSAGE_STATUS_WARNING)
return TRUE
end