Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[RESOLVED]How to add stats to a class using RGSS and SABS???(like strenght)

Mililo

Member

Yesterday i asked how to add stats to an actor using RGSS and i was answered, the code was $game_party.actors[0].str --- to add strenght to first actor in party as an example

But now i am needing this same code but to add for all actors of the class id that I want.
I tried any codes but they didin't worked, I'm not right if that code exist but i think mixing any codes a result can come.
If anyone can help i'll be very grateful.
Cya  :wink:
 
Hmm...
You might try this:
Code:
for actor in $game_actors
actor.str += VALUE if actor.class_id = CLASS
end
Note that VALUE is how much you want to change the attack value by, and CLASS is the ID of the class you want to effect.
Also, if you're wanting to change an actor in your party, it should be
Code:
$game_party.actors[INDEX].str += VALUE
where INDEX is the position in the party [0, 1, 2, or 3].
Code:
$game_actors[ID].str += VALUE
effects the character whose ID in the database you list.

Note, I haven't tested any of this, but it should work.  Also, having just re-read the methods in Game_Battler and Interpreter that control the event command, you should be able to get away with a direct set, rather than addition.  Just knock the "+" off of any of those calls.
 

Mililo

Member

That's not exactly what I want.

I i'll explain better what I want is to all the actor of one class add 1 to strenght. ex:
I have 4 actors in the party and 3 of them have the class_id = 1 then i'll use the code(the one i'm trying to know what is) and that 3 i'll add one of strenght.

Thanks anyway DrakoShade.
 
I have a script for that. ;)

Code:
#==============================================================================
# ** Actor Bonuses
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 3
# 2007-01-28
# SDK : Version 2.0+, Part I
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 ---------------------------------------------------- (2006-03-12)
#   Version 2 ---------------------------------------------------- (2006-09-20)
#    - Update : Re-scripted Entire System
#    Version 2.1 ------------------------------------------------- (2006-11-30)
#     - Bug Fix : Fixed State Ranks Error
#    Version 2.11 ------------------------------------------------ (2006-12-13)
#     - Bug Fix : Fixed State Ranks Error
#   Version 3 ---------------------------------------------------- (2007-01-28)
#     - Updated Code Using Stat Bonus Base & SDK 2.0
#------------------------------------------------------------------------------
# * Requirements :
#
#   Stat Bonus Base
#------------------------------------------------------------------------------
# * Description :
#
#   This Script was designed to allow your characters to gain additional
#   bonuses to their stats and elemental/state ranks. It allows you to gain
#   bonuses based off : actor id, class id, equipment or skills (passive).
#   You can control the bonuses to be either direct gains or percents (except
#   element and state ranks modificatsion). If an direct and percent gain
#   exist, the direct gain will take place first, then multiple by the percent.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To Customize your bonuses, refer to the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
#   <Bonus_Type> = { <key> => { stat_bonus => bonus, ... } ... }
#
#   The Following are list of constants and description of the bonus
#
#   ActorBonuses_Direct / ActorBonuses_Percent
#    - Description : Gains Bonuses Based Off Actor ID
#    - Key : Actor ID
#
#   ClassBonuses_Direct / ClassBonuses_Percent
#    - Description : Gains Bonuses Based Off Class ID
#    - Key : Class ID
#
#   SkillBonuses_Direct / SkillBonuses_Percent
#    - Description : Gains Bonuses Based Off Skill ID
#    - Key : Skill ID
#
#   WeaponBonuses_Direct / WeaponBonuses_Percent
#    - Description : Gains Bonuses Based Off Weapon ID
#    - Key : Weapon ID
#
#   ArmorBonuses_Direct / ArmorBonuses_Percent
#    - Description : Gains Bonuses Based Off Armor ID
#    - Key : Armor ID
#
# ** Normal Stat Modifers
#
#   'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', 'pdef', 'mdef',
#   'eva', 'hit', 'exp', 'gold'
#  
# ** Special Modifers
#   'element' => { element_id => bonus }
#   'state'   => { state_id   => bonus }
#------------------------------------------------------------------------------
# * Syntax :
#
#   Collect Bonus Gain For a Certain Stat
#     Actor_Stat_Bonuses.calculate_bonus(<game_actor>, <stat_name>, base_value)
#
#     or
#
#     <game_actor>.seph_asb_<stat_name>_bonus
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Actor Bonuses', 'SephirothSpawn', 3.0, '2007-01-28')
SDK.check_requirements(2.0, [], {'Stat Bonus Base' => 1})

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Actor Bonuses')

