Advertisement
Fomar0153

Fomar0153 - Stand Alone Blue Magic

Jan 10th, 2012
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.78 KB | None | 0 0
  1. =begin
  2. Stand Alone Blue Mages Script
  3. by Fomar0153
  4. Version 1.1
  5. ----------------------
  6. Notes
  7. ----------------------
  8. No requirements
  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 "BlueMages" to include all the id's of the party members
  15. who will be blue mages
  16. Set "BlueMagic" to include all the id's of Blue Magic skills
  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_Actor < Game_Battler
  27.  
  28.   # Edit to include the actor (character) id
  29.   BlueMages = [3]
  30.   # Edit to include all the skill ids of the skills you want your
  31.   # blue mages to learn
  32.   BlueMagic = [3, 4]
  33.  
  34.   #--------------------------------------------------------------------------
  35.   # ● Aliased make_damage_value
  36.   #--------------------------------------------------------------------------
  37.   alias bluemagic_make_damage_value make_damage_value
  38.   def make_damage_value(user, item)
  39.     bluemagic_make_damage_value(user, item)
  40.     if @result.hit? and item.class == RPG::Skill
  41.       if BlueMages.include?(@actor_id) and BlueMagic.include?(item.id)
  42.         i = @skills.size
  43.         learn_skill(item.id)
  44.         if !(i == @skills.size)
  45.           SceneManager.scene.add_text(actor.name + " learns " + item.name + ".")
  46.         end
  47.       end
  48.     end
  49.   end
  50. end
  51.  
  52. class Scene_Battle < Scene_Base
  53.   #--------------------------------------------------------------------------
  54.   # ● New method add_text
  55.   #--------------------------------------------------------------------------
  56.   def add_text(text)
  57.     @log_window.add_text(text)
  58.   end
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement