• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ raid isnt summoning all monsters

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
921
Location
Chile
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
 
you don't even have orc warlord defined in the monsters table though
so either your script isn't saved and reloaded or this isn't the correct script
 
you don't even have orc warlord defined in the monsters table though
so either your script isn't saved and reloaded or this isn't the correct script
im sorry, it spawned 'Orcarmor','Orchelmet','Orcshield', wich are orc warlords, so it only spawned orc warlord, i dont know if those three or just 1 of them, but no other orc was summoned :/
 
Check 'Orcarmor','Orchelmet','Orcshield' files, maybe it name in file is "Orc Warlod".
it is, that's the point, they are orc warlords with different loot, and this raid is summoning only orc warlords (not always) so probably those 3, but it doesnt summon the other orcs
 
That is because, it could happend that monster were tried to be summoned into either walls, protection zones or houses. Also those checks are unnecessary since the function itself will not summon on those conditions, if you not set the force flag. Either way i would done something like this:
Code:
local config = {
    monsters = {'Orc','Orc Shaman','Orc Berserker','Orc Leader','Orc Rider','Orc Spearman','Orc Warrior','Orcarmor','Orchelmet','Orcshield'},
    spawnPosition = {centerPosition = Position(1010, 974, 7), radius = 20}
    monsterCount = 1500
}

function onTime(interval)
    broadcastMessage("Invasion de orcos en Garuda!!", MESSAGE_STATUS_WARNING)
    local random = math.random -- keep this outside the loop, since we do not want to recreate the object which is expensive
    for i = 1, config.monsterCount do
        local x = random(config.spawnPosition.centerPosition.x - config.spawnPosition.radius, config.spawnPosition.centerPosition.x + config.spawnPosition.radius)
        local y = random(config.spawnPosition.centerPosition.y - config.spawnPosition.radius, config.spawnPosition.centerPosition.y + config.spawnPosition.radius)
        Game.createMonster(config.monsters[random(#config.monsters)], Positon(x, y, 7))
    end
    return true
end
 
Back
Top Bottom