• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Pedido] sistema arena

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[Pedido] sistema arena Empty [Pedido] sistema arena Jue Dic 31, 2020 12:39 pm

    akane

    akane
    Miembro
    Miembro
    Descripcion escribió:hola a todos, aprovechando de desearles feliz año nuevo a todos, estoy buscando un sistema de boss arena, que se cree un tp en cierta zona, salga un mensaje y aparezca un boss x algo parecido como en el siguiente script pero para otx, ya que este lo probé y no me funcionó. Si pudiesen ayudarme les agradecería ya que he buscado y buscado y no encontré ninguno tan completo como este que me funcionara :c

    Script

    ----------------------------------- EVENTO SUMMON BOSS FEITO POR YAN18 ----------------------------------------- local minutos = 20 ---- COLOCA OS MINUTOS AQUI PARA OS BOSS SUMIREM CASO NINGUÉM OS MATE ---- NOME DOS MONTROS ---- local monsters = { [1] = "Magmar" , [2] = "Electabuzz", [3] = "Scizor", } ---- POSIÇÃO DA ARENA ONDE APARECERÁ OS MONSTROS ---- local position_arena = { from_pos = {x= 964, y = 993, z= 7}, -- VARIÁVEL QUE TEM A COORDENADA INICIAL DO LUGAR ONDE VAI APARECER OS MONSTROS to_pos = {x= 978, y = 1009, z= 7}, -- VARIÁVEL QUE TEM A COORDENADA FINAL DO LUGAR ONDE VAI APARECER OS MONSTROS } ---------------------------------- CÓDIGO ---------------------------------------------- function onThink(cid, words, interval, lastExecution) ----- CRIA OS BOSS ----- for i, j in ipairs(monsters) do ----- VARIÁVEL RANDOM_POSITION GERA O SPAWN ALEATÓRIO DOS BOSS ----- local random_position = {x= math.random(position_arena.from_pos.x, position_arena.to_pos.x), y= math.random(position_arena.from_pos.y, position_arena.to_pos.y), z= math.random(position_arena.from_pos.z, position_arena.to_pos.z)} doSummonCreature(j, random_position) end doBroadcastMessage(#monsters == 1 and "A monster have been arrived in this world. Don't arrive near!" or "Some monsters have been arrived in this world. Don't arrive near by them!", 22) ---- VERIFICAÇÃO SE TEM MONSTROS NA ARENA PARA REMOVER ---- addEvent(function() local position = {} for i = position_arena.from_pos.x, position_arena.to_pos.x do for j = position_arena.from_pos.y, position_arena.to_pos.y do position[#position+1] = {x= i, y = j, z= position_arena.from_pos.z, stackpos = 0} end end for i= 1, #position do for j = 0, 255 do position[i].stackpos = j local monster = getTileThingByPos(position[i]) if isMonster(monster.uid) then for d, n in ipairs(monsters) do if getCreatureName(monster.uid) == n then doRemoveCreature(monster.uid) if d == #monsters then doBroadcastMessage(#monsters == 1 and "The monster left this world. But it will return soon...." or "The monsters left this world. But they will return soon....", 22) end end end end end end end, minutos * 60 * 1000) return true end:


    PD: si alguien quiere ocuparlo puede hacerlo sin problemas, solo despues agreguen en el globalevents.xml lo siguiente

    <globalevent name="boss" interval="3600" event="script" value="boss.lua"/>
    Imagen Explicativa escribió:Imagen Explicativa: [Pedido] sistema arena Tibiaf10
    Version del Scripts: OTx Old Version(0.3.7)

    2 participantes

    2[Pedido] sistema arena Empty Re: [Pedido] sistema arena Jue Dic 31, 2020 3:45 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Publica el code ordenado asi no se entiende nada baja las tag code



    [Pedido] sistema arena YNU5B25
    2 participantes
    http://www.tibiaface.com

    3[Pedido] sistema arena Empty Re: [Pedido] sistema arena Jue Dic 31, 2020 7:33 pm

    akane

    akane
    Miembro
    Miembro
    Código:
    ----------------------------------- EVENTO SUMMON BOSS FEITO POR YAN18 -----------------------------------------
    local minutos = 20 ---- COLOCA OS MINUTOS AQUI PARA OS BOSS SUMIREM CASO NINGUÉM OS MATE

    ---- NOME DOS MONTROS ----
    local monsters = {
    [1] = "Magmar" ,
    [2] = "Electabuzz",
    [3] = "Scizor",
    }

    ---- POSIÇÃO DA ARENA ONDE APARECERÁ OS MONSTROS ----
    local position_arena = {
    from_pos = {x= 964, y = 993, z= 7}, -- VARIÁVEL QUE TEM A COORDENADA INICIAL DO LUGAR ONDE VAI APARECER OS MONSTROS
    to_pos = {x= 978, y = 1009, z= 7}, -- VARIÁVEL QUE TEM A COORDENADA FINAL DO LUGAR ONDE VAI APARECER OS MONSTROS
    }

    ---------------------------------- CÓDIGO ----------------------------------------------
    function onThink(cid, words, interval, lastExecution)

    ----- CRIA OS BOSS -----
     for i, j in ipairs(monsters) do
     ----- VARIÁVEL RANDOM_POSITION GERA O SPAWN ALEATÓRIO DOS BOSS -----
     local random_position = {x= math.random(position_arena.from_pos.x, position_arena.to_pos.x), y= math.random(position_arena.from_pos.y, position_arena.to_pos.y), z= math.random(position_arena.from_pos.z, position_arena.to_pos.z)}
     doSummonCreature(j, random_position)
     end

     doBroadcastMessage(#monsters == 1 and "A monster have been arrived in this world. Don't arrive near!" or "Some monsters have been arrived in this world. Don't arrive near by them!", 22)

    ---- VERIFICAÇÃO SE TEM MONSTROS NA ARENA PARA REMOVER ----

    addEvent(function()
    local position = {}
      
     for i = position_arena.from_pos.x, position_arena.to_pos.x do
     for j = position_arena.from_pos.y, position_arena.to_pos.y do
     position[#position+1] = {x= i, y = j, z= position_arena.from_pos.z, stackpos = 0}  
     end
     end

     for i= 1, #position do
     for j = 0, 255 do
     position[i].stackpos = j
     local monster = getTileThingByPos(position[i])
     

     if isMonster(monster.uid) then  
     for d, n in ipairs(monsters) do
     if getCreatureName(monster.uid) == n then
     doRemoveCreature(monster.uid)
     
     if d == #monsters then
     doBroadcastMessage(#monsters == 1 and "The monster left this world. But it will return soon...." or "The monsters left this world. But they will return soon....", 22)
     end
     
     end
     end
     end
     end
     
     
     end
    end, minutos * 60 * 1000)
     
    return true
    end



    .

    2 participantes

    Contenido patrocinado


    2 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).