Ir para conteúdo

Featured Replies

  • Respostas 16
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • é as positions, quando for pos e topos é sempre do MENOR para o MAIOR   posiciones = { from = { x = 67, y = 198, z = 7 }, to = { x = 123, y = 155, z = 7 } },   para   posicio

  • creio q seja nesse info, tenta colocar configInv.posiciones.from.x no lugar de todos os info.posiciones

  • na vdd mano eu acho que todo esse script aqui ta bugado, não sei te dizer oq nele, mas tem que refazer kkkkk, tirando o from e topos da config la iria ficar mais facil até, mais tarde eu chego testo e

Posted Images

Postado
local configInv = {
    ["20:29"] = {
        nombre = "TEST",
        posiciones = { from = { x = 130, y = 190, z = 7 }, to = { x = 137, y = 195, z = 7 } },
        monstruos = { "1 Ventinho", "1 Dragon" }
     }
 }
 
 local noPvpDelay = 5
 local monsterRewardId = 0
 local function executeInvasion(config)
    doBroadcastMessage(config.nombre .. " inicio.")
    for index, info in pairs(config.monstruos) do
       local nombreMonstruo = info:match("%s(.+)")
       local monstruoCantidad = tonumber(info:match("(%d+)"))
       local x, y, z = math.random(config.posiciones.from.x, config.posiciones.to.x), math.random(config.posiciones.from.y, config.posiciones.to.y), math.random(config.posiciones.from.z, config.posiciones.to.z)
       local pos = {x = x, y = y, z = z}
       local summon = doSummonCreature(nombreMonstruo, pos)
       if monsterRewardId == 0 and (math.random(100) >= 50 or index == #config.monstruos) then
          monsterRewardId = summon
       end
    end
 end
 function onThink(interval, lastExecution)
    local invasion = configInv[tostring(os.date("%X")):sub(1, 5)]
    if invasion then
       setWorldType(WORLD_TYPE_NO_PVP)
       doBroadcastMessage(invasion.nombre)
       addEvent(executeInvasion, 1000 * 10 * 1, invasion)
       addEvent(setWorldType, 1000 * 60 * noPvpDelay, WORLD_TYPE_PVP)
    end
    return true
 end

 

Postado
  • Autor
  Em 12/04/2022 em 23:22, So volto tarde disse:
local configInv = {
    ["20:29"] = {
        nombre = "TEST",
        posiciones = { from = { x = 130, y = 190, z = 7 }, to = { x = 137, y = 195, z = 7 } },
        monstruos = { "1 Ventinho", "1 Dragon" }
     }
 }
 
 local noPvpDelay = 5
 local monsterRewardId = 0
 local function executeInvasion(config)
    doBroadcastMessage(config.nombre .. " inicio.")
    for index, info in pairs(config.monstruos) do
       local nombreMonstruo = info:match("%s(.+)")
       local monstruoCantidad = tonumber(info:match("(%d+)"))
       local x, y, z = math.random(config.posiciones.from.x, config.posiciones.to.x), math.random(config.posiciones.from.y, config.posiciones.to.y), math.random(config.posiciones.from.z, config.posiciones.to.z)
       local pos = {x = x, y = y, z = z}
       local summon = doSummonCreature(nombreMonstruo, pos)
       if monsterRewardId == 0 and (math.random(100) >= 50 or index == #config.monstruos) then
          monsterRewardId = summon
       end
    end
 end
 function onThink(interval, lastExecution)
    local invasion = configInv[tostring(os.date("%X")):sub(1, 5)]
    if invasion then
       setWorldType(WORLD_TYPE_NO_PVP)
       doBroadcastMessage(invasion.nombre)
       addEvent(executeInvasion, 1000 * 10 * 1, invasion)
       addEvent(setWorldType, 1000 * 60 * noPvpDelay, WORLD_TYPE_PVP)
    end
    return true
 end

 



Vlw Maninnn, está funcionando agora, porem ele só está summonando um mob independe da quantidade que eu ponha

  • 2 weeks later...
Postado

de uns tempos pra cá minha vida ta mais corrida que o normal, peço perdão por não ter dado um parecer

 

local configInv = {
   ["20:29"] = {
       nombre = "TEST",
       posiciones = { from = { x = 130, y = 190, z = 7 }, to = { x = 137, y = 195, z = 7 } },
       monstruos = {
           ["Ventinho"] = 1,
           ["Dragon"] = 1,
       }
    }
}

local noPvpDelay = 5
local function executeInvasion(config)
   doBroadcastMessage(config.nombre .. " inicio.")
   for index, info in pairs(config.monstruos) do
      local monsterName = index
      local quantity = info
      local x, y, z = math.random(config.posiciones.from.x, config.posiciones.to.x), math.random(config.posiciones.from.y, config.posiciones.to.y), math.random(config.posiciones.from.z, config.posiciones.to.z)
      local pos = {x = x, y = y, z = z}
      for i = 0, quantity do
       doSummonCreature(monsterName, pos)
      end
   end
end
function onThink(interval, lastExecution)
   local invasion = configInv[tostring(os.date("%X")):sub(1, 5)]
   if invasion then
      setWorldType(WORLD_TYPE_NO_PVP)
      doBroadcastMessage(invasion.nombre)
      addEvent(executeInvasion, 1000 * 10 * 1, invasion)
      addEvent(setWorldType, 1000 * 60 * noPvpDelay, WORLD_TYPE_PVP)
   end
   return true
end

 

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo