Main Menu
  • Welcome to The RPG Maker Resource Kit.

Help with a lvl and stat breaker

Started by IAMFORTE, September 10, 2009, 10:35:47 PM

0 Members and 1 Guest are viewing this topic.

IAMFORTE

hi, the script below has been of great aid to me in breaking levels and stats all at once... however this same script puzzles me alot.
here is what i would like to know how to do... if possible.
When i use the script, i set the maximum values etc then when i go in game i see the charecters stats way to high for a lvl 1 they are also exactly the same.

is it possible to use this script and control a characters stats like it is done in the editor, or is there any way in general to generate a parameters curve that the script would follow, for each charecter?

assistance would be greatly appreciated
[spoiler]
#==============================================================================
#  Unlimit Levels v1                                            by: cybersam
#                                                               date: 14.09.06
#------------------------------------------------------------------------------
#  here is a full working scripts for you to this... (i think there is
#  already one like this somewhere in the in the community...
#  i did one back then when i started in RPG Maker XP
#  some other guys did a few other script like this
#==============================================================================
# Must go ABOVE leveling with points to work
#----------------------------------------------------------------------------
# here you can set the max hp,sp,,str,dex,agi and int
#----------------------------------------------------------------------------
 $FINAL_LVL  = 200
 $MAX_HP     = 100000
 $MAX_SP     = 100000
 $MAX_STR    = 2500
 $MAX_DEX    = 2500
 $MAX_AGI    = 2500
 $MAX_INT    = 2500

class Game_Actor

 #--------------------------------------------------------------------------
 # setting the levels...
 #--------------------------------------------------------------------------
 def final_level
   
   # here you can set the max level for your characters based on their ID's...
   # i set it so that 3 characters have different levels and the rest
   # have max lvl of 9999
   #
   # this settings is only to show you how to change the max setting for your
   # characters... same thing is for the parameters -> hp,sp,str,dex.agi,int
   
   case self.id
   when 1
     level = 255
   when 2
     level = 999
   when 8
     level = 15600
   else
     level = $MAX_STR
   end
   return level
 end
 
 
 #--------------------------------------------------------------------------
 # setting max hp...
 #--------------------------------------------------------------------------
 def max_hp

   case self.id
   when 1
     hp = 999
   when 2
     hp = 9999
   when 8
     hp = 6540
   else
     hp = $MAX_HP
   end
   return hp
 end
 #--------------------------------------------------------------------------
 # setting max sp...
 #--------------------------------------------------------------------------
 def max_sp

   case self.id
   when 1
     sp = 999
   when 2
     sp = 9999
   when 8
     sp = 6540
   else
     sp = $MAX_SP
   end
   return sp
 end
 #--------------------------------------------------------------------------
 # setting max str...
 #--------------------------------------------------------------------------
 def max_str
   case self.id
   when 1
     str = 999
   when 2
     str = 2560
   when 8
     str = 1800
   else
     str = $MAX_STR
   end
   return str
 end
 #--------------------------------------------------------------------------
 # setting max dex...
 #--------------------------------------------------------------------------
 def max_dex
   case self.id
   when 1
     dex = 999
   when 2
     dex = 2560
   when 8
     dex = 1800
   else
     dex = $MAX_DEX
   end
   return dex
 end  
 #--------------------------------------------------------------------------
 # setting max agi...
 #--------------------------------------------------------------------------
 def max_agi
   case self.id
   when 1
     agi = 999
   when 2
     agi = 2560
   when 8
     agi = 1800
   else
     agi = $MAX_AGI
   end
   return agi
 end    
 #--------------------------------------------------------------------------
 # setting max int...
 #--------------------------------------------------------------------------
 def max_int
   case self.id
   when 1
     int = 999
   when 2
     int = 2560
   when 8
     int = 1800
   else
     int = $MAX_INT
   end
   return int
 end  
 
 #--------------------------------------------------------------------------
 # Creating the new EXP list
 # dont change anything from here on... (only if you know what you're doing)
 #--------------------------------------------------------------------------
 def make_exp_list
   actor = $data_actors[@actor_id]
   @exp_list = Array.new(final_level + 2)
   @exp_list[1] = 0
   pow_i = 2.4 + actor.exp_inflation / 1000.0
   for i in 2..final_level + 1
     if i > final_level
       @exp_list = 0
     else
       n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
       @exp_list = @exp_list[i-1] + Integer(n)
     end
   end
 end

 #--------------------------------------------------------------------------
 # setting parameters like hp, sp, str, dex, agi and int
 #--------------------------------------------------------------------------
 def maxhp
   n = [[base_maxhp + @maxhp_plus, 1].max, $MAX_HP].min
   for i in @states
     n *= $data_states.maxhp_rate / 100.0
   end
   n = [[Integer(n), 1].max, $MAX_HP].min
   return n
 end
 
 def base_maxhp
   maxhp = $data_actors[@actor_id].parameters[0, 1]
   maxhp += $data_actors[@actor_id].parameters[0, 2] * @level
   return maxhp
 end

 def base_maxsp
   maxsp = $data_actors[@actor_id].parameters[1, 1]
   maxsp += $data_actors[@actor_id].parameters[1, 2] * @level
   return maxsp
 end

 def base_str
   n = $data_actors[@actor_id].parameters[2, 1]
   n += $data_actors[@actor_id].parameters[2, 2] * @level
   weapon = $data_weapons[@weapon_id]
   armor1 = $data_armors[@armor1_id]
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.str_plus : 0
   n += armor1 != nil ? armor1.str_plus : 0
   n += armor2 != nil ? armor2.str_plus : 0
   n += armor3 != nil ? armor3.str_plus : 0
   n += armor4 != nil ? armor4.str_plus : 0
   return [[n, 1].max, $MAX_STR].min
 end

 def base_dex
   n = $data_actors[@actor_id].parameters[3, 1]
   n += $data_actors[@actor_id].parameters[3, 2] * @level
   weapon = $data_weapons[@weapon_id]
   armor1 = $data_armors[@armor1_id]
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.dex_plus : 0
   n += armor1 != nil ? armor1.dex_plus : 0
   n += armor2 != nil ? armor2.dex_plus : 0
   n += armor3 != nil ? armor3.dex_plus : 0
   n += armor4 != nil ? armor4.dex_plus : 0
   return [[n, 1].max, $MAX_DEX].min
 end

 def base_agi
   n = $data_actors[@actor_id].parameters[4, 1]
   n += $data_actors[@actor_id].parameters[4, 2] * @level
   weapon = $data_weapons[@weapon_id]
   armor1 = $data_armors[@armor1_id]
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.agi_plus : 0
   n += armor1 != nil ? armor1.agi_plus : 0
   n += armor2 != nil ? armor2.agi_plus : 0
   n += armor3 != nil ? armor3.agi_plus : 0
   n += armor4 != nil ? armor4.agi_plus : 0
   return [[n, 1].max, $MAX_AGI].min
 end

 def base_int
   n = $data_actors[@actor_id].parameters[5, 1]
   n += $data_actors[@actor_id].parameters[5, 2] * @level
   weapon = $data_weapons[@weapon_id]
   armor1 = $data_armors[@armor1_id]
   armor2 = $data_armors[@armor2_id]
   armor3 = $data_armors[@armor3_id]
   armor4 = $data_armors[@armor4_id]
   n += weapon != nil ? weapon.int_plus : 0
   n += armor1 != nil ? armor1.int_plus : 0
   n += armor2 != nil ? armor2.int_plus : 0
   n += armor3 != nil ? armor3.int_plus : 0
   n += armor4 != nil ? armor4.int_plus : 0
   return [[n, 1].max, $MAX_INT].min
 end

 def exp=(exp)
   @exp = [exp, 0].max
   while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
     @level += 1
     for j in $data_classes[@class_id].learnings
       if j.level == @level
         learn_skill(j.skill_id)
       end
     end
   end
   while @exp < @exp_list[@level]
     @level -= 1
   end
   @hp = [@hp, self.maxhp].min
   @sp = [@sp, self.maxsp].min
 end

 def level=(level)
   level = [[level, final_level].min, 1].max
   self.exp = @exp_list[level]
 end
end



#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler

 def maxhp
   n = [[base_maxhp + @maxhp_plus, 1].max, $MAX_HP].min
   for i in @states
     n *= $data_states.maxhp_rate / 100.0
   end
   n = [[Integer(n), 1].max, $MAX_HP].min
   return n
 end

 def maxsp
   n = [[base_maxsp + @maxsp_plus, 0].max, $MAX_SP].min
   for i in @states
     n *= $data_states.maxsp_rate / 100.0
   end
   n = [[Integer(n), 0].max, $MAX_SP].min
   return n
 end

 def str
   n = [[base_str + @str_plus, 1].max, $MAX_STR].min
   for i in @states
     n *= $data_states.str_rate / 100.0
   end
   n = [[Integer(n), 1].max, $MAX_STR].min
   return n
 end

 def dex
   n = [[base_dex + @dex_plus, 1].max, $MAX_DEX].min
   for i in @states
     n *= $data_states.dex_rate / 100.0
   end
   n = [[Integer(n), 1].max, $MAX_DEX].min
   return n
 end

 def agi
   n = [[base_agi + @agi_plus, 1].max, $MAX_AGI].min
   for i in @states
     n *= $data_states.agi_rate / 100.0
   end
   n = [[Integer(n), 1].max, $MAX_AGI].min
   return n
 end

 def int
   n = [[base_int + @int_plus, 1].max, $MAX_INT].min
   for i in @states
     n *= $data_states.int_rate / 100.0
   end
   n = [[Integer(n), 1].max, $MAX_INT].min
   return n
 end

 def maxhp=(maxhp)
   @maxhp_plus += maxhp - self.maxhp
   @maxhp_plus = [[@maxhp_plus, -$MAX_HP].max, $MAX_HP].min
   @hp = [@hp, self.maxhp].min
 end

 def maxsp=(maxsp)
   @maxsp_plus += maxsp - self.maxsp
   @maxsp_plus = [[@maxsp_plus, -$MAX_SP].max, $MAX_SP].min
   @sp = [@sp, self.maxsp].min
 end

 def str=(str)
   @str_plus += str - self.str
   @str_plus = [[@str_plus, -$MAX_STR].max, $MAX_STR].min
 end

 def dex=(dex)
   @dex_plus += dex - self.dex
   @dex_plus = [[@dex_plus, -$MAX_DEX].max, $MAX_DEX].min
 end

 def agi=(agi)
   @agi_plus += agi - self.agi
   @agi_plus = [[@agi_plus, -$MAX_AGI].max, $MAX_AGI].min
 end

 def int=(int)
   @int_plus += int - self.int
   @int_plus = [[@int_plus, -$MAX_INT].max, $MAX_INT].min
 end
end
[/spoiler]
i am also confused about the part where you set the levels (refers to the comment )
perhaps those are what i need to change to get it to work as i planned?


albertfish

#1
The part where you set your levels from my understanding simply allows different characters to have different max levels.

For example, using this code
case self.id
   when 1
     level = 255
   when 2
     level = 999
   when 8
     level = 15600
   else
     level = $FINAL_LVL
   end
   return level

would mean that the first actor in the database has a max level of 255, while the second and the third have max levels of 999 and 15600 respectively. All the other actors have a max level of whatever $FINAL_LVL.

Also in the code you have given, I believe this section
[spoiler]#--------------------------------------------------------------------------
 # setting the levels...
 #--------------------------------------------------------------------------
 def final_level
   
   # here you can set the max level for your characters based on their ID's...
   # i set it so that 3 characters have different levels and the rest
   # have max lvl of 9999
   #
   # this settings is only to show you how to change the max setting for your
   # characters... same thing is for the parameters -> hp,sp,str,dex.agi,int
   
   case self.id
   when 1
     level = 255
   when 2
     level = 999
   when 8
     level = 15600
   else
     level = $MAX_STR
   end
   return level
 end
[/spoiler]
should be changed too
[spoiler]#--------------------------------------------------------------------------
 # setting the levels...
 #--------------------------------------------------------------------------
 def final_level
   
   # here you can set the max level for your characters based on their ID's...
   # i set it so that 3 characters have different levels and the rest
   # have max lvl of 9999
   #
   # this settings is only to show you how to change the max setting for your
   # characters... same thing is for the parameters -> hp,sp,str,dex.agi,int
   
   case self.id
   when 1
     level = 255
   when 2
     level = 999
   when 8
     level = 15600
   else
     level = $FINAL_LEVEL
   end
   return level
 end
[/spoiler]
The way that it was written would mean that everyone's maximum level would be whatever you put down for maximum strength, as far as I know.

If you want all the characters to have the same maximum level use this code
#--------------------------------------------------------------------------
# setting the levels...
#--------------------------------------------------------------------------
def final_level    
 return $FINAL_LVL
end


I hope that helps.

Also, you said that all their stats were the same and very high, I will have to try the script and see what happens. Maybe I can fix it.

Edit:
Quote# Must go ABOVE leveling with points to work
Do you have that script as well?

IAMFORTE

no i dont have leveling with points... sorry again albertfish, this is like the 4th or fifth time youve helped me XD

albertfish

Well, I read through the script and found why this was happening, and I was able to quite easily fix the problem. The character's stats should now be correct for the level they are at. They also follow the curve that is set up in the database.

Here is the fixed script:
#==============================================================================
#  Unlimit Levels v1                                            by: cybersam
#                                                               date: 14.09.06
#
# Fixed by: albertfish
# Date:     September 16, 2009
#
# What albertfish fixed:
#     - Removed the use of global variables
#     - Fixed the initial stat and growth problems
#         - Initial stats used to be too high
#         - Stats used to grow too fast
#     - Stats now follow the curve created in the data base
#         - After level 99 the stats increase by the same amount as they did
#           between level 98 and level 99
#------------------------------------------------------------------------------
#  here is a full working scripts for you to this... (i think there is
#  already one like this somewhere in the in the community...
#  i did one back then when i started in RPG Maker XP
#  some other guys did a few other script like this
#==============================================================================
# Must go ABOVE leveling with points to work
#----------------------------------------------------------------------------
# here you can set the max hp,sp,,str,dex,agi and int
#----------------------------------------------------------------------------

module UL_af_config
  FINAL_LVL  = 200
  MAX_HP     = 100000
  MAX_SP     = 100000
  MAX_STR    = 2500
  MAX_DEX    = 2500
  MAX_AGI    = 2500
  MAX_INT    = 2500
end

class Game_Actor
  #include UL_af_config

  #--------------------------------------------------------------------------
  # setting the levels...
  #--------------------------------------------------------------------------
  def final_level
   
    # here you can set the max level for your characters based on their ID's...
    # i set it so that 3 characters have different levels and the rest
    # have max lvl of 9999
    #
    # this settings is only to show you how to change the max setting for your
    # characters... same thing is for the parameters -> hp,sp,str,dex.agi,int
   
    case self.id
    when 1
      level = 255
    when 2
      level = 999
    when 8
      level = 15600
    else
      level = FINAL_LVL
    end
    return level
  end
 
 
  #--------------------------------------------------------------------------
  # setting max hp...
  #--------------------------------------------------------------------------
  def max_hp

    case self.id
    when 1
      hp = 999
    when 2
      hp = 9999
    when 8
      hp = 6540
    else
      hp = MAX_HP
    end
    return hp
  end
  #--------------------------------------------------------------------------
  # setting max sp...
  #--------------------------------------------------------------------------
  def max_sp

    case self.id
    when 1
      sp = 999
    when 2
      sp = 9999
    when 8
      sp = 6540
    else
      sp = MAX_SP
    end
    return sp
  end
  #--------------------------------------------------------------------------
  # setting max str...
  #--------------------------------------------------------------------------
  def max_str
    case self.id
    when 1
      str = 999
    when 2
      str = 2560
    when 8
      str = 1800
    else
      str = MAX_STR
    end
    return str
  end
  #--------------------------------------------------------------------------
  # setting max dex...
  #--------------------------------------------------------------------------
  def max_dex
    case self.id
    when 1
      dex = 999
    when 2
      dex = 2560
    when 8
      dex = 1800
    else
      dex = MAX_DEX
    end
    return dex
  end 
  #--------------------------------------------------------------------------
  # setting max agi...
  #--------------------------------------------------------------------------
  def max_agi
    case self.id
    when 1
      agi = 999
    when 2
      agi = 2560
    when 8
      agi = 1800
    else
      agi = MAX_AGI
    end
    return agi
  end   
  #--------------------------------------------------------------------------
  # setting max int...
  #--------------------------------------------------------------------------
  def max_int
    case self.id
    when 1
      int = 999
    when 2
      int = 2560
    when 8
      int = 1800
    else
      int = MAX_INT
    end
    return int
  end 
 
  #--------------------------------------------------------------------------
  # Creating the new EXP list
  # dont change anything from here on... (only if you know what you're doing)
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list = Array.new(final_level + 2)
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 1000.0
    for i in 2..final_level + 1
      if i > final_level
        @exp_list[i] = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list[i] = @exp_list[i-1] + Integer(n)
      end
    end
  end

  #--------------------------------------------------------------------------
  # setting parameters like hp, sp, str, dex, agi and int
  #--------------------------------------------------------------------------
  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, max_hp].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, max_hp].min
    return n
  end
 
  def base_maxhp
    af = $data_actors[@actor_id].parameters[0, @level] if @level <= 98
    af = $data_actors[@actor_id].parameters[0, 98] unless @level <= 98
    maxhp = af
    maxhp += ($data_actors[@actor_id].parameters[0, 99] - af) * (@level - 98) unless @level <= 98
    return maxhp
  end

  def base_maxsp
    af = $data_actors[@actor_id].parameters[1, @level] if @level <= 98
    af = $data_actors[@actor_id].parameters[1, 98] unless @level <= 98
    maxsp = af
    maxsp += ($data_actors[@actor_id].parameters[1, 99] - af) * (@level - 98) unless @level <= 98
    return maxsp
  end

  def base_str
    af = $data_actors[@actor_id].parameters[2, @level] if @level <= 98
    af = $data_actors[@actor_id].parameters[2, 98] unless @level <= 98
    n = af
    n += ($data_actors[@actor_id].parameters[2, 99] - af) * (@level - 98) unless @level <= 98
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [[n, 1].max, max_str].min
  end

  def base_dex
    af = $data_actors[@actor_id].parameters[3, @level] if @level <= 98
    af = $data_actors[@actor_id].parameters[3, 98] unless @level <= 98
    n = af
    n += ($data_actors[@actor_id].parameters[3, 99] - af) * (@level - 98) unless @level <= 98
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, max_dex].min
  end

  def base_agi
    af = $data_actors[@actor_id].parameters[4, @level] if @level <= 98
    af = $data_actors[@actor_id].parameters[4, 98] unless @level <= 98
    n = af
    n += ($data_actors[@actor_id].parameters[4, 99] - af) * (@level - 98) unless @level <= 98
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [[n, 1].max, max_agi].min
  end

  def base_int
    af = $data_actors[@actor_id].parameters[5, @level] if @level <= 98
    af = $data_actors[@actor_id].parameters[5, 98] unless @level <= 98
    n = af
    n += ($data_actors[@actor_id].parameters[5, 99] - af) * (@level - 98) unless @level <= 98
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [[n, 1].max, max_int].min
  end

  def exp=(exp)
    @exp = [exp, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    while @exp < @exp_list[@level]
      @level -= 1
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end

  def level=(level)
    level = [[level, final_level].min, 1].max
    self.exp = @exp_list[level]
  end
end



#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler
  include UL_af_config

  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, MAX_HP].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, MAX_HP].min
    return n
  end

  def maxsp
    n = [[base_maxsp + @maxsp_plus, 0].max, MAX_SP].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 0].max, MAX_SP].min
    return n
  end

  def str
    n = [[base_str + @str_plus, 1].max, MAX_STR].min
    for i in @states
      n *= $data_states[i].str_rate / 100.0
    end
    n = [[Integer(n), 1].max, MAX_STR].min
    return n
  end

  def dex
    n = [[base_dex + @dex_plus, 1].max, MAX_DEX].min
    for i in @states
      n *= $data_states[i].dex_rate / 100.0
    end
    n = [[Integer(n), 1].max, MAX_DEX].min
    return n
  end

  def agi
    n = [[base_agi + @agi_plus, 1].max, MAX_AGI].min
    for i in @states
      n *= $data_states[i].agi_rate / 100.0
    end
    n = [[Integer(n), 1].max, MAX_AGI].min
    return n
  end

  def int
    n = [[base_int + @int_plus, 1].max, MAX_INT].min
    for i in @states
      n *= $data_states[i].int_rate / 100.0
    end
    n = [[Integer(n), 1].max, MAX_INT].min
    return n
  end

  def maxhp=(maxhp)
    @maxhp_plus += maxhp - self.maxhp
    @maxhp_plus = [[@maxhp_plus, - MAX_HP].max, MAX_HP].min
    @hp = [@hp, self.maxhp].min
  end

  def maxsp=(maxsp)
    @maxsp_plus += maxsp - self.maxsp
    @maxsp_plus = [[@maxsp_plus, - MAX_SP].max, MAX_SP].min
    @sp = [@sp, self.maxsp].min
  end

  def str=(str)
    @str_plus += str - self.str
    @str_plus = [[@str_plus, - MAX_STR].max, MAX_STR].min
  end

  def dex=(dex)
    @dex_plus += dex - self.dex
    @dex_plus = [[@dex_plus, - MAX_DEX].max, MAX_DEX].min
  end

  def agi=(agi)
    @agi_plus += agi - self.agi
    @agi_plus = [[@agi_plus, - MAX_AGI].max, MAX_AGI].min
  end

  def int=(int)
    @int_plus += int - self.int
    @int_plus = [[@int_plus, - MAX_INT].max, MAX_INT].min
  end
end


I also removed the use of global variables which he used for some reason.

IAMFORTE

YESSSSSSS you fixed it.... Thanks
now i have Alot more control over it