RevScript Boss / Monster Apparition Tile

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Hola a todos

Hoy les compartimos la aparicion al pasar en una TILE ( anadiendo ActionID en remeres map editor en una Tile , en el ejemplo actionId=32147 )
Con un cooldown de 1 hora, hace aparecer varios monsters, puede ser 1 , como 50.


Video Password: lepiigortv
Video link:

Código:
local config = {
    actionId = 32147,
    delay = 60 * 60, -- 1 hour
    delayPersistent = false,
    bosses = {
        { name = "Goshnar Spite", pos = Position(32368, 32165, 7) },
        { name = "Goshnar Cruelty", pos = Position(32371, 32165, 7) },
        { name = "Infernal Demon", pos = Position(32373, 32169, 7) },
        { name = "The Nightmare Beast", pos = Position(32371, 32165, 7) },
        { name = "Ancient Lion Knight", pos = Position(32366, 32170, 7) },
        { name = "Bragrumol", pos = Position(32367, 32172, 7) }
    }
}

local movIn = MoveEvent()

function movIn.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end
    local playerId = player:getId()
    local ground = Tile(position):getGround()
    if ground then
        local now = os.time()
        local delay = config.delayPersistent and ground:getCustomAttribute("delay") or config.time
        if not delay or delay <= now then
            position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            for _, info in pairs(config.bosses) do
                Game.createMonster(info.name, info.pos)
            end
            if not config.delayPersistent then
                config.time = now + config.delay
            else
                ground:setCustomAttribute("delay", now + config.delay)
            end
        else
            position:sendMagicEffect(CONST_ME_POFF)
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, string.format("You must wait %d seconds to summon the bosses again.", delay - now))
        end
    end
    return true
end

movIn:aid(config.actionId)
movIn:register()
 
E

Ethank1200

Invitado
Me pregunto si en ves de una hora como aria para que fuera cada 20 minutos.?
 
Arriba