Fomar0153

Fomar0153 - Blue Mage Class

Jan 10th, 2012
483
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. =begin
  2. Blue Mage Class Script
  3. by Fomar0153
  4. Version 1.1
  5. ----------------------
  6. Notes
  7. ----------------------
  8. Requires the "Unique Classes Script"
  9. Allows party members to learn skills by being hit by them.
  10. Commonly described as Blue Magic or Enemy Skills
  11. ----------------------
  12. Instructions
  13. ----------------------
  14. Set "BlueMagic" to include all the id's of Blue Magic skills
  15. Follow the instructions in the Unique Classes Script
  16.  
  17. ----------------------
  18. Changle Log
  19. ----------------------
  20. 1.0 -> 1.1 : Added notification when learning a new Skill
  21. ----------------------
  22. Known bugs
  23. ----------------------
  24. None
  25. =end
  26. class Game_BlueMage < Game_Actor
  27.  
  28.   # Edit to include all the skill ids of the skills you want your
  29.   # blue mages to learn
  30.   BlueMagic = [3, 4]
  31.  
  32.   #--------------------------------------------------------------------------
  33.   # ● Aliased make_damage_value
  34.   #--------------------------------------------------------------------------
  35.   alias bluemagic_make_damage_value make_damage_value
  36.   def make_damage_value(user, item)
  37.     bluemagic_make_damage_value(user, item)
  38.     if @result.hit? and item.class == RPG::Skill
  39.       if BlueMagic.include?(item.id)
  40.         i = @skills.size
  41.         learn_skill(item.id)
  42.         if !(i == @skills.size)
  43.           SceneManager.scene.add_text(actor.name + " learns " + item.name + ".")
  44.         end
  45.       end
  46.     end
  47.   end
  48. end
  49.  
  50. class Scene_Battle < Scene_Base
  51.   #--------------------------------------------------------------------------
  52.   # ● New method add_text
  53.   #--------------------------------------------------------------------------
  54.   def add_text(text)
  55.     @log_window.add_text(text)
  56.   end
  57. end
RAW Paste Data