• 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!

onTime + randon boss

leandroluck

New Member
Joined
Dec 24, 2010
Messages
104
Reaction score
1
Code:
 local spawns = {
    [1]  = {position = Position(33621,31012,7), monster = 'Bubble'},
    [2]  = {position = Position(33621,31012,7), monster = 'Cachero'},
    [3]  = {position = Position(33621,31012,7), monster = 'Eternal Oblivion'},
    [4]  = {position = Position(33621,31012,7), monster = 'Mateusz Dragon Wielki'},
    [5]  = {position = Position(33621,31012,7), monster = 'Smoked'},
    [6]  = {position = Position(33621,31012,7), monster = 'Tripida'},
    [7]  = {position = Position(33621,31012,7), monster = 'Bubble'}   
} 
    local spawn = spawns[math.random(#spawns)]
    Game.createMonster(spawn.monster, spawn.position, false, true)
    return true
end

the code is incomplete my idea is that every day at 17:00 the script is executed
and 1 random boss is summoned
 
Solution
HTML:
<globalevent name="BossSpawn" time="17:00:00" script="events/boss_spawn.lua" />

Lua:
 local spawns = {
    [1]  = {position = Position(33621,31012,7), monster = 'Bubble'},
    [2]  = {position = Position(33621,31012,7), monster = 'Cachero'},
    [3]  = {position = Position(33621,31012,7), monster = 'Eternal Oblivion'},
    [4]  = {position = Position(33621,31012,7), monster = 'Mateusz Dragon Wielki'},
    [5]  = {position = Position(33621,31012,7), monster = 'Smoked'},
    [6]  = {position = Position(33621,31012,7), monster = 'Tripida'},
    [7]  = {position = Position(33621,31012,7), monster = 'Bubble'}
}

function onTime(interval)
    local spawn = spawns[math.random(#spawns)]
    local monster = Game.createMonster(spawn.monster...
HTML:
<globalevent name="BossSpawn" time="17:00:00" script="events/boss_spawn.lua" />

Lua:
 local spawns = {
    [1]  = {position = Position(33621,31012,7), monster = 'Bubble'},
    [2]  = {position = Position(33621,31012,7), monster = 'Cachero'},
    [3]  = {position = Position(33621,31012,7), monster = 'Eternal Oblivion'},
    [4]  = {position = Position(33621,31012,7), monster = 'Mateusz Dragon Wielki'},
    [5]  = {position = Position(33621,31012,7), monster = 'Smoked'},
    [6]  = {position = Position(33621,31012,7), monster = 'Tripida'},
    [7]  = {position = Position(33621,31012,7), monster = 'Bubble'}
}

function onTime(interval)
    local spawn = spawns[math.random(#spawns)]
    local monster = Game.createMonster(spawn.monster, spawn.position, true, true)
    if not monster then
        print('>> Failed to spawn '..rand.bossName..'.')
        return true
    end
    monster:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    print('>> The boss: ' ..monster:getName() .. ' spawn.')
    return true
end
 
Solution
Back
Top