Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Video de Demonstração

________________________________________________

data/firestorm_event.lua

-- firestorm Variables
fsJoinedCountGlobalStorage = 18900 --Player joined event count / recuento de players.
fsJoinStorage = 18901 --player join storage / storage del jugador a unirse.
fsMinPlayers = 2 --min players needed when time runout / minimo de players necesarios para comenzar el evento.
fsMaxPlayers = 5 --max players to join / maximo de players.
fsTrophy = 7369 --trophy itemid / itemid del premio(que no sea stackable).
fsEventCountGlobalStorage = 18902 --firestorm Count (no move/no moverle).
 
fsWaitMinutes = 1 --when event has opened, how long until it starts? / cuantos minutos tarde el evento en empezar.
fsWaitingRoomPos = Position(1016, 940, 7) --middle of waiting room / punto medio de el cuarto de espera.
fsArena = Position(991, 930, 7) --when even start where should player be teleported in the arena? / punto donde seran transportados los players.
fsArenaFromPosition = Position(984, 925, 7) --pos of top left corner / posicion de esquina superior izquierda.
fsArenaToPosition = Position(998, 935, 7) --pos of bottom right corner /posicion de esquina inferior derecha.
fsMiddleEventArena = Position(991, 930, 7) --Middle pos of the arena / punto medio de la arena
fsWaitingRoomRadiusX = 8 --depends how big the waiting room is 20sqm to x / depende de lo grande la sala de espera en x
fsWaitingRoomRadiusY = 8 --depends how big the waiting room is 20sqm to y / depende de lo grande la sala de espera en y
fsEventArenaRadiusX = 15 --Depends how big the firestorm arena is 50sqm to x / depende de lo grande de la arena en x
fsEventArenaRadiusY = 15 --Depends how big the firestorm arena is 50sqm to y / depende de lo grande de la arena en y
fsStartedGlobalStorage = 18903 -- Value: 0 == false, 1 == true, 2 == started --State of the event
fsCreateTeleportPosition = Position(1000, 1000, 7) --Where should the teleport be created? / posicion donde sera creado el teleport?
 
function startfirestorm()
    local specs = Game.getSpectators(fsWaitingRoomPos, false, true, 0, fsWaitingRoomRadiusX, 0, fsWaitingRoomRadiusY)
        if Game.getStorageValue(fsJoinedCountGlobalStorage) <= fsMinPlayers then
                   for i = 1, #specs do
                    specs[i]:teleportTo(specs[i]:getTown():getTemplePosition(), false)
                    specs[i]:setStorageValue(fsJoinStorage, 0)
            end
                    resetfsVariables()
            Game.broadcastMessage('firestorm Event failed to start, because of to little players joined the event!', MESSAGE_STATUS_WARNING)
            return true
        end
        for i = 1, #specs do
                local rX, rY, rZ
                rX = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
        rY = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
        rZ = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
            specs[i]:teleportTo(Position(rX, rY, rZ))
        end
        Game.broadcastMessage("firestorm Event has started, good luck to all participant.", MESSAGE_STATUS_WARNING)
        Game.setStorageValue(fsStartedGlobalStorage, 2)
           doStartfirestorm()
end
 
 
function doStartfirestorm()
        if  Game.getStorageValue(fsJoinedCountGlobalStorage) > fsMaxPlayers then return false end
                if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
                local specs = Game.getSpectators(fsArena, false, true, 0, 10, 0, 10)
                 for i = 1, #specs do
        local randX, randY, randZ
        randX = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
        randY = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
        randZ = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
                local randfire = Position(randX, randY, randZ)
                 local randX1, randY1, randZ1
        randX1 = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
        randY1 = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
        randZ1 = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
                local randfire1 = Position(randX1, randY1, randZ1)
            local creature, players = nil, Game.getPlayers()
                                                 for i = 1, #players do
                                                 creature = players[i]
                doSendDistanceShoot(fsArenaFromPosition, randfire, 4)
                doSendDistanceShoot(fsArenaToPosition, randfire, 4)
                doSendDistanceShoot(Position(998, 925, 7), randfire, 4)
                doSendDistanceShoot(Position(984, 935, 7), randfire, 4)
            doAreaCombatHealth(creature.uid, COMBAT_HOLYDAMAGE, randfire,randfire, -9999, -1000000,7)
                end
                                end
 
            addEvent(doStartfirestorm, 500)
        end
