darkmu
Well-Known Member
I am trying to do a function to adapt my system, it is an arena and inside the arena will summon several monsters in random spaces, however I am not able to make them sum up in space and only in place.
TFS 1.3
As we realize he summons in just one place, my goal is to summon up several monsters in random places within the arena.
Can you help me? I'm trying to adapt this function: Lua - Monster dont spawning on random position (https://otland.net/threads/monster-dont-spawning-on-random-position.256308/#post-2483501)
TFS 1.3
Lua:
_CHAMPARENA_LH = {
monsterPos = {x = 130, y = 362, z = 7},
arenaCenter = {x = 132, y = 362, z = 7},
arenaLength = 2,
arenaWidth = 3
}
function _CHAMPARENA_LH.sendWave(number)
if Game.getStorageValue(_CHAMPARENA_LH.global_storage) < 0 then
return false
end
for name, amount in pairs(_CHAMPARENA_LH.waves[number]) do
for i = 1, amount do
local cid = Game.createMonster(name, _CHAMPARENA_LH.monsterPos, true, true)
cid:registerEvent("CHArenaDeath")
end
Position(_CHAMPARENA_LH.monsterPos):sendMagicEffect(11)
end
Game.setStorageValue(_CHAMPARENA_LH.global_storage, number)
Game.setStorageValue(_CHAMPARENA_LH.global_aux, -1)
addEvent(_CHAMPARENA_LH.prepareWave, _CHAMPARENA_LH.waveInterval * 60000, number + 1)
return true
end
As we realize he summons in just one place, my goal is to summon up several monsters in random places within the arena.
Can you help me? I'm trying to adapt this function: Lua - Monster dont spawning on random position (https://otland.net/threads/monster-dont-spawning-on-random-position.256308/#post-2483501)