Action Remover Teleport

naval288
em Scripts

naval288

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/05/18Posts: 4

essa action que eu tenho funciona perfeitamente. só preciso que ela remova o teleport depois de 5 mim. alguem poderia ajudar o amigo!

 

 

local config = {
    teleportId = 27723,
    days = {
        ["Tuesday"] = {Position(998, 996, 7), Position(1487, 308, 13)}, -- Morshabaal - monday-Segunda, tuesday-Terça, wednesday-Quarta, thursday-Quinta, friday-Sexta, saturday-Sabado and sunday-Domingo
    },
    bossPosition = Position(1507, 309, 14),
    bossName     = "Gaz'haragoth",
    spawnTime    = '18:43:00'
}

local Gazharagoth = GlobalEvent("Gazharagoth")
function Gazharagoth.onTime(interval)
    local day = config.days[os.date("%A")]
    if day then
        Game.broadcastMessage(config.bossName .. ' In revenge for my brother death, I will devastate this continent!', MESSAGE_GAME_HIGHLIGHT)
        Game.broadcastMessage(config.bossName .. ' In revenge for my brother death, I will devastate this continent!', MESSAGE_EVENT_ADVANCE)
        local item = Game.createItem(config.teleportId, 1, day[1])
        if item then
            if not item:isTeleport() then
                item:remove()
                return false
            end
            item:setDestination(day[2])
        end
        addEvent(function()
            Game.createMonster(config.bossName, config.bossPosition, false, true)
        end, 5000)
    end
    return true
end

Gazharagoth:time(config.spawnTime)
Gazharagoth:register()

L3K0T

LEVEL UP!
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 02/01/14Posts: 304Gênero: OutroChar no Tibia: Psy Skyline

local config = {
    teleportId = 27723,
    days = {
        ["Tuesday"] = {Position(998, 996, 7), Position(1487, 308, 13)},
    },
    bossPosition = Position(1507, 309, 14),
    bossName = "Gaz'haragoth",
    spawnTime = '18:43:00',
    teleportDuration = 5 * 60 * 1000,
}

local Gazharagoth = GlobalEvent("Gazharagoth")

local function removeTeleport()
    local teleportItem = Tile(config.days["Tuesday"][1]):getItemById(config.teleportId)
    if teleportItem then
        teleportItem:remove()
    end
end

function Gazharagoth.onTime(interval)
    local day = config.days[os.date("%A")]
    if day then
        Game.broadcastMessage(config.bossName .. ' Em vingança pela morte do meu irmão, eu devastarei este continente!', MESSAGE_GAME_HIGHLIGHT)
        Game.broadcastMessage(config.bossName .. ' Em vingança pela morte do meu irmão, eu devastarei este continente!', MESSAGE_EVENT_ADVANCE)
        local item = Game.createItem(config.teleportId, 1, day[1])
        if item and item:isTeleport() then
            item:setDestination(day[2])
            addEvent(function()
                Game.createMonster(config.bossName, config.bossPosition, false, true)
                addEvent(removeTeleport, config.teleportDuration)
            end, 5000)
        end
    end
    return true
end

Gazharagoth:time(config.spawnTime)
Gazharagoth:register()
 

ESTOU

Hospedado-por-claro1.png

e

bn3-600x100.png

 

Facebook Contato: www.facebook.com/alexolekynho

Skype: alex.souza238