#==============================================================================
# ** Actor_Stat_Bonuses
#==============================================================================
  
module Actor_Stat_Bonuses
  #--------------------------------------------------------------------------
  # * Stat Bonuses
  #
  #  ~ Normal Stat Modifers
  #    'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', 'pdef', 'mdef',
  #    'eva', 'hit', 'exp', 'gold'
  #  
  #  ~ Special Modifers (Note that there is no % bonus for element & states)
  #    'element' => { element_id => bonus }
  #    'state'   => { state_id   => bonus }
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  # * Actor Bonuses
  #
  #  ~ actor_id => { stat_bonus => bonus, ... }
  #--------------------------------------------------------------------------
  ActorBonuses_Direct = {
  }
  ActorBonuses_Percent = {
  }
  #--------------------------------------------------------------------------
  # * Class Bonuses
  #
  #  ~ class_id => { stat_bonus => bonus, ... }
  #--------------------------------------------------------------------------
  ClassBonuses_Direct = {
  }
  ClassBonuses_Percent = {
  }
  #--------------------------------------------------------------------------
  # * Skill Bonuses (Passive)
  #
  #  ~ skill_id => { stat_bonus => bonus, ... }
  #--------------------------------------------------------------------------
  SkillBonuses_Direct = {
  }
  SkillBonuses_Percent = {
  }
  #--------------------------------------------------------------------------
  # * Weapon Bonuses
  #
  #  ~ weapon_id => { stat_bonus => bonus, ... }
  #--------------------------------------------------------------------------
  WeaponBonuses_Direct = {
  }
  WeaponBonuses_Percent = {
  }
  #--------------------------------------------------------------------------
  # * Armor Bonuses
  #
  #  ~ armor_id => { stat_bonus => bonus, ... }
  #--------------------------------------------------------------------------
  ArmorBonuses_Direct = {
  }
  ArmorBonuses_Percent = {
  }
  #--------------------------------------------------------------------------
  # * Sets Defaults For All Constants
  #
  #   Do Not Alter his unless you know what you are doing
  #--------------------------------------------------------------------------
  [ActorBonuses_Direct,  ActorBonuses_Percent,  ClassBonuses_Direct, 
   ClassBonuses_Percent, SkillBonuses_Direct,   SkillBonuses_Percent,
   WeaponBonuses_Direct, WeaponBonuses_Percent, ArmorBonuses_Direct, 
   ArmorBonuses_Percent].each do |constant|
    constant.default = {}
    constant.default.default = 0
    constant.default['element'] = {}
    constant.default['element'].default = 0
    constant.default['state'] = {}
    constant.default['state'].default = 0
    constant.keys.each do |key| 
      constant[key].default = 0
      constant[key]['element'] = {} unless constant[key].has_key?('element')
      constant[key]['element'].default = 0
      constant[key]['state'] = {} unless constant[key].has_key?('state')
      constant[key]['state'].default = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get Normal Bonuses (Direct)
  #--------------------------------------------------------------------------
  def self.get_normal_bonus_direct(actor, bonus_string)
    # Starts Bonus Count
    n = 0
    # Adds Actor Bonus
    n += ActorBonuses_Direct[actor.id][bonus_string]
    # Adds Class Bonus
    n += ClassBonuses_Direct[actor.class_id][bonus_string]
    # Adds Skill Bonus
    for skill_id in actor.skills
      n += SkillBonuses_Direct[skill_id][bonus_string]
    end
    # Adds Weapon Bonus
    n += WeaponBonuses_Direct[actor.weapon_id][bonus_string]
    # Adds Armor Bonus
    n += ArmorBonuses_Direct[actor.armor1_id][bonus_string]
    n += ArmorBonuses_Direct[actor.armor2_id][bonus_string]
    n += ArmorBonuses_Direct[actor.armor3_id][bonus_string]
    n += ArmorBonuses_Direct[actor.armor4_id][bonus_string]
    # Returns Bonus
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Normal Bonuses (Percent)
  #--------------------------------------------------------------------------
  def self.get_normal_bonus_percent(actor, bonus_string)
    # Starts Bonus Count
    n = 0
    # Adds Actor Bonus
    n += ActorBonuses_Percent[actor.id][bonus_string]
    # Adds Class Bonus
    n += ClassBonuses_Percent[actor.class_id][bonus_string]
    # Adds Skill Bonus
    for skill_id in actor.skills
      n += SkillBonuses_Percent[skill_id][bonus_string]
    end
    # Adds Weapon Bonus
    n += WeaponBonuses_Percent[actor.weapon_id][bonus_string]
    # Adds Armor Bonus
    n += ArmorBonuses_Percent[actor.armor1_id][bonus_string]
    n += ArmorBonuses_Percent[actor.armor2_id][bonus_string]
    n += ArmorBonuses_Percent[actor.armor3_id][bonus_string]
    n += ArmorBonuses_Percent[actor.armor4_id][bonus_string]
    # Returns Bonus
    return n
  end
  #--------------------------------------------------------------------------
  # * Calculate Special Bonuses
  #--------------------------------------------------------------------------
  def self.calculate_special_bonus(actor, bonus_string, id)
    # Starts Bonus Count
    n = 0
    # Adds Actor Bonus
    n += ActorBonuses_Direct[actor.id][bonus_string][id]
    # Adds Class Bonus
    n += ClassBonuses_Percent[actor.class_id][bonus_string][id]
    # Adds Skill Bonus
    for skill_id in actor.skills
      n += SkillBonuses_Percent[skill_id][bonus_string][id]
    end
    # Adds Weapon Bonus
    n += WeaponBonuses_Percent[actor.weapon_id][bonus_string][id]
    # Adds Armor Bonus
    n += ArmorBonuses_Percent[actor.armor1_id][bonus_string][id]
    n += ArmorBonuses_Percent[actor.armor2_id][bonus_string][id]
    n += ArmorBonuses_Percent[actor.armor3_id][bonus_string][id]
    n += ArmorBonuses_Percent[actor.armor4_id][bonus_string][id]
    # Returns Bonus
    return n
  end
  #--------------------------------------------------------------------------
  # * Calculate Bonus
  #--------------------------------------------------------------------------
  def self.calculate_bonus(actor, bonus_string, base_value)
    # Collects Direct Bonus
    direct_bonus = self.get_normal_bonus_direct(actor, bonus_string)
    # Collects Percent Bonus
    percent_bonus = self.get_normal_bonus_percent(actor, bonus_string)
    # Return Bonus
    return Integer( ( base_value + direct_bonus ) * 
                    ( (100 + percent_bonus) / 100.0 ) ) - base_value
  end
end
  
#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_statbonus_dmhpb,         :direct_maxhp_bonus
  alias_method :seph_statbonus_dmspb,         :direct_maxsp_bonus
  alias_method :seph_statbonus_dstrb,         :direct_str_bonus
  alias_method :seph_statbonus_ddexb,         :direct_dex_bonus
  alias_method :seph_statbonus_dagib,         :direct_agi_bonus
  alias_method :seph_statbonus_dintb,         :direct_int_bonus
  alias_method :seph_statbonus_datkb,         :direct_atk_bonus
  alias_method :seph_statbonus_devab,         :direct_eva_bonus
  alias_method :seph_statbonus_dhitb,         :direct_hit_bonus
  alias_method :seph_statbonus_dpdefb,        :direct_pdef_bonus
  alias_method :seph_statbonus_dmdefb,        :direct_mdef_bonus
  alias_method :seph_statbonus_pmhpb,         :percent_maxhp_bonus
  alias_method :seph_statbonus_pmspb,         :percent_maxsp_bonus
  alias_method :seph_statbonus_pstrb,         :percent_str_bonus
  alias_method :seph_statbonus_pdexb,         :percent_dex_bonus
  alias_method :seph_statbonus_pagib,         :percent_agi_bonus
  alias_method :seph_statbonus_pintb,         :percent_int_bonus
  alias_method :seph_statbonus_patkb,         :percent_atk_bonus
  alias_method :seph_statbonus_pevab,         :percent_eva_bonus
  alias_method :seph_statbonus_phitb,         :percent_hit_bonus
  alias_method :seph_statbonus_ppdefb,        :percent_pdef_bonus
  alias_method :seph_statbonus_pmdefb,        :percent_mdef_bonus
  alias_method :seph_statbonus_gmactr_er,     :element_rate
  alias_method :seph_statbonus_gmactr_sr,     :state_ranks
  alias_method :seph_statbonus_gmactr_exp=,   :exp=
  #--------------------------------------------------------------------------
  # * Get Maximum HP
  #--------------------------------------------------------------------------
  def direct_maxhp_bonus
    n = seph_statbonus_dmhpb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'maxhp')
    return n
  end
  def percent_maxhp_bonus
    n = seph_statbonus_pmhpb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'maxhp')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Maximum SP
  #--------------------------------------------------------------------------
  def direct_maxsp_bonus
    n = seph_statbonus_dmspb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'maxsp')
    return n
  end
  def percent_maxsp_bonus
    n = seph_statbonus_pmspb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'maxsp')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Strength
  #--------------------------------------------------------------------------
  def direct_str_bonus
    n = seph_statbonus_dstrb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'str')
    return n
  end
  def percent_str_bonus
    n = seph_statbonus_pstrb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'str')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Dexterity
  #--------------------------------------------------------------------------
  def direct_dex_bonus
    n = seph_statbonus_ddexb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'dex')
    return n
  end
  def percent_dex_bonus
    n = seph_statbonus_pdexb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'dex')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def direct_agi_bonus
    n = seph_statbonus_dagib
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'agi')
    return n
  end
  def percent_agi_bonus
    n = seph_statbonus_pagib
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'agi')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Intelligence
  #--------------------------------------------------------------------------
  def direct_int_bonus
    n = seph_statbonus_dintb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'int')
    return n
  end
  def percent_int_bonus
    n = seph_statbonus_pintb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'int')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #--------------------------------------------------------------------------
  def direct_atk_bonus
    n = seph_statbonus_datkb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'atk')
    return n
  end
  def percent_atk_bonus
    n = seph_statbonus_patkb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'atk')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Physical Defense
  #--------------------------------------------------------------------------
  def direct_pdef_bonus
    n = seph_statbonus_dpdefb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'pdef')
    return n
  end
  def percent_pdef_bonus
    n = seph_statbonus_ppdefb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'pdef')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Magic Defense
  #--------------------------------------------------------------------------
  def direct_mdef_bonus
    n = seph_statbonus_dmdefb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'mdef')
    return n
  end
  def percent_mdef_bonus
    n = seph_statbonus_pmdefb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'mdef')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Evasion Correction
  #--------------------------------------------------------------------------
  def direct_eva_bonus
    n = seph_statbonus_devab
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'eva')
    return n
  end
  def percent_eva_bonus
    n = seph_statbonus_pevab
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'eva')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Hit Correction
  #--------------------------------------------------------------------------
  def direct_hit_bonus
    n = seph_statbonus_dhitb
    n += Actor_Stat_Bonuses.get_normal_bonus_direct(self, 'hit')
    return n
  end
  def percent_hit_bonus
    n = seph_statbonus_phitb
    n += Actor_Stat_Bonuses.get_normal_bonus_percent(self, 'hit')
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Element Revision Value
  #--------------------------------------------------------------------------
  def element_rate(element_id)
    # Get Original Element Rate
    n = seph_statbonus_gmactr_er(element_id)
    # Adds Bonus
    n += Actor_Stat_Bonuses.calculate_special_bonus(self, 'element', 
      element_id)
    # Return Result
    return n
  end
  #--------------------------------------------------------------------------
  # * Get State Effectiveness
  #--------------------------------------------------------------------------
  def state_ranks
    # Get Original State Ranks
    ranks = seph_statbonus_gmactr_sr
    # Pass Through All State Ranks
    for i in 1...ranks.xsize
      bonus = Actor_Stat_Bonuses.calculate_special_bonus(self, 'state', i)
      ranks[i] += bonus
    end
    # Return Ranks
    return ranks
  end
  #--------------------------------------------------------------------------
  # * Change EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    # If Gaining Exp
    if (exp_gain = exp - @exp) > 0
      # Collect Exp Bonus
      # Add Bonus
      exp += Actor_Stat_Bonuses.calculate_bonus(self, 'exp', exp_gain)
    end
    # Original Exp Set
    self.seph_statbonus_gmactr_exp=(exp)
  end
end

#==============================================================================
# ** Window_BattleResult
#==============================================================================

class Window_BattleResult < Window_Base
  attr_accessor :gold
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  alias_method :seph_asb_scnbtl_sp5, :start_phase5
  def start_phase5
    # Original Start Battle Phase 5
    seph_asb_scnbtl_sp5
    # Read Gold Gained
    gold = @result_window.gold
    # Start Gold Gain Counters
    direct_gain = 0
    percent_gain = 0
    for actor in $game_party.actors
      unless actor.dead?
        direct_gain += Actor_Stat_Bonuses.get_normal_bonus_direct(actor, 
          'gold')
        percent_gain += Actor_Stat_Bonuses.get_normal_bonus_percent(actor, 
          'gold')
      end
    end
    # Calculate Gold Increase
    gold = Integer( ( gold + direct_gain ) * 
                    ( (100 + percent_gain) / 100.0 ) )
    # Reset Gold Gain
    @result_window.gold = gold
    # Refresh Result Window
    @result_window.refresh
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

It requires this:
Code:
#==============================================================================
# ** Stat Bonus Base
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2007-01-26
# SDK : Version 2.0+, Part I
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 ---------------------------------------------------- (2007-01-26)
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to create methods for adding direct and percent
#   modifications to the actors stats. This is a tool for scripters. The basic
#   stat formula is as follows :
#
#   stat = (base_stat + direct_mod) * percent mod
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To learn to use the system, refer to syntax.
#------------------------------------------------------------------------------
# * Syntax :
#
#   The following stats can recieve a bonus :
#    - maxhp, maxsp, str, dex, agi, int, atk, mdef, pdef, eva, hit
#
#   Basic Outline to using methods :
#
#    alias_method :<yourname>_<scriptname>_statmod_<statname>, :<statmethod>
#    def <statmethod>
#      n = <yourname>_<scriptname>_statmod_<statname>
#      n += (your formula for adding bonuses here)
#      return n
#    end
#
#   Direct Bonus Methods :
#    - direct_maxhp_bonus  - direct_str_bonus   - direct_agi_bonus
#    - direct_maxsp_bonus  - direct_dex_bonus   - direct_int_bonus
#    - direct_atk_bonus    - direct_pdef_bonus  - direct_mdef_bonus
#    - direct_eva_bonus    - direct_hit_bonus
#
#   Percent Bonus Methds :
#    - percent_maxhp_bonus  - percent_str_bonus   - percent_agi_bonus
#    - percent_maxsp_bonus  - percent_dex_bonus   - percent_int_bonus
#    - percent_atk_bonus    - percent_pdef_bonus  - percent_mdef_bonus
#    - percent_eva_bonus    - percent_hit_bonus
#
#   All methods are located in Game_Actor
#
#   ** Example : Adding 5 Points to maxhp for actor 5
#
#   class Game_Actor < Game_Battler
#     alias_method :seph_example_statmod_dhpb, :direct_maxhp_bonus
#     def direct_maxhp_bonus
#       n = seph_example_statmod_dhpb
#       n += 5 if @actor_id == 5
#       return n
#     end
#   end
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Stat Bonus Base', 'SephirothSpawn', 1, '2007-01-26')
SDK.check_requirements(2.0)

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Stat Bonus Base')
  
#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_statbonusbase_bmaxhp, :base_maxhp
  alias_method :seph_statbonusbase_bmaxsp, :base_maxsp
  alias_method :seph_statbonusbase_bstr,   :base_str
  alias_method :seph_statbonusbase_bdex,   :base_dex
  alias_method :seph_statbonusbase_bagi,   :base_agi
  alias_method :seph_statbonusbase_bint,   :base_int
  alias_method :seph_statbonusbase_batk,   :base_atk
  alias_method :seph_statbonusbase_bpdef,  :base_pdef
  alias_method :seph_statbonusbase_bmdef,  :base_mdef
  alias_method :seph_statbonusbase_beva,   :base_eva
  alias_method :seph_statbonusbase_hit,    :hit
  #--------------------------------------------------------------------------
  # * Get Maximum HP
  #--------------------------------------------------------------------------
  def base_maxhp
    # Gets Orginal Value
    n = seph_statbonusbase_bmaxhp
    # Adds Direct Stat Bonus
    n += direct_maxhp_bonus
    # Adds Percent Stat Bonus
    n *= (percent_maxhp_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_maxhp_bonus  ; return 0 ; end
  def percent_maxhp_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Maximum SP
  #--------------------------------------------------------------------------
  def base_maxsp
    # Gets Orginal Value
    n = seph_statbonusbase_bmaxsp
    # Adds Direct Stat Bonus
    n += direct_maxsp_bonus
    # Adds Percent Stat Bonus
    n *= (percent_maxsp_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_maxsp_bonus  ; return 0 ; end
  def percent_maxsp_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Strength
  #--------------------------------------------------------------------------
  def base_str
    # Gets Orginal Value
    n = seph_statbonusbase_bstr
    # Adds Direct Stat Bonus
    n += direct_str_bonus
    # Adds Percent Stat Bonus
    n *= (percent_str_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_str_bonus  ; return 0 ; end
  def percent_str_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Dexterity
  #--------------------------------------------------------------------------
  def base_dex
    # Gets Orginal Value
    n = seph_statbonusbase_bdex
    # Adds Direct Stat Bonus
    n += direct_dex_bonus
    # Adds Percent Stat Bonus
    n *= (percent_dex_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_dex_bonus  ; return 0 ; end
  def percent_dex_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def base_agi
    # Gets Orginal Value
    n = seph_statbonusbase_bagi
    # Adds Direct Stat Bonus
    n += direct_agi_bonus
    # Adds Percent Stat Bonus
    n *= (percent_agi_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_agi_bonus  ; return 0 ; end
  def percent_agi_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Basic Intelligence
  #--------------------------------------------------------------------------
  def base_int
    # Gets Orginal Value
    n = seph_statbonusbase_bint
    # Adds Direct Stat Bonus
    n += direct_int_bonus
    # Adds Percent Stat Bonus
    n *= (percent_int_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_int_bonus  ; return 0 ; end
  def percent_int_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #--------------------------------------------------------------------------
  def base_atk
    # Gets Orginal Value
    n = seph_statbonusbase_batk
    # Adds Direct Stat Bonus
    n += direct_atk_bonus
    # Adds Percent Stat Bonus
    n *= (percent_atk_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_atk_bonus  ; return 0 ; end
  def percent_atk_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Basic Physical Defense
  #--------------------------------------------------------------------------
  def base_pdef
    # Gets Orginal Value
    n = seph_statbonusbase_bpdef
    # Adds Direct Stat Bonus
    n += direct_pdef_bonus
    # Adds Percent Stat Bonus
    n *= (percent_pdef_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_pdef_bonus  ; return 0 ; end
  def percent_pdef_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Basic Magic Defense
  #--------------------------------------------------------------------------
  def base_mdef
    # Gets Orginal Value
    n = seph_statbonusbase_bmdef
    # Adds Direct Stat Bonus
    n += direct_mdef_bonus
    # Adds Percent Stat Bonus
    n *= (percent_mdef_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_mdef_bonus  ; return 0 ; end
  def percent_mdef_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Basic Evasion Correction
  #--------------------------------------------------------------------------
  def base_eva
    # Gets Orginal Value
    n = seph_statbonusbase_beva
    # Adds Direct Stat Bonus
    n += direct_eva_bonus
    # Adds Percent Stat Bonus
    n *= (percent_eva_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_eva_bonus  ; return 0 ; end
  def percent_eva_bonus ; return 0 ; end
  #--------------------------------------------------------------------------
  # * Get Hit
  #--------------------------------------------------------------------------
  def hit
    # Gets Orginal Value
    n = seph_statbonusbase_hit
    # Adds Direct Stat Bonus
    n += direct_hit_bonus
    # Adds Percent Stat Bonus
    n *= (percent_hit_bonus + 100) / 100.0
    # Returns Stat
    return n
  end
  def direct_hit_bonus  ; return 0 ; end
  def percent_hit_bonus ; return 0 ; end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

You can just alter here:
Code:
  ClassBonuses_Direct = {
  }
  ClassBonuses_Percent = {
  }

So if class 1 got a 3 point increase in str, you would have
Code:
  ClassBonuses_Direct = {
    3 => {'str' => 3}
  }
  ClassBonuses_Percent = {
  }

Let me know if you need any help with anything.
 

Mililo

Member

I saw that script yesterday and I din't understood what it do and now I keep very confused about that xP but thanks for help seph.

Anyway I finally found the right code and did it by myself :lol:
the code was:
"actor = ally.actor
actor.str += 1" --- it's going to add str to the actor who do the thing so I don't need more the use of class.
it's exclusive for Mr.Mo SABS or maybe work on others ABS

So the problem is resolved.
Thanks for everyone that helped...
Cya  :wink:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top