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

Lua make script spawn a monster when all crystals are active

wafuboe

Member
Joined
Dec 24, 2010
Messages
881
Solutions
2
Reaction score
22
hello,
It would be great if someone can make this script spawn a boos when all the crystals are activated. This is a semi part of the ferumbras fight quest. You have to kill a rift invader and it will randomly spawn creatures and when u kill the rift invader the crystal will turn pink. once all crystals are pink i would like to spawn a monster on the area, being reset after some minutes.

Thank you here is the script.

Lua:
local config = {
    [10773] = {
        corpse = 8967,
        boss = 'Rift Invader',
        effect = CONST_ME_BIGCLOUDS,
        summonPos = Position(1824, 1279, 14),
        summonPos1 = Position(1825, 1279, 14),
        summonPos2 = Position(1826, 1279, 14),
        summonPos3 = Position(1827, 1279, 14),
        summonPos4 = Position(1828, 1279, 14),
        summonPos5 = Position(1837, 1275, 14),
        summonPos6 = Position(1836, 1275, 14),
        summonPos7 = Position(1837, 1275, 14),
        summonPos8 = Position(1838, 1275, 14)
    }
}

function onAddItem(moveitem, tileitem, position)
    local target = config[tileitem.itemid]
    if not target then
        return true
    end

    if target.corpse ~= moveitem.itemid then
        return true
    end
        if tileitem.actionid == 45690 and (getTileItemById({x = 1827, y = 1277, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1827, y = 1277, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,6)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 5 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 6 then
        Game.createMonster(target.boss, target.summonPos)
       end
        elseif tileitem.actionid == 45691 and (getTileItemById({x = 1827, y = 1273, z = 14}, 17580).uid ~= 0) then
            doTransformItem(getTileItemById({x = 1827, y = 1273, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,6)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1273, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 5 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 6 then
        Game.createMonster(target.boss, target.summonPos)
           end
        elseif tileitem.actionid == 45692 and (getTileItemById({x = 1830, y = 1280, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1830, y = 1280, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,6)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 5 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 6 then
        Game.createMonster(target.boss, target.summonPos)
       end
        elseif tileitem.actionid == 45693 and (getTileItemById({x = 1834, y = 1280, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1834, y = 1280, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,4)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 3 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       end
        elseif tileitem.actionid == 45694 and (getTileItemById({x = 1837, y = 1277, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1837, y = 1277, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,4)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       end
        elseif tileitem.actionid == 45695 and (getTileItemById({x = 1837, y = 1273, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1837, y = 1273, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,6)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 5 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 6 then
        Game.createMonster(target.boss, target.summonPos)
       end
        elseif tileitem.actionid == 45696 and (getTileItemById({x = 1830, y = 1270, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1830, y = 1270, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,6)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 5 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 6 then
        Game.createMonster(target.boss, target.summonPos)
       end
        elseif tileitem.actionid == 45697 and (getTileItemById({x = 1834, y = 1270, z = 14}, 17580).uid ~= 0) then
           doTransformItem(getTileItemById({x = 1834, y = 1270, z = 14}, 17580).uid, 17586)
       local chance = math.random(1,4)
       if chance < 1 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 2 then
        Game.createMonster(target.boss, target.summonPos)
       elseif chance < 3 then
            local spectators, spectator = Game.getSpectators(Position(1832, 1275, 14), false, false, 15, 15, 15, 15)
            for i = 1, #spectators do
        spectator = spectators[i]
            if spectator:isMonster() then
                 spectator:getPosition():sendMagicEffect(CONST_ME_POFF)
            spectator:remove()
            end
            end
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos1)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos2)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos3)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos4)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos5)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos6)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos7)
        Game.createMonster('Ferumbras Soul Splinter', target.summonPos8)
       elseif chance < 4 then
        Game.createMonster(target.boss, target.summonPos)
       end
        end
    return true
end
 
Back
Top