#============================================================================ # EST Forget Skill by Skill Trees v1.0 # By Emerald # # Requires Emerald's Skill Trees #---------------------------------------------------------------------------- # You're free to use the script for any game, as long as you give credits #---------------------------------------------------------------------------- # Version History # 1.0 -> Started add-on. All basic stuff added. # 1.1 -> Slight bugfix regarding local variables. #---------------------------------------------------------------------------- # This is a simple to add-on for the Emerald's Skill Trees script. It allows # tree skills to not only delete their previous level, but also a different # tree skill. # # NOTE that it only deletes a TREE SKILL if it has been learned previously! # If it's been learned afterwards, it will still get added, and this script # cannot delete regular skills! #---------------------------------------------------------------------------- # Again, this script requires EES. #============================================================================ module EME module SKILL_TREES #======================================================================== # Syntax is ["name of the skill object which deletes the other skill, # level at which the skill object deletes the other skill, # id of the other skill], <- comma only if it's not the last entry. # # The example deletes skill 50 as soon as you put a point in "example_object", # on the codition that it has been previously learned through skill strees # and has not been learned through any other method. #======================================================================== Forget_By_TK = [ #["example_object", 1, 50] ] end end class Scene_SkillTrees alias eme_est_learn_skill learn_skill def learn_skill eme_est_learn_skill object = @skill_tree.objects[@skill_tree.data[@skill_tree.index]] previous_level = [@actor.est_skill_level(object, @skill_tree.tree_id) - 2, 0].max EME::SKILL_TREES::Forget_By_TK.each{|array| @actor.forget_tree_skill(array[2]) if object == EME::SKILL_TREES::Objects[array[0]] and previous_level + 1 == array[1] and !@actor.est_learned_elswhere?(array[2], @skill_tree.tree_id) } end end