#===============================================================================
# ** Game_Battler
#===============================================================================
Â
class Game_Battler
 #-----------------------------------------------------------------------------
 # * Name    : Hp Percent
 #  Info    : Returns HP Percent
 #  Author   : SephirothSpawn
 #  Call Info : Two Arguments
 #        Integer truth, true for integer, false for float
 #        Float points, integer value for number of float points
 #-----------------------------------------------------------------------------
 def hp_percent(integer = false, float_points = 2)
  # Gets Float Percent
  n = (self.hp / self.maxhp.to_f * 100.0)
  # Return Percent
  return integer ? Integer(n) : n.float_points(float_points)
 end
 #-----------------------------------------------------------------------------
 # * Name    : Sp Percent
 #  Info    : Returns SP Percent
 #  Author   : SephirothSpawn
 #  Call Info : Two Arguments
 #        Integer truth, true for integer, false for float
 #        Float points, integer value for number of float points
 #-----------------------------------------------------------------------------
 def sp_percent(integer = false, float_points = 2)
  # Gets Float Percent
  n = (self.sp / self.maxsp.to_f * 100.0)
  # Return Percent
  return integer ? Integer(n) : n.float_points(float_points)
 end
end
Â
#===============================================================================
# ** Game_Actor
#===============================================================================
Â
class Game_Actor < Game_Battler
 #-----------------------------------------------------------------------------
 # * Alias Listings
 #-----------------------------------------------------------------------------
 alias_method :classchangelevel_gmactor_initialize,  :initialize
 alias_method :classchangelevel_gmactor_chgclassid,  :class_id=
 #-----------------------------------------------------------------------------
 # * Object Initialization
 #-----------------------------------------------------------------------------
 def initialize(actor_id)
  classchangelevel_gmactor_initialize(actor_id)
  @class_change_levels = Hash.new
  @class_change_levels.default = 1
 end
 #-----------------------------------------------------------------------------
 # * Class ID = (class_id)
 #-----------------------------------------------------------------------------
 def class_id=(class_id)
  hp_percentile = self.hp_percent(true)
  sp_percentile = self.sp_percent(true)
  @class_change_levels[@class_id] = self.level
  classchangelevel_gmactor_chgclassid(class_id)
  self.level = @class_change_levels[@class_id]
  self.hp = Integer(self.maxhp * (hp_percentile / 100.0))
  self.sp = Integer(self.maxsp * (sp_percentile / 100.0))
 end
end