Advertisement
Dekita

prof 1.1

Mar 29th, 2014
1,714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.93 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Proficiency (skills)
  5. # -- Author : Dekita
  6. # -- Version : 1.1
  7. # -- Level : Easy
  8. # -- Requires : $D13x - Statistic Control
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Proficiency]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # o3/o3/2o14 - Bugfixx, (Damage Item Crashing Game)
  21. # 2o/o3/2o13 - Started && Finished,
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script simply allows the creation of "proficiency skills"
  27. # This means that you can create skills that increase the Damage you deal
  28. # when using a certain weapon, a skill with a certain element
  29. # or a skill with a certain type.
  30. # eg.
  31. # Axe Mastery Skill, increases Axe Weapon Damage by 0.10 (10%)
  32. # Sword Mastery Skill, increase sword damage by 0.50 (50%)
  33. # Fire Mastery Skill, increase all fire skill damage by 0.1365 (13.65%)
  34. # Magic Mastery Skill, increase all Magic Type Skills Damage...
  35. #
  36. # If using the $D13x - skill levels script, the "proficiency value"
  37. # that the skill has been given will be the base value,
  38. # multiplied by the skills level DMG Multi.
  39. #
  40. # These "Proficiency Skills" DO NOT effect Enemies.
  41. #
  42. #===============================================================================
  43. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  44. #===============================================================================
  45. # 1. You MUST give credit to "Dekita" !!
  46. # 2. You are NOT allowed to repost this script.(or modified versions)
  47. # 3. You are NOT allowed to convert this script.
  48. # 4. You are NOT allowed to use this script for Commercial games.
  49. # 5. ENJOY!
  50. #
  51. # "FINE PRINT"
  52. # By using this script you hereby agree to the above terms and conditions,
  53. # if any violation of the above terms occurs "legal action" may be taken.
  54. # Not understanding the above terms and conditions does NOT mean that
  55. # they do not apply to you.
  56. # If you wish to discuss the terms and conditions in further detail you can
  57. # contact me at http://dekitarpg.wordpress.com/
  58. #
  59. #===============================================================================
  60. # ☆ Instructions
  61. #-------------------------------------------------------------------------------
  62. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  63. # Place Below my " $D13x - Statistic Control " Script
  64. #
  65. #===============================================================================
  66. # ☆ Notetags ( default )
  67. # For Use in Skill Noteboxes.
  68. #-------------------------------------------------------------------------------
  69. # <wep prof: weapon_type_id, bonus_damage>
  70. # weapon_type_id = the id of the weapon type, eg 1 = Axe (default)
  71. # bonus_damage = the extra percentage of damage that will be dealt when
  72. # using a weapon that matches the weapon_type_id.
  73. #
  74. # <ele prof: element_id, bonus_damage>
  75. # element_id = the id of the element, eg 3 = Fire (default)
  76. # bonus_damage = the extra percentage of damage that will be dealt when
  77. # using a skill that matches the element_id
  78. #
  79. # <skl prof: skill_type_id, bonus_damage>
  80. # skill_type_id = the id of the skill type, eg 1 = Special (default)
  81. # bonus_damage = the extra percentage of damage that will be dealt when
  82. # using a skill that matches the skill_type_id.
  83. #
  84. # ALL the above notetags work with percentage values.
  85. # eg. 0.10 means 10% extra damage, 1.0 means 100% extra damage
  86. #
  87. #===============================================================================
  88. # ☆ Notes
  89. #-------------------------------------------------------------------------------
  90. # Skills Are Limited to 1 of each damage modifier,
  91. # if more than 1 notetag is used, it will use the one lowest down in the list.
  92. #
  93. #===============================================================================
  94. module Proficiency
  95. #===============================================================================
  96.  
  97. Notes = {
  98. :skill_t => /<skl prof:(.*),(.*)>/i, # Skill Type Notetag
  99. :element => /<ele prof:(.*),(.*)>/i, # Element Type Notetag
  100. :weapons => /<wep prof:(.*),(.*)>/i, # Weapon Type Notetag
  101. } # << Keep
  102. #####################
  103. # CUSTOMISATION END #
  104. end #####################
  105. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  106. # #
  107. # http://dekitarpg.wordpress.com/ #
  108. # #
  109. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  110. # you light up another cigarette and i pour the wine..... #
  111. # its 4 o'clock in the morning and it's starting to get ligghtttttt.... #
  112. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  113. #===============================================================================
  114. class RPG::Skill < RPG::UsableItem
  115. #===============================================================================
  116. #---------------------------------------------------------------------------
  117. # Alias List
  118. #---------------------------------------------------------------------------
  119. alias :deki_weap_prof :load_stat_control
  120. #---------------------------------------------------------------------------
  121. # Pi Variables
  122. #---------------------------------------------------------------------------
  123. attr_accessor :weap_prof
  124. attr_accessor :elem_prof
  125. attr_accessor :styp_prof
  126. #---------------------------------------------------------------------------
  127. # Load Stat Control
  128. #---------------------------------------------------------------------------
  129. def load_stat_control
  130. deki_weap_prof
  131. @weap_prof = [nil, 0.0]
  132. @elem_prof = [nil, 0.0]
  133. @styp_prof = [nil, 0.0]
  134. self.note.split(/[\r\n]+/).each do |line|
  135. case line
  136. when Proficiency::Notes[:weapons] then @weap_prof = [$1.to_i, $2.to_f]
  137. when Proficiency::Notes[:element] then @elem_prof = [$1.to_i, $2.to_f]
  138. when Proficiency::Notes[:skill_t] then @styp_prof = [$1.to_i, $2.to_f]
  139. end
  140. end
  141. end
  142.  
  143. end
  144.  
  145. #===============================================================================
  146. class Game_Battler < Game_BattlerBase
  147. #===============================================================================
  148. #--------------------------------------------------------------------------
  149. # Alias List
  150. #--------------------------------------------------------------------------
  151. alias :_MDV__profic :make_damage_value
  152. alias :_APV__profic :apply_variance
  153. #--------------------------------------------------------------------------
  154. # M.D.V
  155. #--------------------------------------------------------------------------
  156. def make_damage_value(user, item)
  157. @wep_prof_user = user
  158. @wep_prof_item = item
  159. _MDV__profic(user, item)
  160. end
  161. #--------------------------------------------------------------------------
  162. # Apply Variance Mod
  163. #--------------------------------------------------------------------------
  164. def apply_variance(damage, variance)
  165. usar = @wep_prof_user
  166. itum = @wep_prof_item
  167. neww = _APV__profic(damage, variance)
  168. neww *= apply_skill_t_profic(itum,usar)
  169. p "DMG After Skill Profic [:type] = #{neww.to_i}"
  170. neww *= apply_element_profic(itum,usar)
  171. p "DMG After Skill Profic [:elem] = #{neww.to_i}"
  172. neww *= apply_weapon_profic(itum,usar)
  173. p "DMG After Skill Profic [:weap] = #{neww.to_i}"
  174. neww
  175. end
  176. #--------------------------------------------------------------------------
  177. # Apply Skill_Type Proficiency Mod
  178. #--------------------------------------------------------------------------
  179. def apply_skill_t_profic(item,user)
  180. return 1.0 unless user.is_a?(Game_Actor)
  181. return 1.0 unless item.is_a?(RPG::Skill)
  182. prof = 1.0
  183. user.skills.each do |skill|
  184. next unless skill != nil
  185. next unless skill.styp_prof[0] != 0
  186. next unless item.stype_id == skill.styp_prof[0]
  187. if $D13x[:Skill_Lv]
  188. mult = Skill_Levels::Exp_Set[skill.exp_set][user.skills_lv(skill.id)][2]
  189. prof += (skill.styp_prof[1] * mult)
  190. else
  191. prof += skill.styp_prof[1]
  192. end
  193. end
  194. return prof
  195. end
  196. #--------------------------------------------------------------------------
  197. # Apply Element Proficiency Mod
  198. #--------------------------------------------------------------------------
  199. def apply_element_profic(item,user)
  200. return 1.0 unless user.is_a?(Game_Actor)
  201. prof = 1.0
  202. user.skills.each do |skill|
  203. next unless skill != nil
  204. next unless skill.elem_prof[0] != 0
  205. next unless item.damage.element_id == skill.elem_prof[0]
  206. if $D13x[:Skill_Lv]
  207. mult = Skill_Levels::Exp_Set[skill.exp_set][user.skills_lv(skill.id)][2]
  208. prof += (skill.elem_prof[1] * mult)
  209. else
  210. prof += skill.elem_prof[1]
  211. end
  212. end
  213. return prof
  214. end
  215. #--------------------------------------------------------------------------
  216. # Apply Weapon Proficiency Mod
  217. #--------------------------------------------------------------------------
  218. def apply_weapon_profic(item,user)
  219. return 1.0 unless user.is_a?(Game_Actor)
  220. return 1.0 unless item.is_a?(RPG::Skill)
  221. prof = 1.0
  222. user.skills.each do |skill|
  223. next unless skill != nil
  224. next unless skill.weap_prof[0] != 0
  225. user.weapons.each do |wep|
  226. next unless wep != nil
  227. next unless skill.weap_prof[0] == wep.wtype_id
  228. if $D13x[:Skill_Lv]
  229. mult = Skill_Levels::Exp_Set[skill.exp_set][user.skills_lv(skill.id)][2]
  230. prof += (skill.weap_prof[1] * mult)
  231. else
  232. prof += skill.weap_prof[1]
  233. end
  234. end
  235. end
  236. return prof
  237. end
  238.  
  239. end
  240.  
  241. #==============================================================================#
  242. # http://dekitarpg.wordpress.com/ #
  243. #==============================================================================#
  244. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement