Code:
#===========================================================================
# ** Custom Skill Effects
#---------------------------------------------------------------------------
# Twilight, 2008
# Special Thanks
# Diedrupo, Trickster, Space not Far
# 03/17/08
# Version 1.06 as of 09/27/2008
#==============================================================================
# Version 1.06
# Attempt to make the script more user friendly.
# A few if the effects were removed as they didn't really do anything.
#---------------------------------------------------------------------------
=begin
** Quick Reference
<Stat:Type:n>
<Gravity:HP or MP:n>
<MaxGravity:HP or MP:n>
<Mercy:HP or MP:n>
<MinusStrike:HP or MP:n>
<LifeStrike:HP or MP:n>
<Hunt:HP or MP:n>
<Add:HP or MP:n>
<Break:HP or MP:n>
------------------------------------------------------------------------
** Stat Multiplier | <Stat:Type:n>
This effect deals damage towards the target based on the
users/targets stat and a percentage.
@ Stat <Str, Def, Agi, Spi, GP>
[Can be Strength, Defense, Agility, or Spirit]
@ Type <User or Target> <Percent>
[Type can refer to the actor or target]
[GP can only use Percent]
@ n <Value>
[n represents the value.]
[Anything above 100 increases damage.]
[Anything below 100 reduces damage. 50 is 50%, etc.]
------------------------------------------------------------------------
** Gravity and Max Gravity
<Gravity:HP or MP:n>, <<MaxGravity:HP or MP:n>
This effect deals damage towards the target based on a percentage
of that targets health.
@ Gravity
[Gravity deals damage based on current HP.]
@ Max Gravity
[Max Gravity deals damage based on Max HP.]
@ n <Value>
[the lower n is, the lower the overall damage is.]
[100 Deals maximum HP for both types
------------------------------------------------------------------------
** Mercy | <Mercy:HP:n>, <Mercy:MP:n>
This effect leaves the target with a specific amount of HP or MP
@n <Value>
[The higher n is, the more HP/MP the target is left with.]
------------------------------------------------------------------------
** Minus Strike | <MinusStrike:HP:n>, <MinusStrike:MP:n>
This effect deals more damage the lower the users HP/MP is
@n <Value>
[Works like on a percentage level now so its like previous effects.]
------------------------------------------------------------------------
** Life Strike | <LifeStrike:HP:n>, <Lifetrike:MP:n>
This effect deals less damage the lower the users HP/MP is
@n <Value>
[Works like on a percentage level now so its like previous effects.]
------------------------------------------------------------------------
** Hunt | <Hunt:HP:n>, <Hunt:MP:n>
This effect deals more damage the lower the targets HP/MP is
@n <Value>
[Works like on a percentage level now so its like previous effects.]
------------------------------------------------------------------------
** Add | <Add:HP:n>, <Add:MP:n>
This effect adds HP or MP damage to a skill. if used stand alone
can have an effect similar to 1000 Needles (all skill options set
to zero in the database)
@n <Value>
[Adds the exact value, no modifiers]
------------------------------------------------------------------------
** Break | <Break:HP:n>, <Break:MP:n>
Reduces targets HP/MP to the value set
@n <Value>
[The value in this case~]
------------------------------------------------------------------------
=end
class Game_Battler
ADAL_CSE_STR = "Str"
ADAL_CSE_DEF = "Def"
ADAL_CSE_AGI = "Agi"
ADAL_CSE_SPI = "Spi"
ADAL_CSE_GOLD = "GP"
ADAL_CSE_GRAV = "Gravity"
ADAL_CSE_MGRAV = "MaxGravity"
ADAL_CSE_MERCY = "Mercy"
ADAL_CSE_MINUS = "MinusStrike"
ADAL_CSE_LIFE = "LifeStrike"
ADAL_CSE_HUNT = "Hunt"
ADAL_CSE_ADD = "Add"
ADAL_CSE_BREAK = "Break"
#------------------------------------------------------------------
# Custom Skill Effects Start
#------------------------------------------------------------------
alias adal_skill_effects_make_obj_damage_value make_obj_damage_value
def make_obj_damage_value(user, obj)
adal_skill_effects_make_obj_damage_value(user, obj)
#------------------------------------------------------------------
# Strength Skill Effect
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_STR}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "User"
@hp_damage = (user.atk * (memo[i+1].to_f / 100)).to_int
end
if memo[i] == "Target"
@hp_damage = (self.atk * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Strength Skill Effects End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Defense Skill Effect
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_DEF}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "User"
@hp_damage = (user.def * (memo[i+1].to_f / 100)).to_int
end
if memo[i] == "Target"
@hp_damage = (self.def * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Defense Skill Effects End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Agility Skill Effect
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_AGI}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "User"
@hp_damage = (user.agi * (memo[i+1].to_f / 100)).to_int
end
if memo[i] == "Target"
@hp_damage = (self.agi * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Agility Skill Effects End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Spirit Skill Effect
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_SPI}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "User"
@hp_damage = (user.spi * (memo[i+1].to_f / 100)).to_int
end
if memo[i] == "Target"
@hp_damage = (self.spi * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Spirit Skill Effects End $game_party.gold
#------------------------------------------------------------------
#------------------------------------------------------------------
# Gold Skill Effects Start
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_SPI}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "Percent"
@hp_damage = ($game_party.gold * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Gold Skill Effects End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Gravity Start
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_GRAV}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "HP"
@hp_damage = (self.hp * (memo[i+1].to_f / 100)).to_int
end
if memo[i] == "MP"
@mp_damage = (self.mp * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Gravity End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Max Gravity Start
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_MGRAV}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "HP"
@hp_damage = (self.maxhp * (memo[i+1].to_f / 100)).to_int
end
if memo[i] == "MP"
@mp_damage = (self.maxmp * (memo[i+1].to_f / 100)).to_int
end
end
end
#------------------------------------------------------------------
# Max Gravity End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Mercy
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_MERCY}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "HP"
@hp_damage -= memo[i+1].to_i
end
if memo[i] == "MP"
@mp_damage -= memo[i+1].to_i
end
end
end
#------------------------------------------------------------------
# Mercy End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Minus Strike
#------------------------------------------------------------------
# Based on Current HP * Value
memo = obj.note.scan(/<#{ADAL_CSE_MINUS}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "HP"
@hp_damage += (user.maxhp - user.hp) * (memo[i+1].to_f / 100).to_int
end
if memo[i] == "MP"
@mp_damage += (user.maxmp - user.mp) * (memo[i+1].to_f / 100).to_int
end
end
end
#------------------------------------------------------------------
# Minus Strike End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Life Strike
#------------------------------------------------------------------
# Based on Current HP * Value
memo = obj.note.scan(/<#{ADAL_CSE_LIFE}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
if memo[i] == "HP"
@hp_damage += user.hp * (memo[i+1].to_f / 100).to_int
end
if memo[i] == "MP"
@mp_damage += user.mp * (memo[i+1].to_f / 100).to_int
end
end
end
#------------------------------------------------------------------
# Life Strike End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Hunt Start
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_HUNT}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
# Set Damage
if memo[i] == "HP"
@hp_damage += (self.maxhp - self.hp) * (memo[i+1].to_f / 100).to_int
end
if memo[i] == "MP"
@mp_damage += (self.maxmp - self.mp) * (memo[i+1].to_f / 100).to_int
end
end
end
#------------------------------------------------------------------
# Hunt End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Add Damage Start
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_ADD}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
# Set Damage
if memo[i] == "HP"
@hp_damage += memo[i+1].to_i
end
if memo[i] == "MP"
@mp_damage += memo[i+1].to_i
end
end
end
#------------------------------------------------------------------
# Add Damage End
#------------------------------------------------------------------
#------------------------------------------------------------------
# Break Start
#------------------------------------------------------------------
memo = obj.note.scan(/<#{ADAL_CSE_BREAK}:(\S+):(\S+)>/)
memo = memo.flatten
if memo != nil and not memo.empty?
for i in 0..memo.size-1
# Set Damage
if memo[i] == "HP"
@hp_damage += self.maxhp - memo[i+1].to_i
end
if memo[i] == "MP"
@mp_damage += self.maxmp - memo[i+1].to_i
end
end
end
#------------------------------------------------------------------
# Break End
#------------------------------------------------------------------
end
end