Sooner than I expected.
#==============================================================================
# RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# * Passive Traits
#--------------------------------------------------------------------------
def passive_traits
return if self.is_a?(RPG::Skill) or self.is_a?(RPG::Item)
return @passive_traits if @passive_traits != nil
@passive_traits = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0,
:spi => 0, :agi => 0, :dex => 0, :res => 0, :hit => 0, :eva => 0,
:cri => 0, :odds => 0, :maxhpp => 100, :maxmpp => 100, :atkp => 100,
:defp => 100, :spip => 100, :agip => 100, :dexp => 100, :resp => 100,
:hitp => 100, :evap => 100, :crip => 100, :oddsp => 100, :states => []}
self.note.split(/[\r\n]+/).each { |line|
case line
when /<(?:PASSIVE|pas)[ ](.*):[ ]([\+\-]\d+)>/i
case $1.upcase
when "MAXHP", "HP"; @passive_traits[:maxhp] = $2.to_i
when "MAXMP", "MP"; @passive_traits[:maxmp] = $2.to_i
when "ATK" ; @passive_traits[:atk] = $2.to_i
when "DEF" ; @passive_traits[:def] = $2.to_i
when "SPI" ; @passive_traits[:spi] = $2.to_i
when "AGI" ; @passive_traits[:agi] = $2.to_i
when "DEX" ; @passive_traits[:dex] = $2.to_i
when "RES" ; @passive_traits[:res] = $2.to_i
when "HIT" ; @passive_traits[:hit] = $2.to_i
when "EVA" ; @passive_traits[:eva] = $2.to_i
when "CRI" ; @passive_traits[:cri] = $2.to_i
when "ODDS" ; @passive_traits[:odds] = $2.to_i
end
when /<(?:PASSIVE|pas)[ ](.*):[ ](\d+)([%?])>/i
case $1.upcase
when "MAXHP", "HP"; @passive_traits[:maxhpp] = $2.to_i
when "MAXMP", "MP"; @passive_traits[:maxmpp] = $2.to_i
when "ATK" ; @passive_traits[:atkp] = $2.to_i
when "DEF" ; @passive_traits[:defp] = $2.to_i
when "SPI" ; @passive_traits[:spip] = $2.to_i
when "AGI" ; @passive_traits[:agip] = $2.to_i
when "HIT" ; @passive_traits[:hitp] = $2.to_i
when "EVA" ; @passive_traits[:evap] = $2.to_i
when "CRI" ; @passive_traits[:crip] = $2.to_i
when "ODDS" ; @passive_traits[:oddsp] = $2.to_i
end
when /<(?:PASSIVE_STATE|passive state):[ ](\d+(?:\s*,\s*\d+)*)>/i
$1.scan(/\d+/).each { |num|
@passive_traits[:states].push($data_states[num.to_i]) if num.to_i > 0}
end
}
return @passive_traits
end
end
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Get Current States as an Object Array
#--------------------------------------------------------------------------
alias passive_equips_states states unless $@
def states
array = passive_equips_states
if actor?
for skill in skills do array |= skill.passive_traits[:states] end
end
return array.compact
end
end
#==============================================================================
# Game Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Basic Maximum HP
#--------------------------------------------------------------------------
alias passive_equips_base_maxhp base_maxhp unless $@
def base_maxhp
n = passive_equips_base_maxhp
for skill in skills do n = n * skill.passive_traits[:maxhpp] / 100.0 end
for skill in skills do n += skill.passive_traits[:maxhp] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Maximum MP
#--------------------------------------------------------------------------
alias passive_equips_base_maxmp base_maxmp unless $@
def base_maxmp
n = passive_equips_base_maxmp
for skill in skills do n = n * skill.passive_traits[:maxmpp] / 100.0 end
for skill in skills do n += skill.passive_traits[:maxmp] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Attack
#--------------------------------------------------------------------------
alias passive_equips_base_atk base_atk unless $@
def base_atk
n = passive_equips_base_atk
for skill in skills do n = n * skill.passive_traits[:atkp] / 100.0 end
for skill in skills do n += skill.passive_traits[:atk] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Defense
#--------------------------------------------------------------------------
alias passive_equips_base_def base_def unless $@
def base_def
n = passive_equips_base_def
for skill in skills do n = n * skill.passive_traits[:defp] / 100.0 end
for skill in skills do n += skill.passive_traits[:def] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Spirit
#--------------------------------------------------------------------------
alias passive_equips_base_spi base_spi unless $@
def base_spi
n = passive_equips_base_spi
for skill in skills do n = n * skill.passive_traits[:spip] / 100.0 end
for skill in skills do n += skill.passive_traits[:spi] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Agility
#--------------------------------------------------------------------------
alias passive_equips_base_agi base_agi unless $@
def base_agi
n = passive_equips_base_agi
for skill in skills do n = n * skill.passive_traits[:agip] / 100.0 end
for skill in skills do n += skill.passive_traits[:agi] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Hit Rate
#--------------------------------------------------------------------------
alias passive_equips_hit hit unless $@
def hit
n = passive_equips_hit
for skill in skills do n = n * skill.passive_traits[:hitp] / 100.0 end
for skill in skills do n += skill.passive_traits[:hit] end
return [Integer(n), 0].max
end
#--------------------------------------------------------------------------
# * Get Evasion Rate
#--------------------------------------------------------------------------
alias passive_equips_eva eva unless $@
def eva
n = passive_equips_eva
for skill in skills do n = n * skill.passive_traits[:evap] / 100.0 end
for skill in skills do n += skill.passive_traits[:eva] end
return [Integer(n), 0].max
end
#--------------------------------------------------------------------------
# * Get Critical Rate
#--------------------------------------------------------------------------
alias passive_equips_cri cri unless $@
def cri
n = passive_equips_cri
for skill in skills do n = n * skill.passive_traits[:crip] / 100.0 end
for skill in skills do n += skill.passive_traits[:cri] end
return [Integer(n), 0].max
end
#--------------------------------------------------------------------------
# * Get Ease of Hitting
#--------------------------------------------------------------------------
alias passive_equips_odds odds unless $@
def odds
n = passive_equips_odds
for skill in skills do n = n * skill.passive_traits[:oddsp] / 100.0 end
for skill in skills do n += skill.passive_traits[:odds] end
return [Integer(n), 1].max
end
end
Place this anywhere in the script editor as long as none of the methods are overwritten. If there are incompatibility errors with anything else you're using, just tell me.
To make the dang thing raise a stat, use a tag in a weapon or armor notebox:
<passive stat: +x> To raise a stat by a certain constant.
<passive stat: -x> To lower a stat by a certain constant.
<passive stat: %x> To raise a stat by a certain percentage.
Place stat as hp, mp, atk, def, agi, spi, hit, eva or odds. An example tag:
<passive atk: %40>
Placed in a weapon's notebox will have it so that when the weapon is equipped the attack of the equip-pee will have their attack raised by 40 percent.
Good?