Advertisement
roninator2

Vlue Set Guard/Attack Skills v1.3 mod

Dec 4th, 2024
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.10 KB | None | 0 0
  1. #Set Guard/Attack Skills v1.3.2
  2. #----------#
  3. #Features: Let's you set different attack/guard actions for individual actors
  4. #
  5. #Usage:    Placed in note tags of actors, weapons, armors, classes:
  6. #          <Attack_Id skill_id level> - changes default attack if level matches
  7. #          <Guard_Id skill_id level>  - changes default guard if level matchs
  8. #
  9. #           e.g. <guard_id 44 15>
  10. #           guard skill is quick move at level 15
  11. #
  12. #          Weapons/Armors overrides Classes overides Actors.
  13. #          Levels must be in a low to high order
  14. #           e.g. <guard_id 44 10>
  15. #           e.g. <guard_id 49 15>
  16. #          
  17. # addon by Roninator2
  18. #----------#
  19. #-- Script by: V.M of D.T
  20. class Game_Actor
  21.   def guard_skill_id
  22.     @equips.each do |item|
  23.       next unless item.object
  24.     iidg = item.object.note.upcase =~ /<GUARD_ID (\d+)>/i ? $1.to_i : 2
  25.     item.object.note.upcase.each_line { |line|
  26.       if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  27.         if @level >= $2.to_i
  28.           iidg = $1.to_i
  29.         end
  30.       end
  31.      }
  32.     return iidg if item.object.note.upcase =~ /<GUARD_ID (\d+)>/i
  33.     return iidg if item.object.note.upcase =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  34.     end
  35.  
  36.     cidg = self.class.note.upcase =~ /<GUARD_ID (\d+)>/ ? $1.to_i : 2
  37.     self.class.note.upcase.each_line { |line|
  38.       if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  39.         if @level >= $2.to_i
  40.           cidg = $1.to_i
  41.         end
  42.       end
  43.      }
  44.     return cidg if self.class.note.upcase =~ /<GUARD_ID (\d+)>/i
  45.     return cidg if self.class.note.upcase =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  46.    
  47.     idg = actor.note.upcase =~ /<GUARD_ID (\d+)>/i ? $1.to_i : 2
  48.     actor.note.upcase.each_line { |line|
  49.       if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  50.         if @level >= $2.to_i
  51.           idg = $1.to_i
  52.         end
  53.       end
  54.      }
  55.     return idg
  56.   end
  57.  
  58.   def attack_skill_id
  59.     @equips.each do |item|
  60.       next unless item.object
  61.       iida = item.object.note.upcase =~ /<ATTACK_ID (\d+)>/i ? $1.to_i : 1
  62.       item.object.note.upcase.each_line { |line|
  63.         if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  64.           if @level >= $2.to_i
  65.             iida = $1.to_i
  66.           end
  67.         end
  68.        }
  69.       return iida if item.object.note.upcase =~ /<ATTACK_ID (\d+)>/i
  70.       return iida if item.object.note.upcase =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  71.     end
  72.    
  73.     cida = self.class.note.upcase =~ /<ATTACK_ID (\d+)>/i ? $1.to_i : 1
  74.     self.class.note.upcase.each_line { |line|
  75.       if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  76.         if @level >= $2.to_i
  77.           cida = $1.to_i
  78.         end
  79.       end
  80.      }
  81.     return cida if self.class.note.upcase =~ /<ATTACK_ID (\d+)>/i
  82.     return cida if self.class.note.upcase =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  83.    
  84.     ida = actor.note.upcase =~ /<ATTACK_ID (\d+)>/i ? $1.to_i : 1
  85.     actor.note.upcase.each_line { |line|
  86.       if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
  87.         if @level >= $2.to_i
  88.           ida = $1.to_i
  89.         end
  90.       end
  91.      }
  92.     return ida
  93.   end
  94. end
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement