[XP]Skill change on class change

Started by edmondedi, January 25, 2015, 06:32:40 am

Previous topic - Next topic

edmondedi

January 25, 2015, 06:32:40 am Last Edit: January 25, 2015, 07:12:23 am by edmondedi
Hi everyone!  :^_^':
I was thinking on a script that changes the skills when you change the class.  :)
For example with warrior on lvl 1 you have Cross Cut, and if you change the class to mage you won't have the crosscut anymore, you'll have the Fireball skil. I know this thing can be made with some simple remove and add skill common event, but I want to make more than 50 classes in my game so it would be very complicated if I do it like that  :wacko:. And also I use BlizzABS.  :P
I saw the Legacy Class Change script, but there's a few features what I don't like.
So if anyone can help me, i would really appreciate it.
Thank you.  :)

KK20

Every time you change the actor's class through eventing or by other means, it will remove all their known skills and replace them with the skills they SHOULD know at their current level as the new class.

class Game_Actor < Game_Battler
  alias reset_skills_for_class_change class_id=
  def class_id=(class_id)
    # Only apply the class change if the class exists
    unless $data_classes[class_id].nil?
      # Remove all learned skills
      @skills.clear
      # Change class
      @class_id = class_id
      # Learn skills
      for i in 1..@level
        for j in $data_classes[@class_id].learnings
          if j.level == i
            learn_skill(j.skill_id)
          end
        end
      end
      reset_skills_for_class_change(class_id)
    end
  end
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

edmondedi

January 27, 2015, 01:33:13 pm #2 Last Edit: February 09, 2015, 01:09:51 pm by edmondedi
Wow that was fast!  :^_^':
I didn't tought that the script is that easy  :O.o: (unfortunately i'm a noob in programming  :P ) , but thank you very much! It was really helpful and it works perfect.  :)  :clap:
Lv up!