Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


4 participantes

    LM² - Level Equip

    LeonM²
    LeonM²
    Lenda
    Lenda


    Mensagens : 1802
    Créditos : 153

    LM² - Level Equip Empty LM² - Level Equip

    Mensagem por LeonM² Seg Ago 28, 2017 11:14 pm

    LM² - Level Equip:
    A pedido de quimera555, criei um sistema em que é necessario um nível mínimo para equipar armas e armaduras.
    Screen:
    Screen:
    Tutorial Básico:
    Tutorial Cliente:
    Primeiramente insiram um novo script com o código do link abaixo.
    Agora vem a parte complexa.
    Procure pela linha (ctrl+shift+f):

    Código:
    return unless @actor.equippable?($mouse.object)

    Abaixo dela coloque:

    Código:
        weapon_level = LMM_LevelEquip::WEAPON_LEVEL[$mouse.object.id]
        armor_level = LMM_LevelEquip::ARMOR_LEVEL[$mouse.object.id]
        if (weapon_level != nil and weapon_level > $game_party.actors[0].level) or (armor_level != nil and armor_level > $game_party.actors[0].level )
          $windows[:chat].write(LMM_LevelEquip::LVL_ERROR, 5)
          return
        end

    Procure por:

    Código:
          @help_sprite.bitmap.draw_text(136, 90, 25, 18, $data_weapons[object.id].mdef.to_s, 2)

    Abaixo adicione:

    Código:
          @help_sprite.bitmap.draw_text(15, 108, 60, 18, LMM_LevelEquip::TEXT_LEVEL) if LMM_LevelEquip::WEAPON_LEVEL[object.id] != nil
          @help_sprite.bitmap.draw_text(136, 108, 25, 18, LMM_LevelEquip::WEAPON_LEVEL[object.id].to_s, 2) if LMM_LevelEquip::WEAPON_LEVEL[object.id] != nil

    Procure por:

    Código:
    @help_sprite.bitmap.draw_text(136, 72, 25, 18, $data_armors[object.id].mdef.to_s, 2)

    Abaixo adicione:

    Código:
          @help_sprite.bitmap.draw_text(15, 90, 60, 18, LMM_LevelEquip::TEXT_LEVEL) if LMM_LevelEquip::ARMOR_LEVEL[object.id] != nil
          @help_sprite.bitmap.draw_text(136, 90, 25, 18, LMM_LevelEquip::ARMOR_LEVEL[object.id].to_s, 2) if LMM_LevelEquip::ARMOR_LEVEL[object.id] != nil

    Agora esta pronto para uso, no script que foi inserido é onde se configura o nível requerido para cada equipamento, bem como a mensagem para quando o equipamento esta abaixo do nível, e também o texto que vai na janela de ajuda.
    Como configurar o nível requerido é explicado no próprio script.
    Tutorial Servidor (Créditos Valentine):

    Valentine escreveu:Só não esqueça de configurar o servidor.

    1) No arquivo Settings.txt, adicione:
    Código:
    WEAPONLEVEL = { [1] = 20, [5] = 40 }
    ARMORLEVEL = { [1] = 20, [5] = 40 }
    1 e 5 são exemplos de ID de armas/protetores no database do cliente, enquanto 20 e 40 são exemplos de nível necessário para equipar essas armas/protetores.
    Note que eu não usei underline, pois, diferentemente da linguagem Ruby, Lua não usa underline para separar nomes compostos.

    2) No arquivo handedata.lua, procure por:
    Código:
    if equiptype == EQUIPSHIELD and find(TWOHANDEDWEAPONS, player.equips[EQUIPWEAPON]) then return end
    Pule uma linha e coloque o seguinte código:
    Código:
    if equiptype == EQUIPWEAPON and WEAPONLEVEL[id] ~= nil and WEAPONLEVEL[id] > player.level then return end
    if equiptype ~= EQUIPWEAPON and ARMORLEVEL[id] ~= nil and ARMORLEVEL[id] > player.level then return end

    Agora o jogo está protegido contra eventuais ataques de hackers que tentem burlar o requisito de nível desencripitando o cliente.

    Links:
    Código
    Creditos:
    A mim por criar, ao Valentine pela configuração do Servidor

    Qualquer erro deverá ser reportado. Qualquer duvida leiam minha assinatura.


    Última edição por LeonMM em Sáb Set 02, 2017 12:33 pm, editado 5 vez(es)
    GallighanMaker
    GallighanMaker
    Colaborador
    Colaborador


    Medalhas : LM² - Level Equip ZgLkiRU
    Mensagens : 985
    Créditos : 102

    Ficha do personagem
    Nível: 1
    Experiência:
    LM² - Level Equip Left_bar_bleue0/0LM² - Level Equip Empty_bar_bleue  (0/0)
    Vida:
    LM² - Level Equip Left_bar_bleue30/30LM² - Level Equip Empty_bar_bleue  (30/30)

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por GallighanMaker Ter Ago 29, 2017 1:58 am

    Muito bom Leon, seus scripts ajudam demais!, é bom ver vc de volta e ajudando a galera com esse tipo de coisa. 


    Espero ver mais sistemas, nice job!.


    _________________
    LM² - Level Equip 8dVK0ku
    using C# and import Python developer || Expert in Unity Engine IDE. || LM² - Level Equip 769_heart 2D pixel games.
    Manticora
    Manticora
    Membro Ativo
    Membro Ativo


    Mensagens : 261
    Créditos : 62

    Ficha do personagem
    Nível: 1
    Experiência:
    LM² - Level Equip Left_bar_bleue0/0LM² - Level Equip Empty_bar_bleue  (0/0)
    Vida:
    LM² - Level Equip Left_bar_bleue30/30LM² - Level Equip Empty_bar_bleue  (30/30)

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por Manticora Ter Ago 29, 2017 9:56 am

    Sistema muito bom e necessário para criar um MMORPG !

    +Créditos






    _________________
    LM² - Level Equip Sem_tz10
    Valentine
    Valentine
    Administrador
    Administrador


    Medalhas : LM² - Level Equip ZgLkiRU
    Mensagens : 5335
    Créditos : 1163

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por Valentine Ter Ago 29, 2017 11:46 am

    Só não esqueça de configurar o servidor.

    1) No arquivo Settings.txt, adicione:
    Código:
    WEAPONLEVEL = { [1] = 20, [5] = 40 }
    ARMORLEVEL = { [1] = 20, [5] = 40 }
    1 e 5 são exemplos de ID de armas/protetores no database do cliente, enquanto 20 e 40 são exemplos de nível necessário para equipar essas armas/protetores.
    Note que eu não usei underline, pois, diferentemente da linguagem Ruby, Lua não usa underline para separar nomes compostos.

    2) No arquivo handedata.lua, procure por:
    Código:
    if equiptype == EQUIPSHIELD and find(TWOHANDEDWEAPONS, player.equips[EQUIPWEAPON]) then return end
    Pule uma linha e coloque o seguinte código:
    Código:
    if equiptype == EQUIPWEAPON and WEAPONLEVEL[id] ~= nil and WEAPONLEVEL[id] > player.level then return end
    if equiptype ~= EQUIPWEAPON and ARMORLEVEL[id] ~= nil and ARMORLEVEL[id] > player.level then return end

    Agora o jogo está protegido contra eventuais ataques de hackers que tentem burlar o requisito de nível desencripitando o cliente.
    LeonM²
    LeonM²
    Lenda
    Lenda


    Mensagens : 1802
    Créditos : 153

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por LeonM² Ter Ago 29, 2017 12:17 pm

    Valentine escreveu:Só não esqueça de configurar o servidor.

    1) No arquivo Settings.txt, adicione:
    Código:
    WEAPONLEVEL = { [1] = 20, [5] = 40 }
    ARMORLEVEL = { [1] = 20, [5] = 40 }
    1 e 5 são exemplos de ID de armas/protetores no database do cliente, enquanto 20 e 40 são exemplos de nível necessário para equipar essas armas/protetores.
    Note que eu não usei underline, pois, diferentemente da linguagem Ruby, Lua não usa underline para separar nomes compostos.

    2) No arquivo handedata.lua, procure por:
    Código:
    if equiptype == EQUIPSHIELD and find(TWOHANDEDWEAPONS, player.equips[EQUIPWEAPON]) then return end
    Pule uma linha e coloque o seguinte código:
    Código:
    if equiptype == EQUIPWEAPON and WEAPONLEVEL[id] ~= nil and WEAPONLEVEL[id] > player.level then return end
    if equiptype ~= EQUIPWEAPON and ARMORLEVEL[id] ~= nil and ARMORLEVEL[id] > player.level then return end

    Agora o jogo está protegido contra eventuais ataques de hackers que tentem burlar o requisito de nível desencripitando o cliente.

    Obrigado Valentine, essa parte do servidor ainda estou estudando então nem sabia como fazer.
    Tópico foi atualizado com a parte do servidor pelo Valentine.
    Manticora
    Manticora
    Membro Ativo
    Membro Ativo


    Mensagens : 261
    Créditos : 62

    Ficha do personagem
    Nível: 1
    Experiência:
    LM² - Level Equip Left_bar_bleue0/0LM² - Level Equip Empty_bar_bleue  (0/0)
    Vida:
    LM² - Level Equip Left_bar_bleue30/30LM² - Level Equip Empty_bar_bleue  (30/30)

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por Manticora Ter Ago 29, 2017 1:19 pm

    Em que linha no "Settings" eu posso add o code ?

    Código:
    WEAPONLEVEL = { [1] = 20, [5] = 40 }
    ARMORLEVEL = { [1] = 20, [5] = 40 }


    _________________
    LM² - Level Equip Sem_tz10
    LeonM²
    LeonM²
    Lenda
    Lenda


    Mensagens : 1802
    Créditos : 153

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por LeonM² Ter Ago 29, 2017 1:23 pm

    Pode ser na ultima mesmo, não há uma posição especifica para isso.
    Manticora
    Manticora
    Membro Ativo
    Membro Ativo


    Mensagens : 261
    Créditos : 62

    Ficha do personagem
    Nível: 1
    Experiência:
    LM² - Level Equip Left_bar_bleue0/0LM² - Level Equip Empty_bar_bleue  (0/0)
    Vida:
    LM² - Level Equip Left_bar_bleue30/30LM² - Level Equip Empty_bar_bleue  (30/30)

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por Manticora Qua Ago 30, 2017 8:01 am

    tenho uma duvida ! como add mais armas no script ?

      WEAPON_LEVEL = []
      WEAPON_LEVEL[2] = 5
      ARMOR_LEVEL = []
      ARMOR_LEVEL[2] = 5

    E como atualizar as novas armas no servidor


    Código:
    WEAPONLEVEL = { [1] = 20, [5] = 40 }
    ARMORLEVEL = { [1] = 20, [5] = 40 }


    _________________
    LM² - Level Equip Sem_tz10
    Valentine
    Valentine
    Administrador
    Administrador


    Medalhas : LM² - Level Equip ZgLkiRU
    Mensagens : 5335
    Créditos : 1163

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por Valentine Qua Ago 30, 2017 8:13 am

    @quimera555
    Após configurar o cliente, você pode configurar o servidor assim:
    Código:
    WEAPONLEVEL = {
      [1] = 20,
      [2] = 30,
      [3] = 40,
      [4] = 50,
      [5] = 60
    }
    Assim:
    Código:
    WEAPONLEVEL = { [1] = 20, [2] = 30, [3] = 40, [4] = 50, [5] = 60 }
    Ou assim:
    Código:
    WEAPONLEVEL = {}
    WEAPONLEVEL[1] = 20
    WEAPONLEVEL[2] = 30
    WEAPONLEVEL[3] = 40
    WEAPONLEVEL[4] = 50
    WEAPONLEVEL[5] = 60
    [ID] = ID da arma no database

    No cliente, use chaves. No servidor, use colchetes.


    Última edição por Valentine em Qua Ago 30, 2017 9:43 am, editado 2 vez(es)
    LeonM²
    LeonM²
    Lenda
    Lenda


    Mensagens : 1802
    Créditos : 153

    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por LeonM² Qua Ago 30, 2017 9:38 am

    quimera555 escreveu:tenho uma duvida ! como add mais armas no script ?

      WEAPON_LEVEL = []
      WEAPON_LEVEL[2] = 5
      ARMOR_LEVEL = []
      ARMOR_LEVEL[2] = 5
    Como dito no script basta usar os modelos:
    # WEAPON_LEVEL[id no database] = nível requerido
    # ARMOR_LEVEL[id no database] = nível requerido
    basta colocar abaixo dos respectivos:
    Código:
    WEAPON_LEVEL = []
    WEAPON_LEVEL[2] = 5
    WEAPON_LEVEL[3] = 15
    no exemplo a arma de id 3 no database recebeu nível minimo de 15.
    no Servidor tu tem que seguir o modelo que o Val botou, e ele tem que possuir as mesmas configurações que o cliente.

    Conteúdo patrocinado


    LM² - Level Equip Empty Re: LM² - Level Equip

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Ter Mar 19, 2024 1:00 am