end
 
function resetfsVariables()
        Game.setStorageValue(fsEventCountGlobalStorage, 0)
        Game.setStorageValue(fsJoinedCountGlobalStorage, 0)
        Game.setStorageValue(fsStartedGlobalStorage, 0)
end
creaturescripts/scripts
dofile('data/firestorm_event.lua')
function onPrepareDeath(player, killer)
    local winner = 0
        if player:getStorageValue(fsJoinStorage) >= 1 then
            Game.setStorageValue(fsJoinedCountGlobalStorage, Game.getStorageValue(fsJoinedCountGlobalStorage)-1)
        player:teleportTo(player:getTown():getTemplePosition())
        player:setStorageValue(fsJoinStorage, 0)
        player:addHealth(player:getMaxHealth())
 
                if Game.getStorageValue(fsJoinedCountGlobalStorage) <= 1 then --Event ended, someone won!
         local pla, play = nil, Game.getPlayers()
         for i = 1, #play do
                 pla = play[i]
                           if pla:getStorageValue(fsJoinStorage) == 1 then
                        winner = pla:getId()
                        break
                        end
            end
            winner = Player(winner)
             if winner then
                winner:teleportTo(winner:getTown():getTemplePosition())
                                winner:addHealth(winner:getMaxHealth())
                local trophy = winner:addItem(fsTrophy, 1)
                if trophy then
                    trophy:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, '['.. winner:getName() ..'] has won the firestorm Event.')
                end
                 Game.broadcastMessage(string.format('%s is the winner of firestorm Event', winner:getName()), MESSAGE_STATUS_WARNING)
            end
            resetfsVariables()
        end
        return false
    end
    return true
end


Creaturescripts/scripts

dofile('data/firestorm_event.lua')
function onPrepareDeath(player, killer)
    local winner = 0
    if player:getStorageValue(fsJoinStorage) >= 1 then
       Game.setStorageValue(fsJoinedCountGlobalStorage, Game.getStorageValue(fsJoinedCountGlobalStorage)-1)
        player:teleportTo(player:getTown():getTemplePosition())
        player:setStorageValue(fsJoinStorage, 0)
        player:addHealth(player:getMaxHealth())

        if Game.getStorageValue(fsJoinedCountGlobalStorage) <= 1 then --Event ended, someone won!
         local pla, play = nil, Game.getPlayers()
         for i = 1, #play do
        pla = play
              if pla:getStorageValue(fsJoinStorage) == 1 then
            winner = pla:getId()
            break
            end
            end
            winner = Player(winner)
             if winner then
                winner:teleportTo(winner:getTown():getTemplePosition())
                winner:addHealth(winner:getMaxHealth())
                local trophy = winner:addItem(fsTrophy, 1)
                if trophy then
                    trophy:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, '['.. winner:getName() ..'] has won the firestorm Event.')
                end
                 Game.broadcastMessage(string.format('%s is the winner of firestorm Event', winner:getName()), MESSAGE_STATUS_WARNING)
            end
            resetfsVariables()
        end
        return false
    end
    return true
end

creaturescripts.xml

<!-- firestorm -->
    <event type="prepareDeath" name="fire_event" script="xxxx.lua"/>

login

player:registerEvent("fire_event")

globalevents/scripts

dofile('data/firestorm_event.lua')
function onThink(interval, lastExecution, thinkInterval)
resetfsVariables()
if Game.getStorageValue(fsStartedGlobalStorage) < 1 then
  local teleport = doCreateItem(11796,1,fsCreateTeleportPosition)
  if teleport then
   doSetItemActionId(teleport, 5499)
  doSendMagicEffect(fsCreateTeleportPosition, CONST_ME_TELEPORT)
