Hey everyone, I was hoping to use Seph's Weapon SpecialScript found in his test bed V.3. I have been fooling around with it for a while now and thought instead of messing it up or something, I would try and get some help off here for it.
Okay what I wanted to know is if there is any way that when you don't have the requirements for the skill or if the special misses (as in the probibility is set to 50 and it doesn't hit) can a basic attack just be used instead of nothing at all.
Thanks.
Here's the script:
Okay what I wanted to know is if there is any way that when you don't have the requirements for the skill or if the special misses (as in the probibility is set to 50 and it doesn't hit) can a basic attack just be used instead of nothing at all.
Thanks.
Here's the script:
#==============================================================================
# ** Weapon Specials
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2006-11-04
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to allow give your weapons specials when they
# are used to attack. You can asign multiple specials and control their
# probablilty to be used. You can force the special and make sp cost of the
# skill nothing. (Specials are skills)
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
# To customize weapon specials, refer the the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
# Force Specials (Passes skill_can_use? test no matter what)
# - Force_Specials = true or false
#
# Specials Use SP
# - Specials_Use_Sp = true or false
#
# Setting Weapon Special
# - Weapon_Specials = { weapon_id => { probability => skill_id, ...}, ... }
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Weapon Specials', 'SephirothSpawn', 1, '2006-11-04')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Weapon Specials')
#==============================================================================
# ** RPG::Weapon
#==============================================================================
class RPG::Weapon
#--------------------------------------------------------------------------
# * Options
#
# Force Specials : When true, actor uses skill no matter what.
# When false, actor must be able to use special (skill).
#
# Use SP : When true, actor uses sp to cast special.
# When false, skill sp cost is nothing.
#--------------------------------------------------------------------------
Force_Specials = true
Specials_Use_Sp = true
#--------------------------------------------------------------------------
# * Weapon Specials
#
# Weapon_Specials = { weapon_id => { probability => skill_id, ...}, ... }
#
# Can have a greater than 100 probablity
# Use nil as skill id, for attack
#--------------------------------------------------------------------------
Weapon_Specials = {
1 => { 100 => 57 }
}
#--------------------------------------------------------------------------
# * Use Weapon Special Test
#--------------------------------------------------------------------------
def use_special?
# Creates Array for skill ids
specials = []
# If Weapon Has Specials
if Weapon_Specials.has_key?(@id)
# Passes through each special
Weapon_Specials[@id].each do |prob, skill_id|
# Adds skill id to specials array probability times
(prob).times { specials << skill_id }
end
end
# Returns random action
return specials[rand([specials.size, 100].max)]
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_weaponspecials_scnbtl_mbar make_basic_action_result
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
def make_basic_action_result
# If attack
if @active_battler.current_action.basic == 0
# If Actor
if @active_battler.is_a?(Game_Actor)
# If Using Weapon
unless (weapon_id = @active_battler.weapon_id) == 0
# If Weapon Has a Special
unless (skill_id = $data_weapons[weapon_id].use_special?).nil?
# Sets To Skill Action
@active_battler.current_action.kind = 1
# Sets Skill ID
@active_battler.current_action.skill_id = skill_id
# If Forcing
if RPG::Weapon::Force_Specials
@active_battler.current_action.forcing = true
end
# Use Skill
make_skill_action_result
# Recover SP if No SP Cost
unless RPG::Weapon::Specials_Use_Sp
@active_battler.sp += $data_skills[skill_id].sp_cost
@status_window.refresh
end
return
end
end
end
end
# Original Make basic action result processing
seph_weaponspecials_scnbtl_mbar
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
# ** Weapon Specials
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2006-11-04
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to allow give your weapons specials when they
# are used to attack. You can asign multiple specials and control their
# probablilty to be used. You can force the special and make sp cost of the
# skill nothing. (Specials are skills)
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
# To customize weapon specials, refer the the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
# Force Specials (Passes skill_can_use? test no matter what)
# - Force_Specials = true or false
#
# Specials Use SP
# - Specials_Use_Sp = true or false
#
# Setting Weapon Special
# - Weapon_Specials = { weapon_id => { probability => skill_id, ...}, ... }
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Weapon Specials', 'SephirothSpawn', 1, '2006-11-04')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Weapon Specials')
#==============================================================================
# ** RPG::Weapon
#==============================================================================
class RPG::Weapon
#--------------------------------------------------------------------------
# * Options
#
# Force Specials : When true, actor uses skill no matter what.
# When false, actor must be able to use special (skill).
#
# Use SP : When true, actor uses sp to cast special.
# When false, skill sp cost is nothing.
#--------------------------------------------------------------------------
Force_Specials = true
Specials_Use_Sp = true
#--------------------------------------------------------------------------
# * Weapon Specials
#
# Weapon_Specials = { weapon_id => { probability => skill_id, ...}, ... }
#
# Can have a greater than 100 probablity
# Use nil as skill id, for attack
#--------------------------------------------------------------------------
Weapon_Specials = {
1 => { 100 => 57 }
}
#--------------------------------------------------------------------------
# * Use Weapon Special Test
#--------------------------------------------------------------------------
def use_special?
# Creates Array for skill ids
specials = []
# If Weapon Has Specials
if Weapon_Specials.has_key?(@id)
# Passes through each special
Weapon_Specials[@id].each do |prob, skill_id|
# Adds skill id to specials array probability times
(prob).times { specials << skill_id }
end
end
# Returns random action
return specials[rand([specials.size, 100].max)]
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_weaponspecials_scnbtl_mbar make_basic_action_result
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
def make_basic_action_result
# If attack
if @active_battler.current_action.basic == 0
# If Actor
if @active_battler.is_a?(Game_Actor)
# If Using Weapon
unless (weapon_id = @active_battler.weapon_id) == 0
# If Weapon Has a Special
unless (skill_id = $data_weapons[weapon_id].use_special?).nil?
# Sets To Skill Action
@active_battler.current_action.kind = 1
# Sets Skill ID
@active_battler.current_action.skill_id = skill_id
# If Forcing
if RPG::Weapon::Force_Specials
@active_battler.current_action.forcing = true
end
# Use Skill
make_skill_action_result
# Recover SP if No SP Cost
unless RPG::Weapon::Specials_Use_Sp
@active_battler.sp += $data_skills[skill_id].sp_cost
@status_window.refresh
end
return
end
end
end
end
# Original Make basic action result processing
seph_weaponspecials_scnbtl_mbar
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end