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

[RMVX] Limite de Level

2 participantes

Ir para baixo

[RMVX] Limite de Level Empty [RMVX] Limite de Level

Mensagem por MusphelheinPvH Seg Dez 26, 2011 12:14 pm

Olá! Vou direto ao assunto. Gostaria de saber como faz para limitar o level dos personagens no RPG Maker VX, tipo o limite de level padrão do RMVX é até o level 99, queria deixar até o level 10 apenas.
MusphelheinPvH
MusphelheinPvH

Mensagens : 17
Data de inscrição : 19/12/2011

Ir para o topo Ir para baixo

[RMVX] Limite de Level Empty Re: [RMVX] Limite de Level

Mensagem por Basch Seg Dez 26, 2011 12:45 pm

Código:
#==============================================================================
# � [RMVX Script] +MAX Level Limitation System+ Version 1.1
#------------------------------------------------------------------------------
# by Woratana [woratana@hotmail.com]
# Release Date: 30/01/2008
#
# Features in Version 1.1
# - Use alias to make the script shorter. Thanks Modern Algebra for suggestion.
# Features in Version 1.0
# - Set Default Max Level for Actor that doesn't need Specific Max Level
# - Allow to Set Specific Max Level for Specific Character
#
# How to Set Max Level
# - For all the Actors that don't need specific max level,
# set their Max Level in DEFAULT_LV_MAX = ...
# For example, DEFAULT_LV_MAX = 20
# This will make all the characters that you didn't set their specific max level
# have their max level at 20.
#
# - For the Actors that need specific max level,
# set their Max Level by:
# CHAR[actor's id from database] = ...
# For example, CHAR[7] = 10
# This will make character no.7 in database has max level at 10.
#==============================================================================

module Wormaxlv
  CHAR = Array.new
#------------------------------------
# SETUP MAX Level HERE
#------------------------------------
  DEFAULT_LV_MAX = 10 # Set Default Max Level
  CHAR[1] = 10 # This make Character No.1 has max level at 5
end

class Scene_Battle < Scene_Base
 
  def display_level_up
    exp = $game_troop.exp_total
    for actor in $game_party.existing_members
      last_level = actor.level
      last_skills = actor.skills
      actor.gain_exp(exp, true)
    end
    wait_for_message
  end

end

class Game_Actor < Game_Battler
  attr_accessor :max_lv

alias wor_actor_setup setup
def setup(actor_id)
    wor_actor_setup(actor_id)
    if Wormaxlv::CHAR[actor_id] == nil
    @max_lv = Wormaxlv::DEFAULT_LV_MAX
    else
    @max_lv = Wormaxlv::CHAR[actor_id]
    end
  end
   
  def change_exp(exp, show)
    last_level = @level
    last_skills = skills
    @exp = [[exp, 9999999].min, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0 and @level <= (@max_lv - 1)
      level_up
    end
    while @exp < @exp_list[@level]
      level_down
    end
    @hp = [@hp, maxhp].min
    @mp = [@mp, maxmp].min
    if show and @level > last_level
      display_level_up(skills - last_skills)
    end
  end
end

Use este Script, e onde diz "DEFAULT_LV_MAX" (+ ou - na linha 32), coloque o número de Level máximo desejado (já coloquei 10 pra vc). Se vc quiser que cada personagem tenha um nível máximo, coloque "CHAR[ID do char] = Level Desejado" (Como vc pode ver no Script, eu coloquei o Actor 1 com Nível máximo igual a 10).

Se tiver alguma dúvida, pergunte!
Basch
Basch

Mensagens : 51
Data de inscrição : 15/07/2010
Idade : 29
Localização : Lua do Rio de Janeiro

Ir para o topo Ir para baixo

[RMVX] Limite de Level Empty Re: [RMVX] Limite de Level

Mensagem por MusphelheinPvH Seg Dez 26, 2011 1:02 pm

Obrigado Bash! Você foi de grande ajuda, deixou tudo mastigado. Valeu mesmo!
MusphelheinPvH
MusphelheinPvH

Mensagens : 17
Data de inscrição : 19/12/2011

Ir para o topo Ir para baixo

[RMVX] Limite de Level Empty Re: [RMVX] Limite de Level

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos