This script was designed as a simple solution for folks who want higher level skills to replace their weaker counterparts. For instance, you can set it so Fire 1 is replaced by Fire 2, Fire 2 is replaced by Fire 3, etc. That's just a generic example (and it's set in the script), but you should get an idea of what you'd use this for.
class RPG::Skill
#-----------------------------------------------------------------------------
# * Replacements = {skill_id => old_skill}
#-----------------------------------------------------------------------------
Replacements = Hash.new
Replacements[5] = 4 # Ensuna removes Poisona
Replacements[8] = 7 # Fire II removes Fire
Replacements[9] = [7,8] # Fire III removes Fire II and Fire
Replacements[11] = 10 # Ice II removes Ice
Replacements[12] = [11,10] # Ice III removes Ice II and Ice
Replacements[14] = 13 # Thunder II removes Thunder
Replacements[15] = [14,13] # Thunder III removes Thunder II and Thunder
Replacements[17] = 16 # Water II removes Water
Replacements[18] = [17,16] # Water III removes Water II and Water
#-----------------------------------------------------------------------------
# * Replacements (Default)
#-----------------------------------------------------------------------------
Replacements.default = []
#-----------------------------------------------------------------------------
# * Replacements
#-----------------------------------------------------------------------------
def replacements
Replacements[@id].is_a?(Integer) ? [Replacements[@id]] : Replacements[@id]
end
end
class Game_Actor
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :skillreplacements_gmactor_learnskill, :learn_skill
#-----------------------------------------------------------------------------
# * Learn Skill
#-----------------------------------------------------------------------------
def learn_skill(skill_id)
# The usual
skillreplacements_gmactor_learnskill(skill_id)
# Get skill object
skill = $data_skills[skill_id]
# For each skill that is supposed to be replaced
skill.replacements.each {|s| forget_skill(s)}
end
end
Compatability
Doesn't require SDK or MACL. Oh hey, this might work in VX and/or VX Ace but I have no way of testing that, so you'll have to see for yourself.
- Terms and Conditions
Free to use in commercial and non-commercial games!