--[[
name: Boss name
pos: Position he should spawn
time: How long after server start up should the boss spawn. (minutes)
respawn: How long after it is killed for it to spawn again. (minutes)
msg: Message when the boss spawns
msgKilled: Message when the boss is killed
]]--
MAP_BOSSES_CONFIG = {
[1] = {id = 1, name = "Demon", pos = Position(1000, 1000, 7), time = 30, respawn = 60, msg = "Demon Spawned!", msgKilled = "Demon has been slain!"},
[2] = {id = 2, name = "Morgaroth", pos = Position(1000, 1000, 7), time = 45, respawn = 60, msg = "Morgaroth Spawned!", msgKilled = "Morgaroth has been slain!"}
}
MAP_BOSSES_IDS = {}
for i = 1, #MAP_BOSSES_CONFIG do
MAP_BOSSES_IDS[i] = 0
end
function spawnMapBoss(id)
local bossConf = MAP_BOSSES_CONFIG[id]
if not bossConf then return true end
if MAP_BOSSES_IDS[id] and MAP_BOSSES_IDS[id] ~= 0 then return true end
local BOSS = Game.createMonster(bossConf.name, bossConf.pos)
MAP_BOSSES_IDS[id] = BOSS:getId()
return true
end