Advertisement
Dekita

$D13x Prof Skills 1.0

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