end
local r_tp = Tile(fsCreateTeleportPosition):getItemById(11796)
addEvent(function() r_tp:remove() getTileItemById(fsCreateTeleportPosition, 11796) end, 60 * 1000)
addEvent(function() doSendMagicEffect(fsCreateTeleportPosition, CONST_ME_TELEPORT) end, 60 * 1000)
  end
  Game.setStorageValue(fsStartedGlobalStorage,1)
  print('firestorm Event has started & waiting for players to join! Min: '.. fsMinPlayers ..'/'.. fsMaxPlayers ..'.')
  Game.broadcastMessage('The firestorm Event has started! You have '.. fsWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
  addEvent(startfirestorm, fsWaitMinutes * 60 * 1000)
        return true
        end

globalevents.xml

<!-- FireStorm-->
    <globalevent name="firestorm_event" interval="72000000" script="xxxx.lua"/>

movements/scripts

dofile('data/firestorm_event.lua')
      function onStepIn(creature, item, position, fromPosition)
         local player = creature:getPlayer()
        if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Firestorm Event has already started.')
            player:teleportTo(fromPosition, true)
            return false
        end
        if Game.getStorageValue(fsStartedGlobalStorage) == 0 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Firestorm Event has not started yet.')
            player:teleportTo(fromPosition, true)
            return false
        end
       if Game.getStorageValue(fsJoinedCountGlobalStorage) >= fsMaxPlayers then
            player:teleportTo(fromPosition, true)
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Firestorm Event is already full! ['.. Game.getStorageValue(fsJoinedCountGlobalStorage) ..'/'.. fsMaxPlayers ..']')
            return false
        end
        player:teleportTo(fsWaitingRoomPos)
        Game.setStorageValue(fsJoinedCountGlobalStorage, Game.getStorageValue(fsJoinedCountGlobalStorage) + 1)
        Game.broadcastMessage(string.format('%s has joined the Firestorm Event! [%s/'.. fsMaxPlayers ..'].', player:getName(), Game.getStorageValue(fsJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)
        player:setStorageValue(fsJoinStorage, 1)
        return true
        end

Movements.xml

<!-- firestorm -->
    <movevent event="StepIn" actionid="5499" script="xxxx.lua"/>

________________________________________________

Créditos: Scrappy Coco

Editado por Larissa Azhaurn (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
Em nome da comunidade do TK, muito obrigado pela contribuição! :wow: Seu tópico de conteúdo foi aprovado e será movido para a seção adequada. Você ganhou 1 REP+!
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Link para o post
Compartilhar em outros sites

>> continue with Creaturescripts/scripts

Tira essa parte para baixo do code do
firestorm_event.lua.

Abraço.

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites

Olá @Larissa Azhaurn, td bem ? será que tem como usar o meu map que fiz para roda o evento no meu server ??

Agradeço desde já ^^

 300efmd.png

Editado por marcio1234 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Qualquer mapa da certo, apenas configurar o firestorm_event.lua.

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites

Olá @vankk, tenho uma dúvida sobre isso aqui "data/firestorm_event.lua" não era para tá dentro de uma pasta como globalevents ? é só jogar em data funfa certin ?

Obrigado @vankk,  ah vc já testou tá funfando certinho o evento ??

Editado por marcio1234 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Sim e nao. Sim, porque ele ja esta configurado para estar em data. E nao, porque voce pode configurar ele para estar em qualquer file de data, porem, em data e normal de se estar.

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites

Legal, este evento é baseado no 1.0 do Printer, que encontra-se mais compacto, não vi necessidades de mudanças de funções neste 1.2, o 1.0 também funciona nele.
Mas obrigado por contribuir, legal.

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites
  • 1 year later...

Ta quase tudo funcionando certinho, só que quando o fogo esta atingindo o player ele nao sai do evento, alguem pode ajudar?

-- firestorm Variables
fsJoinedCountGlobalStorage = 18900 --Player joined event count / recuento de players.
fsJoinStorage = 18901 --player join storage / storage del jugador a unirse.
fsMinPlayers = 1 --min players needed when time runout / minimo de players necesarios para comenzar el evento.
fsMaxPlayers = 5 --max players to join / maximo de players.
fsTrophy = 7369 --trophy itemid / itemid del premio(que no sea stackable).
fsEventCountGlobalStorage = 18902 --firestorm Count (no move/no moverle).
 
fsWaitMinutes = 2 --when event has opened, how long until it starts? / cuantos minutos tarde el evento en empezar.
fsWaitingRoomPos = Position(961, 1036, 7) --middle of waiting room / punto medio de el cuarto de espera.
fsArena = Position(988, 1036, 7) --when even start where should player be teleported in the arena? / punto donde seran transportados los players.
fsArenaFromPosition = Position(981, 1029, 7) --pos of top left corner / posicion de esquina superior izquierda.
fsArenaToPosition = Position(995, 1043, 7) --pos of bottom right corner /posicion de esquina inferior derecha.
fsMiddleEventArena = Position(988, 1036, 7) --Middle pos of the arena / punto medio de la arena
fsWaitingRoomRadiusX = 11 --depends how big the waiting room is 20sqm to x / depende de lo grande la sala de espera en x
fsWaitingRoomRadiusY = 11 --depends how big the waiting room is 20sqm to y / depende de lo grande la sala de espera en y
fsEventArenaRadiusX = 15 --Depends how big the firestorm arena is 50sqm to x / depende de lo grande de la arena en x
fsEventArenaRadiusY = 15 --Depends how big the firestorm arena is 50sqm to y / depende de lo grande de la arena en y
fsStartedGlobalStorage = 18903 -- Value: 0 == false, 1 == true, 2 == started --State of the event
fsCreateTeleportPosition = Position(32479, 32471, 6) --Where should the teleport be created? / posicion donde sera creado el teleport?
 
function startfirestorm()
    local specs = Game.getSpectators(fsWaitingRoomPos, false, true, 0, fsWaitingRoomRadiusX, 0, fsWaitingRoomRadiusY)
        if Game.getStorageValue(fsJoinedCountGlobalStorage) <= fsMinPlayers then
                   for i = 1, #specs do
                    specs[i]:teleportTo(specs[i]:getTown():getTemplePosition(), false)
                    specs[i]:setStorageValue(fsJoinStorage, 0)
            end
                    resetfsVariables()
            Game.broadcastMessage('firestorm Event failed to start, because of to little players joined the event!', MESSAGE_STATUS_WARNING)
            return true
        end
        for i = 1, #specs do
                local rX, rY, rZ
                rX = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
        rY = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
        rZ = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
            specs[i]:teleportTo(Position(rX, rY, rZ))
        end
        Game.broadcastMessage("firestorm Event has started, good luck to all participant.", MESSAGE_STATUS_WARNING)
        Game.setStorageValue(fsStartedGlobalStorage, 2)
           doStartfirestorm()
end
 
 
function doStartfirestorm()
        if  Game.getStorageValue(fsJoinedCountGlobalStorage) > fsMaxPlayers then return false end
                if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
                local specs = Game.getSpectators(fsArena, false, true, 0, 10, 0, 10)
                 for i = 1, #specs do
        local randX, randY, randZ
        randX = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
        randY = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
        randZ = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
                local randfire = Position(randX, randY, randZ)
                 local randX1, randY1, randZ1
        randX1 = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
        randY1 = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
        randZ1 = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
                local randfire1 = Position(randX1, randY1, randZ1)
            local creature, players = nil, Game.getPlayers()
                                                 for i = 1, #players do
                                                 creature = players[i]
                doSendDistanceShoot(fsArenaFromPosition, randfire, 4)
                doSendDistanceShoot(fsArenaToPosition, randfire, 4)
                doSendDistanceShoot(Position(996, 1044, 7), randfire, 4)
                doSendDistanceShoot(Position(980, 1028, 7), randfire, 4)
            doAreaCombatHealth(creature.uid, COMBAT_HOLYDAMAGE, randfire,randfire, -9999, -1000000,7)
                end
                                end
 
            addEvent(doStartfirestorm, 500)
        end
end
 
function resetfsVariables()
        Game.setStorageValue(fsEventCountGlobalStorage, 0)
        Game.setStorageValue(fsJoinedCountGlobalStorage, 0)
        Game.setStorageValue(fsStartedGlobalStorage, 0)
end

creature

dofile('data/firestorm_event.lua')
function onPrepareDeath(player, killer)
    local winner = 0
        if player:getStorageValue(fsJoinStorage) >= 1 then
            Game.setStorageValue(fsJoinedCountGlobalStorage, Game.getStorageValue(fsJoinedCountGlobalStorage)-1)
        player:teleportTo(player:getTown():getTemplePosition())
        player:setStorageValue(fsJoinStorage, 0)
        player:addHealth(player:getMaxHealth())
 
                if Game.getStorageValue(fsJoinedCountGlobalStorage) <= 1 then --Event ended, someone won!
         local pla, play = nil, Game.getPlayers()
         for i = 1, #play do
                 pla = play[i]
                           if pla:getStorageValue(fsJoinStorage) == 1 then
                        winner = pla:getId()
                        break
                        end
            end
            winner = Player(winner)
             if winner then
                winner:teleportTo(winner:getTown():getTemplePosition())
                                winner:addHealth(winner:getMaxHealth())
                local trophy = winner:addItem(fsTrophy, 1)
                if trophy then
                    trophy:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, '['.. winner:getName() ..'] has won the firestorm Event.')
                end
                 Game.broadcastMessage(string.format('%s is the winner of firestorm Event', winner:getName()), MESSAGE_STATUS_WARNING)
            end
            resetfsVariables()
        end
        return false
    end
    return true
end

globalevents

dofile('data/firestorm_event.lua')
function onTime(interval, lastExecution, thinkInterval)
resetfsVariables()
if Game.getStorageValue(fsStartedGlobalStorage) < 1 then
  local teleport = doCreateItem(11796,1,fsCreateTeleportPosition)
  if teleport then
   doSetItemActionId(teleport, 5499)
  doSendMagicEffect(fsCreateTeleportPosition, CONST_ME_TELEPORT)
end
local r_tp = Tile(fsCreateTeleportPosition):getItemById(11796)
addEvent(function() r_tp:remove() getTileItemById(fsCreateTeleportPosition, 11796) end, 60 * 1000)
addEvent(function() doSendMagicEffect(fsCreateTeleportPosition, CONST_ME_TELEPORT) end, 60 * 1000)
  end
  Game.setStorageValue(fsStartedGlobalStorage,1)
  print('firestorm Event has started & waiting for players to join! Min: '.. fsMinPlayers ..'/'.. fsMaxPlayers ..'.')
  Game.broadcastMessage('The firestorm Event has started! You have '.. fsWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
  addEvent(startfirestorm, fsWaitMinutes * 60 * 1000)
        return true
        end

movements

dofile('data/firestorm_event.lua')
      function onStepIn(creature, item, position, fromPosition)
         local player = creature:getPlayer()
        if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Firestorm Event has already started.')
            player:teleportTo(fromPosition, true)
            return false
        end
        if Game.getStorageValue(fsStartedGlobalStorage) == 0 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Firestorm Event has not started yet.')
            player:teleportTo(fromPosition, true)
            return false
        end
       if Game.getStorageValue(fsJoinedCountGlobalStorage) >= fsMaxPlayers then
            player:teleportTo(fromPosition, true)
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Firestorm Event is already full! ['.. Game.getStorageValue(fsJoinedCountGlobalStorage) ..'/'.. fsMaxPlayers ..']')
            return false
        end
        player:teleportTo(fsWaitingRoomPos)
        Game.setStorageValue(fsJoinedCountGlobalStorage, Game.getStorageValue(fsJoinedCountGlobalStorage) + 1)
        Game.broadcastMessage(string.format('%s has joined the Firestorm Event! [%s/'.. fsMaxPlayers ..'].', player:getName(), Game.getStorageValue(fsJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)
        player:setStorageValue(fsJoinStorage, 1)
        return true
        end

eu só mexi no firestorm_event.lua que foi alterar as posiçoes do lugar do evento

Link para o post
Compartilhar em outros sites
  • 1 year later...

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo