Advertisement
thiago_d_d

Cancel Skill

Jan 16th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.37 KB | None | 0 0
  1. #==============================================================
  2. # http://thiagodd.blogspot.com.br
  3. # [TSDA] Cancel Skill
  4. #   --> Version 1.0
  5. # by thiago_d_d
  6. #
  7. #--------------------------------------------------------------
  8. # * Features
  9. #--------------------------------------------------------------
  10. # + With this script, some skills of your choice can be
  11. #   canceled if the target has more inteligence than the user.
  12. #
  13. #--------------------------------------------------------------
  14. # * Install
  15. #--------------------------------------------------------------
  16. # Put this script above Main
  17. #
  18. #--------------------------------------------------------------
  19. # * Configuration
  20. #--------------------------------------------------------------
  21. # Specify the skills IDs below. Put only skills that can
  22. # be canceled.
  23. #==============================================================
  24. module TSDA
  25.   CANCEL_IDS=[7,6,8]
  26. end
  27. #--------------------------------------------------------------
  28. class Game_Battler
  29.   alias old_skill_effect_th skill_effect
  30.   def skill_effect(user,skill)
  31.     if TSDA::CANCEL_IDS.include?(skill.id)
  32.       if user.int < self.int
  33.         rate = user.int.to_f / self.int.to_f
  34.         r = rand(nil)
  35.         if rate <= r
  36.           self.damage = "Cancelado!"
  37.           return true
  38.         end
  39.       end
  40.     end
  41.     old_skill_effect_th(user,skill)
  42.   end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement