Advertisement
Dekita

Perfect equip requirements v1.0

Aug 29th, 2012
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.97 KB | None | 0 0
  1. #Dekita's=======================================================================
  2. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  3. #===============================================================================
  4. #                                                                          v1.0
  5. #                        ★ Perfect Equip Requirements™ ★
  6. #
  7. #===============================================================================
  8. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  9. #===============================================================================
  10. #
  11. # -- Last updated: 22/08/2o12
  12. #
  13. # -- Difficulty: Plug'n'play - (Easy)
  14. #
  15. # -- Customisation: N/A
  16. #
  17. # -- Requires: Dekita's - Perfect Stat Point Distribution System v1.5+
  18. #
  19. # -- Recommended: N/A
  20. #
  21. # -- Compatable:  RPG Maker VX Ace ONLY!
  22. #                
  23. #===============================================================================
  24. #===============================================================================
  25. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  26. #===============================================================================
  27.  
  28. #===============================================================================
  29. # ☆ Script Information:
  30. #=======================
  31. # A simple equipment requirements script, enter notetags into weapon/armor
  32. # noteboxes to make item unequippable unless requirements are met.
  33. #===============================================================================
  34.  
  35. #===============================================================================
  36. # ☆ TERMS OF USE:
  37. #===============================================================================
  38. #
  39. # 1. You must give credit to Dekita.
  40. #
  41. # 2. This script is for NON-Commercial use ONLY!*
  42. #
  43. # 3. You CANNOT give credit to yourself for Re-posting this script
  44. #    or Posting a modified version.*
  45. #
  46. # 4. Do not Re-Distribute this script.
  47. #
  48. # 5. You are NOT allowed to convert this script to any other engine,
  49. #    E.G converting it from RGSS3 into RGSS2.*
  50. #
  51. # 6. ENJOY!
  52. #
  53. #-------------------------------------------------------------------------------
  54. # * = Unless permissions are given by Dekita. < e-mail DekitaRPG@gmail.com
  55. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56. #===============================================================================
  57.  
  58. #===============================================================================
  59. # ☆ History:
  60. #============
  61. # D - M - Y
  62. # 22/08/2o12 - Started and finished.
  63. #===============================================================================
  64. # ☆ Credit and Thanks to :
  65. #==========================
  66. #Fomar0153 - for writing an equip requirements script and showing me how its done.
  67. #===============================================================================
  68.  
  69. #===============================================================================
  70. # ☆ Foresight Into The Future:
  71. #==============================
  72. # N/A
  73. #-------------------------------------------------------------------------------
  74. # If you have any ideas e-mail me at DekitaRPG@gmail.com
  75. #===============================================================================
  76.  
  77. #===============================================================================
  78. # ☆ Known Bugs:
  79. #=================
  80. # N/A
  81. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82. # If a new bug is found please e-mail me at DekitaRPG@gmail.com
  83. #===============================================================================
  84.  
  85. #===============================================================================
  86. # ☆ INSTRUCTIONS:
  87. #=================
  88. # Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  89. # Place this script UNDER "Dekita's - Perfect Stat Point Distribution System".
  90. #
  91. #===============================================================================
  92.  
  93. #===============================================================================
  94. # ☆ NoteTagz:
  95. #=============
  96. # <reqlvl: x>
  97. # <reqvit: x>
  98. # <reqstr: x>
  99. # <reqdex: x>
  100. # <reqmag: x>
  101. #
  102. # e.g
  103. # <reqvit: 5>
  104. # This would make the item unequippable untill the actor has 5 vit points.
  105. #===============================================================================
  106.  
  107. #===============================================================================
  108. # ☆ Import:
  109. #===========
  110. $imported = {} if $imported.nil?
  111. $imported["DPB-PEQUIP"] = true
  112. #
  113. #===============================================================================
  114.  
  115. #===============================================================================
  116. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  117. #===============================================================================
  118. #                                                                          
  119. #                         ★ Perfect Equip Requirements ★
  120. #                                ★ SCRIPT BEGIN ★
  121. #
  122. #===============================================================================
  123. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  124. #===============================================================================
  125.  
  126. class Game_BattlerBase
  127.   #--------------------------------------------------------------------------
  128.   # * Determine if Equippable
  129.   #--------------------------------------------------------------------------
  130.   alias dpbzequippable? equippable?
  131.   def equippable?(item)
  132.     return false unless item.is_a?(RPG::EquipItem)
  133.     return false if @level < item.lvlreq
  134.     return false if reqdpbzstat(0) < item.vitreq
  135.     return false if reqdpbzstat(1) < item.strreq
  136.     return false if reqdpbzstat(2) < item.dexreq
  137.     return false if reqdpbzstat(3) < item.magreq
  138.     return dpbzequippable?(item)
  139.   end
  140. #-------------------------------------------------------------------------------
  141.   def reqdpbzstat(id)
  142.     return dpbzparam(id)
  143.   end
  144.  
  145. end # class Game_BattlerBase
  146.  
  147. ################################################################################  
  148. module RPG
  149.   class EquipItem
  150.    
  151.     def lvlreq
  152.       if self.note =~ /<reqlvl: (.*)>/i
  153.         return $1.to_i
  154.       else
  155.         return 0
  156.       end
  157.     end
  158.    
  159.     def vitreq
  160.       if self.note =~ /<reqvit: (.*)>/i
  161.         return $1.to_i
  162.       else
  163.         return 0
  164.       end
  165.     end
  166.    
  167.     def strreq
  168.       if self.note =~ /<reqstr: (.*)>/i
  169.         return $1.to_i
  170.       else
  171.         return 0
  172.       end
  173.     end
  174.    
  175.     def dexreq
  176.       if self.note =~ /<reqdex: (.*)>/i
  177.         return $1.to_i
  178.       else
  179.         return 0
  180.       end
  181.     end
  182.    
  183.     def magreq
  184.       if self.note =~ /<reqmag: (.*)>/i
  185.         return $1.to_i
  186.       else
  187.         return 0
  188.       end
  189.     end
  190.    
  191.   end #class EquipItem
  192. end #module RPG
  193. #===============================================================================
  194. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  195. #===============================================================================
  196. #                                                                          
  197. #                         ★ Perfect Equip Requirements ★
  198. #                                 ★ SCRIPT END ★
  199. #
  200. #===============================================================================
  201. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  202. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement