Custom Skill Algorithms
Version: 2.01
Introduction
This script more or less lets you add additional damage scopes to the skills
Features
Screenshots
Can screenshots really be of use for this type of script?
Demo
No demo as of yet, I'll upload one in a bit
Script
Instructions
This script aliases make_obj_damage_value.
Unless you changed the overall damage algorithms, the last part of the script still follows the default VX Damage algorithms.
The setup for each effect is in the script itself so read the notes in it's entirety before asking questions, PS Each effect is setup in the notes field.
FAQ
None as of yet
Compatibility
There should be any compatibility issues with anything, It even works with Tankentai
Credits and Thanks
The original base of this script and the core usage of the notes field was borrowed from Space Not Far
Trickster and Diedrupo also had a hand in this script's development so give them some thanks as well.
Author's Notes
Since I will be a bit more active in the forums I figured I would go ahead and upload this script
Even though variable based damage does damage based on a variable, the variable will probably have to run as a parallel process in common events
for it to take effect at all times.
A quick note, despite it's custom algorithm you still need to have a base damage of 1 or more or the skill will not work.
Terms and Conditions
Not terms or conditions, just give credit for it. It's fairly simple.
Version: 2.01
Introduction
This script more or less lets you add additional damage scopes to the skills
Features
- Minus Strike (Damage based on Health Lost) and Life Strike (Damage based on maximum health)
- Damage based on a percentage of Attack, Defense, Spirit, and Agility, Evasion, and Hit Rate
- Modified Healing Effects
- More unnamed effects like Gravity
Screenshots
Can screenshots really be of use for this type of script?
Demo
No demo as of yet, I'll upload one in a bit
Script
Code:
#===========================================================================
# ** Custom Skill Effects
#---------------------------------------------------------------------------
# Â By Twilight aka Adalwulf
#---------------------------------------------------------------------------
# Â 03/17/08
# Version 2.01
# Â Additional Healing Effects
# Version 2.00
# Â Once again changed how a few skills were setup. If you prefer to original names
# Â you can change the name Initial Word Setup.
# Â New Effects include variable based damage which brings the grand total to 17!
# Version 1.08
# Â Fixes a nasty and unseen bug that made it ignore several things such as element rates and variance.
Â
# Version 1.07
# Â Fixed a few issues and made the setup a little easier to read
# Â A few if the effects were removed as they didn't really do anything.
#===========================================================================
# Â Special Thanks goes to
# Â Diedrupo, For helping me with the script in it's initial stages
# Â Trickster, For teaching me the bits and pieces I needed to get started
# Â Space not Far, For creating such a simple method for using the notes field
#===========================================================================
Â
=begin
#----------------------------------
# Skill Scope Setup Descriptions
#----------------------------------
Â
1. Parameter Effects
 Â
 Note Code
  <Parameter:Scope:Effect>
 Â
  Scopes
  * HP/MP
  1. [Current]  Deals damage based on current HP/MP
  2. [Max]    Deals damage based on Max HP/MP - Current HP/MP
  3. [Absorb]  Absorbs damage dealt into HP/MP
 Â
  * ATK/DEF/SPI/AGI/HIT/EVA
  1. [Actor]   Deals damage based on the characters parameter
  2. [Target]  Deals damage based on the enemies parameter  Â
  3. *Not Implemented* [Weapon] Deals damage based on the weapons parameter
  4. *Not Implemented* [Armor] Deals damage based on the armors parameter
#=======================================================================
2. Healing
 Note Code
 <Healing:Scope:Effect>
 Example
 <Healing:MAXHP:50>
  Heals based on half the users Maximum HP
Â
 Scopes
 1.  White Wind Effect   Â
   [HP/MAXHP] or [MP/MAXMP]
    Heals based on a percentage of users...
    A. HP/MAXHP
    B. MP/MAXMP
   Â
   [T-HP/T-MAXHP] or [T-MP/T-MAXMP]
    Heals based on a percentage of targets...
    A. HP/MAXHP
    B. MP/MAXMP
Â
 2.  Variable Effect
   [VAR]
    Heals Based on Variable ID
Â
 3.  Parameter Effect
   [ATK/DEF/SPI/AGI/HIT/EVA]
    Heals based on a percentage of users...
    A. Attack
    B. Defense
    C. Spirit
    D. Agility
    E. Hit Rate
    F. Evasion
Â
   [T-ATK/T-DEF/T-SPI/T-AGI/T-HIT/T-EVA]
    Heals based on a percentage of targets...
    A. Attack
    B. Defense
    C. Spirit
    D. Agility
    E. Hit Rate
    F. Evasion
Â
#=======================================================================
3. State (Untested)
 Note Code
 <State:State_ID:Multiplier>
 1. State_ID = ID in the Database the enemy must be inflicted with
 2. Multiplier is the amount the damage is multiplied by
#======================================================================= Â
4. Gold
 Note Code
 <GP:Multiplier>
 Damage is based on gold multiplier
#=======================================================================
5. Mercy
 Note Code
 <Mercy:Value>
 Leaves the target with the HP Set in value if the skill would normally kill
#=======================================================================
6. Plus
 Note Code
 <Plus:Amount>
 Adds specified damage to the attack.
 Can be used for skills like 1000 Needles.
#=======================================================================
7. Minus
 Note Code
 <Minus:HP>
 Reduces specified damage to the attack.
 Included just because~
#=======================================================================
8. Gravity
 Note Code
 <Gravity:Scope:Amount>
Â
 Scopes
 [Current-HP] Damage% based on Current HP
 [Current-MP] Damage% based on Current MP
 [Max-HP]   Damage% based on Max HP
 [Max-MP]   Damage% based on Max HP
#=======================================================================
9. Reduce
 Note Code
 <Reduce:Scope:Amount>
Â
 Scopes
 [HP]   Reduces HP to Amount
 [MP]   Reduces MP to Amount
#======================================================================= Â
10. Variable Effect
 Note Code
 <Variable:Variable_ID>
 Variable_ID is the variable in the database.
Â
 NOTE: Be sure to initiate the variable before using the skill or else
 it won't work
#=======================================================================
=end
#---------------------------------------------------------------------------
# Start Custom Skill Effects Part A - Damage Algorithms
#---------------------------------------------------------------------------
class Game_Battler
 #=========================
 # Initial Word Setup Start
 #=========================
Â
 #------------------
 # Parameter Effects
 #------------------
 CSE_HP     = "HP"
 CSE_MP     = "MP"
 CSE_ATK     = "ATK"
 CSE_DEF     = "DEF"
 CSE_SPI     = "SPI"
 CSE_AGI     = "AGI"
 CSE_HIT     = "HIT"
 CSE_EVA     = "EVA" Â
Â
 #------------------
 # Healing Effects
 #------------------
 CSE_HEAL    = "Healing"
Â
 #------------------
 # State Effects
 #------------------
 CSE_STATE    = "State"
Â
 #------------------
 # Special Effects
 #------------------
 CSE_GOLD    = "GP"
 CSE_MERCY    = "Mercy"
 CSE_PLUS    = "Plus" Â
 CSE_MINUS    = "Minus" Â
 CSE_GRAVITY   = "Gravity"
 CSE_REDUCE   = "Reduce"
 CSE_VARIABLE  = "Variable" Â
 #=========================
 # Initial Word Setup End
 #=========================
 #------------------------------------------------------------------
 # Custom Skill Effects Start
 #------------------------------------------------------------------
 alias adalwulf_damage_effects_make_obj_damage_value make_obj_damage_value
 def make_obj_damage_value(user, obj)
  adalwulf_damage_effects_make_obj_damage_value(user, obj)
  damage = obj.base_damage
  if damage > 0
  #------------------------------------------------------------------
  # HP Based Damage
  # ** CSE001
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_HP}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Current"
     damage +=  (user.hp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Max"
     damage +=  (user.maxhp - user.hp) * (memo[i+1].to_f / 100).to_int
    end
    if memo[i] == "Absorb"
     user.hp +=  damage * (memo[i+1].to_f / 100).to_int
    end
   end
  end
Â
  #------------------------------------------------------------------
  # MP Based Damage
  # ** CSE002
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_MP}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Current"
     damage +=  (user.mp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Max"
     damage +=  (user.maxmp - user.mp) * (memo[i+1].to_f / 100).to_int
    end    Â
    if memo[i] == "Absorb"
     user.mp +=  damage * (memo[i+1].to_f / 100).to_int
    end
   end
  end
Â
  #------------------------------------------------------------------
  # Attack Based Damage
  # ** CSE003
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_ATK}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Actor"
     damage +=  (user.atk * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Target"
     damage +=  (self.atk * (memo[i+1].to_f / 100)).to_int
    end
#~ Â Â Â Â if memo[i] == "Weapon"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
#~ Â Â Â Â if memo[i] == "Armor"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
   end
  end
Â
  #------------------------------------------------------------------
  # Defense Based Damage
  # ** CSE004
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_DEF}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Actor"
     damage +=  (user.def * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Target"
     damage +=  (self.def * (memo[i+1].to_f / 100)).to_int
    end
#~ Â Â Â Â if memo[i] == "Weapon"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
#~ Â Â Â Â if memo[i] == "Armor"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
   end
  end
  #------------------------------------------------------------------
  # Spirit Based Damage
  # ** CSE005
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_SPI}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Actor"
     damage +=  (user.spi * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Target"
     damage +=  (self.spi * (memo[i+1].to_f / 100)).to_int
    end
#~ Â Â Â Â if memo[i] == "Weapon"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
#~ Â Â Â Â if memo[i] == "Armor"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
   end
  end
Â
  #------------------------------------------------------------------
  # Agility Based Damage
  # ** CSE006
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_AGI}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Actor"
     damage +=  (user.agi * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Target"
     damage +=  (self.agi * (memo[i+1].to_f / 100)).to_int
    end
#~ Â Â Â Â if memo[i] == "Weapon"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
#~ Â Â Â Â if memo[i] == "Armor"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
   end
  end
Â
  #------------------------------------------------------------------
  # Hit Rate Based Damage
  # ** CSE007
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_HIT}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Actor"
     damage +=  (user.hit * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Target"
     damage +=  (self.hit * (memo[i+1].to_f / 100)).to_int
    end
#~ Â Â Â Â if memo[i] == "Weapon"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
#~ Â Â Â Â if memo[i] == "Armor"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
   end
  end
Â
  #------------------------------------------------------------------
  # Evasion Based Damage
  # ** CSE008
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_EVA}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Actor"
     damage +=  (user.eva * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Target"
     damage +=  (self.eva * (memo[i+1].to_f / 100)).to_int
    end
#~ Â Â Â Â if memo[i] == "Weapon"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
#~ Â Â Â Â if memo[i] == "Armor"
#~ Â Â Â Â Â damage += Â (self.atk * (memo[i+1].to_f / 100)).to_int
#~ Â Â Â Â end
   end
  end
 Â
  #------------------------------------------------------------------
  # Heal Skill Effect
  # ** CSE009
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_HEAL}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    #=======================================================
    # Variable Based Healing
    #=======================================================
    if memo[i] == "VAR"
     damage -=  $game_variables[memo[i+1].to_i]
    end
    #=======================================================
    # User Based Healing
    #=======================================================
    if memo[i] == "ATK"
     damage -=  (user.atk * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "DEF"
     damage -=  (user.def * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "SPI"
     damage -=  (user.spi * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "AGI"
     damage -=  (user.agi * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "HIT"
     damage -=  (user.hit * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "EVA"
     damage -=  (user.eva * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "HP"
     damage -=  (user.hp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "MP"
     damage -=  (user.mp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "MAXHP"
     damage -=  (user.maxhp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "MAXMP"
     damage -=  (user.maxmp * (memo[i+1].to_f / 100)).to_int
    end
    #=======================================================
    # Target Based Healing
    #=======================================================
    if memo[i] == "T-ATK"
     damage -=  (self.atk * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-DEF"
     damage -=  (self.def * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-SPI"
     damage -=  (self.spi * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-AGI"
     damage -=  (self.agi * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-HIT"
     damage -=  (self.hit * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-EVA"
     damage -=  (self.eva * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-HP"
     damage -=  (self.hp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-MP"
     damage -=  (self.mp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-MAXHP"
     damage -=  (self.maxhp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "T-MAXMP"
     damage -=  (self.maxmp * (memo[i+1].to_f / 100)).to_int
    end
   end
  end
Â
  #------------------------------------------------------------------
  # State Based Damage
  # ** CSE010
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_STATE}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if self.state_id[memo[i]]
     damage += (memo[i+1].to_f / 100).to_int
    end
   end
  end
 Â
  #------------------------------------------------------------------
  # Gold Based Damage
  # ** CSE011
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_GOLD}:(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    damage +=  ($game_party.gold * (memo[i].to_f / 100)).to_int
   end
  end
 Â
  #------------------------------------------------------------------
  # Mercy Effect
  # ** CSE012
  #------------------------------------------------------------------
  memo = obj.note.scan(/<#{CSE_MERCY}:(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    self.hp += memo[i+1].to_i
   end
  end
 Â
  #------------------------------------------------------------------
  # Plus Effect
  # ** CSE013
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_PLUS}:(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    damage += memo[i+1].to_i
   end
  end
 Â
  #------------------------------------------------------------------
  # Minus Effect
  # ** CSE014
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_MINUS}:(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    damage -= memo[i+1].to_i
   end
  end
Â
  #------------------------------------------------------------------
  # Gravity Effect
  # ** CSE015
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_GRAVITY}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "Current-HP"
     damage += (self.hp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "Current-MP"
     damage += (self.mp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "MAX-HP"
     damage += (self.maxhp * (memo[i+1].to_f / 100)).to_int
    end
    if memo[i] == "MAX-MP"
     damage += (self.maxmp * (memo[i+1].to_f / 100)).to_int
    end
   end
  end
Â
  #------------------------------------------------------------------
  # Reduce Effect
  # ** CSE016
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_REDUCE}:(\S+):(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    if memo[i] == "HP"
     damage += self.maxhp - memo[i+1].to_i
    end
    if memo[i] == "MP"
     damage += self.maxmp - memo[i+1].to_i
    end
   end
  end
Â
  #------------------------------------------------------------------
  # Variable Effect
  # ** CSE017
  #------------------------------------------------------------------
Â
  memo = obj.note.scan(/<#{CSE_VARIABLE}:(\S+)>/)
  memo = memo.flatten
  if memo != nil and not memo.empty?
   for i in 0..memo.size-1
    damage += $game_variables[memo[i].to_i]
   end
  end
  #------------------------------------------------------------------
  # Damage Algorithm Mod - Set to Default Algorithms
  #------------------------------------------------------------------
   damage += user.atk * 4 * obj.atk_f / 100   # Attack F of the user
   damage += user.spi * 2 * obj.spi_f / 100   # Spirit F of the user
   unless obj.ignore_defense         # Except for ignore defense
   damage -= self.def * 2 * obj.atk_f / 100  # Attack F of the target
   damage -= self.spi * 1 * obj.spi_f / 100  # Spirit F of the target
   end
   damage = 0 if damage < 0         # If negative, make 0
  elsif damage < 0             # a negative number?
   damage -= user.atk * 4 * obj.atk_f / 100   # Attack F of the user
   damage -= user.spi * 2 * obj.spi_f / 100   # Spirit F of the user
  end
  damage *= elements_max_rate(obj.element_set)  # elemental adjustment
  damage /= 100
  damage = apply_variance(damage, obj.variance)  # variance
  damage = apply_guard(damage)        # guard adjustment
  if obj.damage_to_mp
   @mp_damage = damage           # damage MP
  else
   @hp_damage = damage           # damage HP
  end Â
 end
end
Â
Instructions
This script aliases make_obj_damage_value.
Unless you changed the overall damage algorithms, the last part of the script still follows the default VX Damage algorithms.
The setup for each effect is in the script itself so read the notes in it's entirety before asking questions, PS Each effect is setup in the notes field.
FAQ
None as of yet
Compatibility
There should be any compatibility issues with anything, It even works with Tankentai
Credits and Thanks
The original base of this script and the core usage of the notes field was borrowed from Space Not Far
Trickster and Diedrupo also had a hand in this script's development so give them some thanks as well.
Author's Notes
Since I will be a bit more active in the forums I figured I would go ahead and upload this script
Even though variable based damage does damage based on a variable, the variable will probably have to run as a parallel process in common events
for it to take effect at all times.
A quick note, despite it's custom algorithm you still need to have a base damage of 1 or more or the skill will not work.
Terms and Conditions
Not terms or conditions, just give credit for it. It's fairly simple.