Thorn
Spriting since 2013
hello guys, something weird has come up, i have this raid system that works all the time, but yesterday at 13:30 (always at that time) only spanwed orc warrlords, and today also, when i tried in a different time it worked as usual, but it has worked good at 13:30 for many days, so i dont see the problem D:
Code:
local cfg = {
monsters = {'Orc','Orc Shaman','Orc Berserker','Orc Leader','Orc Rider','Orc Spearman','Orc Warrior','Orcarmor','Orchelmet','Orcshield'},
centerPos = Position(1010, 974, 7)
}
function onTime(interval)
broadcastMessage("Invasion de orcos en Garuda!!", MESSAGE_STATUS_WARNING)
local pos = cfg.centerPos
local monsterCount = math.random(1500) -- How many monsters will spawn?
local spawned = 0
for i = 1, monsterCount do
local randX, randY = math.random(-60, 60), math.random(-60, 60)
local spawnPosition = Position(pos.x + randX, pos.y + randY, pos.z)
local tile = Tile(spawnPosition)
if tile and (not tile:getHouse()) and (not (tile:getCreatureCount() > 0)) and (not tile:hasFlag(TILESTATE_PROTECTIONZONE)) then
Game.createMonster(cfg.monsters[math.random(#cfg.monsters)], spawnPosition, true)
spawned = spawned + 1
end
end
return true
end