Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? Global Tsf 1.3

 

Qual o motivo deste tópico? ajuda com action

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

 

 

Você tem o código disponível? Se tiver publique-o aqui: 

local config = {
    centerRoom = Position(33584, 32689, 14),
    BossPosition = Position(33584, 32689, 14),
    playerPositions = {
        Position(33593, 32644, 14),
        Position(33593, 32645, 14),
        Position(33593, 32646, 14),
        Position(33593, 32647, 14),
        Position(33593, 32648, 14)
    },
    newPosition = Position(33585, 32693, 14)
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 9825 then
        if player:getPosition() ~= Position(33593, 32644, 14) then
            item:transform(9826)
            return true
        end
    end
    if item.itemid == 9825 then
        local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with Mazoran.")
                return true
            end
        end
            local spectators = Game.getSpectators(config.BossPosition, false, false, 20, 20, 20, 20)
    for i = 1, #spectators do
        local spectator = spectators[i]
        if spectator:isMonster() then
            spectator:remove()
                            return true
            end
            end
        Game.createMonster("Mazoran", config.BossPosition, true, true)
        for y = 32644, 32648 do
            local playerTile = Tile(Position(33593, y, 14)):getTopCreature()
            if playerTile and playerTile:isPlayer() then
                playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
                playerTile:teleportTo(config.newPosition)
                playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            end
        end
        Game.setStorageValue(GlobalStorage.FerumbrasAscendantQuest.MazoranTimer, 1)
        addEvent(clearForgotten, 30 * 60 * 1000, Position(33572, 32679, 14), Position(33599, 32701, 14), Position(33319, 32318, 13), GlobalStorage.FerumbrasAscendantQuest.MazoranTimer)
        item:transform(9826)
    elseif item.itemid == 9826 then
        item:transform(9825)
    end
    return true
end
 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

  • 2 weeks later...
Postado
  • Diretor

TESTA AI

 

local config = {
    centerRoom = Position(33584, 32689, 14),
    BossPosition = Position(33584, 32689, 14),
    playerPositions = {
        Position(33593, 32644, 14),
        Position(33593, 32645, 14),
        Position(33593, 32646, 14),
        Position(33593, 32647, 14),
        Position(33593, 32648, 14)
    },
    newPosition = Position(33585, 32693, 14),
    cooldownTime = 120 --(2 minutos)
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local lastUse = Game.getStorageValue(GlobalStorage.FerumbrasAscendantQuest.MazoranLeverCooldown)
    local currentTime = os.time()

    if lastUse > 0 and currentTime - lastUse < config.cooldownTime then
        local remainingTime = config.cooldownTime - (currentTime - lastUse)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você precisa aguardar " .. remainingTime .. " segundos para puxar a alavanca novamente.")
        return true
    end

    if item.itemid == 9825 then
        local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Alguém já está enfrentando Mazoran.")
                return true
            end
        end

        local spectators = Game.getSpectators(config.BossPosition, false, false, 20, 20, 20, 20)
        for i = 1, #spectators do
            local spectator = spectators[i]
            if spectator:isMonster() then
                spectator:remove()
                return true
            end
        end


        Game.createMonster("Mazoran", config.BossPosition, true, true)


        for y = 32644, 32648 do
            local playerTile = Tile(Position(33593, y, 14)):getTopCreature()
            if playerTile and playerTile:isPlayer() then
                playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
                playerTile:teleportTo(config.newPosition)
                playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            end
        end


        Game.setStorageValue(GlobalStorage.FerumbrasAscendantQuest.MazoranLeverCooldown, currentTime)


        Game.setStorageValue(GlobalStorage.FerumbrasAscendantQuest.MazoranTimer, 1)
        addEvent(clearForgotten, 30 * 60 * 1000, Position(33572, 32679, 14), Position(33599, 32701, 14), Position(33319, 32318, 13), GlobalStorage.FerumbrasAscendantQuest.MazoranTimer)

        item:transform(9826)
    elseif item.itemid == 9826 then
        item:transform(9825)
    end
    return true
end

 

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo