#==============================================================================
# ** Skill & Equipment - State & Element Percents
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2007-08-10
# SDK : Version 2.0+ - Parts I
#------------------------------------------------------------------------------
# * Version History :
#
# Version 1 ---------------------------------------------------- (2007-08-10)
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to allow you to set percents that states and
# elements will be added to your equipment and skills. If you specify a state
# or element in the database, it automatically gives you that state or
# element 100% of the time. With this, you can make it so those states
# aren't always added.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
#------------------------------------------------------------------------------
# * Customization :
#
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Skill & Equipment State & Element Percents', 'SephirothSpawn', 1,
'2007-08-10')
SDK.check_requirements(2.0)
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Skill & Equipment State & Element Percents')
#==============================================================================
# ** SESEPercents
#==============================================================================
module SESEPercents
#--------------------------------------------------------------------------
# * Percent Settings
#--------------------------------------------------------------------------
Skill_Element_Set = {}
Skill_Plus_State_Set = {}
Skill_Minus_State_Set = {}
Weapon_Element_Set = {}
Weapon_Plus_State_set = {}
Weapon_Minus_State_Set = {}
Armor_Guard_Element_Set = {}
Armor_Guard_State_Set = {}
# Set Blank Defaults - Do Not Delete
for constant in [Skill_Element_Set, Skill_Plus_State_Set,
Skill_Minus_State_Set, Weapon_Element_Set, Weapon_Plus_State_set,
Weapon_Minus_State_Set, Armor_Guard_Element_Set, Armor_Guard_State_Set]
constant.default = {}
end
#--------------------------------------------------------------------------
# * Generate List Percents
#--------------------------------------------------------------------------
def self.generate_percent_list(default_list, constant)
# Starts List
list = {}
# Pass Through Constant List
constant.each {|id, p| list[id] = p}
# Pass Through Default List
for id in default_list
next if list.has_key?(id)
list[id] = 100
end
# Return List
return list
end
#--------------------------------------------------------------------------
# * Generate List
#--------------------------------------------------------------------------
def self.generate_list(percent_list, default_list)
# If Sese On
if $seph_sesepercents_on
# Generate List
list = []
# Pass Through Percent List
percent_list.each do |id, prob|
# Add Id to List
list << id if rand(100) < prob
end
# Return List
return lise
end
# Return Default List
return default_list
end
end
#==============================================================================
# ** RPG::Skill
#==============================================================================
class RPG::Skill
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_sesepercents_rpgskl_es, :element_set
alias_method :seph_sesepercents_rpgskl_pss, :plus_state_set
alias_method :seph_sesepercents_rpgskl_mss, :minus_state_set
#--------------------------------------------------------------------------
# * Element Set Percents
#--------------------------------------------------------------------------
def element_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgskl_es,
SESEPercents::Skill_Element_Set[@id])
end
#--------------------------------------------------------------------------
# * Plus State Set Percents
#--------------------------------------------------------------------------
def plus_state_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgskl_pss,
SESEPercents::Skill_Plus_State_Set[@id])
end
#--------------------------------------------------------------------------
# * Minus State Set Percents
#--------------------------------------------------------------------------
def minus_state_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgskl_mss,
SESEPercents::Skill_Minus_State_Set[@id])
end
#--------------------------------------------------------------------------
# * Element Set
#--------------------------------------------------------------------------
def element_set
return SESEPercents.generate_list(element_set_percents,
seph_sesepercents_rpgskl_es)
end
#--------------------------------------------------------------------------
# * Plus State Set
#--------------------------------------------------------------------------
def plus_state_set
return SESEPercents.generate_list(plus_state_set_percents,
seph_sesepercents_rpgskl_pss)
end
#--------------------------------------------------------------------------
# * Minus State Set
#--------------------------------------------------------------------------
def minus_state_set
return SESEPercents.generate_list(minus_state_set_percents,
seph_sesepercents_rpgskl_mss)
end
end
#==============================================================================
# ** RPG::Weapon
#==============================================================================
class RPG::Weapon
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_sesepercents_rpgwpn_es, :element_set
alias_method :seph_sesepercents_rpgwpn_pss, :plus_state_set
alias_method :seph_sesepercents_rpgwpn_mss, :minus_state_set
#--------------------------------------------------------------------------
# * Element Set Percents
#--------------------------------------------------------------------------
def element_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgwpn_es,
SESEPercents::Weapon_Element_Set[@id])
end
#--------------------------------------------------------------------------
# * Plus State Set Percents
#--------------------------------------------------------------------------
def plus_state_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgwpn_pss,
SESEPercents::Weapon_Plus_State_Set[@id])
end
#--------------------------------------------------------------------------
# * Minus State Set Percents
#--------------------------------------------------------------------------
def minus_state_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgwpn_mss,
SESEPercents::Weapon_Minus_State_Set[@id])
end
#--------------------------------------------------------------------------
# * Element Set
#--------------------------------------------------------------------------
def element_set
return SESEPercents.generate_list(element_set_percents,
seph_sesepercents_rpgwpn_es)
end
#--------------------------------------------------------------------------
# * Plus State Set
#--------------------------------------------------------------------------
def plus_state_set
return SESEPercents.generate_list(plus_state_set_percents,
seph_sesepercents_rpgwpn_pss)
end
#--------------------------------------------------------------------------
# * Minus State Set
#--------------------------------------------------------------------------
def minus_state_set
return SESEPercents.generate_list(minus_state_set_percents,
seph_sesepercents_rpgwpn_mss)
end
end
#==============================================================================
# ** RPG::Armor
#==============================================================================
class RPG::Armor
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_sesepercents_rpgarm_ges, :guard_element_set
alias_method :seph_sesepercents_rpgarm_gss, :guard_state_set
#--------------------------------------------------------------------------
# * Guard Element Set Percents
#--------------------------------------------------------------------------
def guard_element_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgarm_ges,
SESEPercents::Armor_Guard_Element_Set[@id])
end
#--------------------------------------------------------------------------
# * Guard State Set Percents
#--------------------------------------------------------------------------
def guard_state_set_percents
return SESEPercents.generate_percent_list(seph_sesepercents_rpgarm_gss,
SESEPercents::Armor_Guard_State_Set[@id])
end
#--------------------------------------------------------------------------
# * Guard Element Set
#--------------------------------------------------------------------------
def guard_element_set
return SESEPercents.generate_list(guard_element_set_percents,
seph_sesepercents_rpgarm_ges)
end
#--------------------------------------------------------------------------
# * Guard State Set
#--------------------------------------------------------------------------
def guard_state_set
return SESEPercents.generate_list(guard_state_set_percents,
seph_sesepercents_rpgarm_gss)
end
end
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_skillstatepercents_gmbtlr_ae, :attack_effect
alias_method :seph_skillstatepercents_gmbtlr_se, :skill_effect
#--------------------------------------------------------------------------
# * Attack Effect
#--------------------------------------------------------------------------
def attack_effect(*args)
# Turn Sese On
$seph_sesepercents_on = true
# Gets Skill Effect Result
result = seph_skillstatepercents_gmbtlr_ae(*args)
# Turn Sese Off
$seph_sesepercents_on = false
# Return Result
return result
end
#--------------------------------------------------------------------------
# * Skill Effect
#--------------------------------------------------------------------------
def skill_effect(*args)
# Turn Sese On
$seph_sesepercents_on = true
# Gets Skill Effect Result
result = seph_skillstatepercents_gmbtlr_se(*args)
# Turn Sese Off
$seph_sesepercents_on = false
# Return Result
return result
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end