O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Redyugi's Level Up Effects - Recuperar HP/MP ao subir de nível

Iniciado por LoboShow, 06/12/2012 às 21:04

Redyugi's Level Up Effects

Compativel com: RMVX
Compatibilidade : ?
Facilidade de uso: ?
Lag gerado: ?

[box class=titlebg]
Para que serve o script
[/box]
Recupera HP-MP após subir de level.

[box class=titlebg]
Script
[/box]
####################################
### -Redyugi's Level Up Effects- ###
###      -Version 1.6-
###     for: ~Redyugi~           ###
####################################
class Game_Actor < Game_Battler
  #########
  # Set up
  #########
  #
  # Health
  RECOVER_ALL_HP = false # Recover all  HP when level up?
  RECOVER_HP = true # Recovers certain amount of HP
      # If above is true
  HP_SET = false # True = Set amount of HP, False = percentage of HP
  HP_RECOVER = 97 # Amount recovered by above
  #
  # MP
  RECOVER_ALL_MP = false # Recover all MP when level up?
  RECOVER_MP = true # Recovers certain amount of MP
      # If above is true
  MP_SET = false # True = Set amount of MP, False = percentage of MP
  MP_RECOVER = 93 # Amount recovered by above
  #
  # States
  REMOVE_STATES = false # Remove certain states when level up?
  STATES_TO_REMOVE = [1, 2, 3, 4, 5, 6]  # States to remove if above is true
  REMOVE_ALL_STATES = false  # Remove all states
  #
  # Items
  GAIN_ITEMS = true  # Gain items when level up?
  RANDOM_ON = true # Want to give random set of items when level up
  RANDOM = 100
  ITEMS_GAINED_1 = [1, 3] # Gives player items using Item ID
  ITEMS_NUM = 1 #Number of items you are giving the player - 1
  RANDOM_CHANCE_1 = 30
  ITEMS_GAINED_2 = [2, 4] #IF RANDOM
  RANDOM_CHANCE_2 = 60
  ITEMS_2_NUM = 1 #Number of items you are giving the player - 1, for use with Random
  ITEMS_GAINED_3 = [5, 6] #IF RANDOM
  RANDOM_CHANCE_3 = 90
  ITEMS_3_NUM = 1 #Number of items you are giving the player - 1, for use with Random
  #
  # Switches
  SWITCH_ON = false # Turn a switch on when level up?
  SWITCH_NUMBER = 1 # Switch number
  #
  # Variable
  VARIABLE_ON = false
  VARIABLE_NUM = 1
  VARIABLE_ADDITION = 5
  #
  # Common Events
  COMMON_EVENT = false #Play a common event when level up?
  EVENT_NUMBER = 3  # Which common event
  #########
  # End Set Up
  #########

  alias redyugi_level_up level_up
  def level_up
    redyugi_level_up
    @hp = maxhp if RECOVER_ALL_HP
    if RECOVER_HP
      if HP_SET == true
        @hp += HP_RECOVER
      else
        recover = maxhp * (HP_RECOVER / 100.00)
        recover.to_s
        @hp += recover.to_i
      end
    end
    @mp = maxmp if RECOVER_ALL_MP
    if RECOVER_MP
      if MP_SET
        @mp += MP_RECOVER
      else
        recover = maxmp * (MP_RECOVER / 100.00)
        recover.to_s
        @mp += recover.to_i
      end
    end
    if REMOVE_STATES
      @states -= STATES_TO_REMOVE
    end
    if REMOVE_ALL_STATES
      @states.clone.each { |i| remove_state(i) }
    end
    if GAIN_ITEMS
      if RANDOM_ON == true
        r = rand(RANDOM)
        if r <= RANDOM_CHANCE_1
          for m in 0..ITEMS_NUM
            z = ITEMS_GAINED_1[m]
            $game_party.gain_item($data_items[z], 1)
          end
        elsif r > RANDOM_CHANCE_1 and r <= RANDOM_CHANCE_2
          for m in 0..ITEMS_2_NUM
            z = ITEMS_GAINED_2[m]
            $game_party.gain_item($data_items[z], 1)
          end
        elsif r > RANDOM_CHANCE_2 and r <= RANDOM_CHANCE_3
          for m in 0..ITEMS_3_NUM
            z = ITEMS_GAINED_3[m]
            $game_party.gain_item($data_items[z], 1)
          end
        else
          w = 1+1
        end
      else
        for x in 0..ITEMS_NUM
          y = ITEMS_GAINED_1[x]
          $game_party.gain_item($data_items[y], 1)
        end
      end
    end
    if SWITCH_ON
      $game_switches[SWITCH_NUMBER] = true
    end
    if VARIABLE_ON
      $game_variables[VARIABLE_NUM] += VARIABLE_ADDITION
    end
    if COMMON_EVENT
      $game_temp.common_event_id = EVENT_NUMBER
    end
  end
end


[box class=titlebg]
Créditos e Avisos
[/box]
Criador :  ~Redyugi~