local config = {
respawnSecs = 10800, -- how many seconds until next boss spawns
storage = 5050,
bosspos = {x=1000,y=1000,z=7}, -- position of the boss spawn
bossspawnstorage = 5053
}
local t = {'boss1','boss2','boss3'}
local function orlend()
doCreateMonster(t[math.random(#t)], config.bosspos)
doBroadcastMessage('A boss was spawned in the arena', MESSAGE_STATUS_CONSOLE_ORANGE)
doSetStorage(config.bossspawnstorage, 0)
end
function onKill(cid, target, damage, flags)
if bit.band(flags, 1) == 1 and isMonster(target) and getCreatureMaster(target) == target and getPlayerStorageValue(cid,config.storage) == 1 then
local s = getCreatureName(target)
if isInArray(t, s:lower()) and getStorage(config.bossspawnstorage) == 0 then
doBroadcastMessage(getCreatureName(cid)..' has just killed the boss "'..s..'", a new boss will spawn in '..config.respawnSecs..' seconds!', MESSAGE_STATUS_CONSOLE_ORANGE)
doSetStorage(config.bossspawnstorage,1)
addEvent(orlend, config.respawnSecs*1000)
end
end
return true
end