Guest User

Untitled

a guest
Mar 9th, 2019
15
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # Multi-Hit by Blizzard
  3. # Version: 1.51b
  4. # Type: Weapon/Skill/Enemy Enhancement
  5. # Date: 12.8.2007
  6. # Date 1.3b: 23.2.2008
  7. # Date 1.4b: 23.7.2008
  8. # Date 1.5b: 19.10.2008
  9. # Date 1.51b: 6.10.2009
  10. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  11. #
  12. # Compatibility:
  13. #
  14. # 95% compatible with SDK 1.x. 70% compatible with SDK 2.x. Might be
  15. # incompatible with exotic skills and/or CBS-es. Compatible with CRLS 5.1b or
  16. # higher.
  17. #
  18. #
  19. # Explanation:
  20. #
  21. # This add-on will allow that skills, weapons and enemies attack more than
  22. # once.
  23. #
  24. # new in v1.3b:
  25. # - now you can define weapons/skills/enemies which's other attacks will
  26. # target a random target instead of the originally chosen target
  27. # - now beta
  28. #
  29. # new in v1.4b:
  30. # - better compatibility with SP Cost Mod
  31. # - improved coding
  32. #
  33. # new in v1.5b:
  34. # - added Multi-Hit items
  35. #
  36. #
  37. # Configuration:
  38. #
  39. # Set up the following constants to configure the script:
  40. #
  41. # WEAPON_RANDOM - add any weapon IDs here and separate them with commas to
  42. # make those specific weapons attack another random target
  43. # for each other hit than the first
  44. # SKILL_RANDOM - add any skill IDs here and separate them with commas to
  45. # make those specific skills attack another random target
  46. # for each other hit than the first
  47. # ITEM_RANDOM - add any item IDs here and separate them with commas to
  48. # make those specific items attack another random target
  49. # for each other hit than the first
  50. # ENEMY_RANDOM - add any enemy IDs here and separate them with commas to
  51. # make those specific enemies attack another random target
  52. # for each other hit than the first
  53. #
  54. # Further there are 4 configurations. Configuration 1 is for weapons,
  55. # Configuration 2 is for skills, Configuration 3 is for items and
  56. # Configuration 3 is for normal enemy attacks. Use following template to set
  57. # up how many hits should be done:
  58. #
  59. # when ID then return HITS
  60. #
  61. # ID - ID of weapon, skill, item or enemy, depending on the configuration
  62. # number
  63. # HITS - number of hits
  64. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  65.  
  66. #==============================================================================
  67. # module BlizzCFG
  68. #==============================================================================
  69.  
  70. module BlizzCFG
  71.  
  72. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  73. # START Basic Configuration
  74. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  75. WEAPON_RANDOM = []
  76. SKILL_RANDOM = []
  77. ITEM_RANDOM = []
  78. ENEMY_RANDOM = []
  79. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  80. # END Basic Configuration
  81. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  82.  
  83. def self.weapon_hits(id)
  84. case id
  85. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  86. # START Configuration 1
  87. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  88. when 38 then return 2
  89. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  90. # END Configuration 1
  91. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  92. end
  93. return 1
  94. end
  95.  
  96. def self.skill_hits(id)
  97. case id
  98. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  99. # START Configuration 2
  100. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  101. when 151 then return 2
  102. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  103. # END Configuration 2
  104. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  105. end
  106. return 1
  107. end
  108.  
  109. def self.item_hits(id)
  110. case id
  111. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  112. # START Configuration 3
  113. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  114. when 88 then return 2
  115. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  116. # END Configuration 3
  117. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  118. end
  119. return 1
  120. end
  121.  
  122. def self.enemy_hits(id)
  123. case id
  124. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  125. # START Configuration 4
  126. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  127. when 1 then return 2
  128. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  129. # END Configuration 4
  130. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  131. end
  132. return 1
  133. end
  134.  
  135. end
  136.  
  137. #==============================================================================
  138. # Scene_Battle
  139. #==============================================================================
  140.  
  141. class Scene_Battle
  142.  
  143. alias update_phase4_step1_multi_hit_later update_phase4_step1
  144. def update_phase4_step1(battler = nil)
  145. if battler != nil
  146. update_phase4_step1_multi_hit_later(battler)
  147. return
  148. end
  149. update_phase4_step1_multi_hit_later
  150. @repeat = [1, 1, 0]
  151. return unless @active_battler != nil
  152. if @active_battler.current_action.kind == 0
  153. if @active_battler.current_action.basic == 0
  154. if @active_battler.is_a?(Game_Actor)
  155. hits = BlizzCFG.weapon_hits(@active_battler.weapon_id)
  156. elsif @active_battler.is_a?(Game_Enemy)
  157. hits = BlizzCFG.enemy_hits(@active_battler.id)
  158. end
  159. @repeat = [hits, hits, 2]
  160. end
  161. elsif @active_battler.current_action.kind == 1
  162. @repeat[2] = 3
  163. elsif @active_battler.current_action.kind == 2
  164. @repeat[2] = 4
  165. end
  166. end
  167.  
  168. alias update_phase4_step2_multi_hit_later update_phase4_step2
  169. def update_phase4_step2(battler = nil)
  170. if battler != nil
  171. update_phase4_step2_multi_hit_later(battler)
  172. return
  173. end
  174. update_phase4_step2_multi_hit_later
  175. if @phase4_step != 1
  176. if @repeat[2] == 3
  177. hits = BlizzCFG.skill_hits(@skill.id)
  178. @repeat = [hits, hits+1, 4]
  179. elsif @repeat[2] == 4
  180. hits = BlizzCFG.item_hits(@item.id)
  181. @repeat = [hits, hits+1, 4]
  182. end
  183. end
  184. end
  185.  
  186. alias update_phase4_step5_multi_hit_later update_phase4_step5
  187. def update_phase4_step5(battler = nil)
  188. if battler != nil
  189. update_phase4_step5_multi_hit_later(battler)
  190. return
  191. end
  192. update_phase4_step5_multi_hit_later
  193.  
  194. if @active_battler.current_action.kind == 1
  195. if BlizzCFG::SKILL_RANDOM.include?(@skill.id)
  196. if @active_battler.is_a?(Game_Actor)
  197. @active_battler.current_action.decide_random_target_for_actor
  198. elsif @active_battler.is_a?(Game_Enemy)
  199. @active_battler.current_action.decide_random_target_for_enemy
  200. end
  201. end
  202. elsif @active_battler.current_action.kind == 2
  203. if BlizzCFG::ITEM_RANDOM.include?(@item.id)
  204. if @active_battler.is_a?(Game_Actor)
  205. @active_battler.current_action.decide_random_target_for_actor
  206. elsif @active_battler.is_a?(Game_Enemy)
  207. @active_battler.current_action.decide_random_target_for_enemy
  208. end
  209. end
  210. elsif @active_battler.is_a?(Game_Actor)
  211. if BlizzCFG::WEAPON_RANDOM.include?(@active_battler.weapon_id)
  212. @active_battler.current_action.decide_random_target_for_actor
  213. end
  214. elsif @active_battler.is_a?(Game_Enemy)
  215. if BlizzCFG::ENEMY_RANDOM.include?(@active_battler.id)
  216. @active_battler.current_action.decide_random_target_for_enemy
  217. end
  218. end
  219. @phase4_step = 2 if @repeat[0] > 1 && @repeat[2] > 0
  220. @repeat[0] -= 1
  221.  
  222. end
  223.  
  224. alias make_skill_action_result_multi_hit_later make_skill_action_result
  225. def make_skill_action_result(battler = nil, plus_id = nil)
  226. if battler != nil
  227. if plus_id != nil
  228. make_skill_action_result_multi_hit_later(battler, plus_id)
  229. else
  230. make_skill_action_result_multi_hit_later(battler)
  231. end
  232. return
  233. end
  234. make_skill_action_result_multi_hit_later
  235. @help_window.visible = false if (@repeat[1] - @repeat[0]) > 1
  236. if @repeat[2] > 3
  237. sp_cost = @skill.sp_cost
  238. #----- you can remove these 3 lines if you want----
  239. if $game_system.SP_COST_MOD
  240. sp_cost = BlizzCFG.get_cost_mod(@active_battler.states, sp_cost)
  241. end
  242. #--------------------------------------------------
  243. @active_battler.sp += sp_cost
  244. @status_window.refresh
  245. end
  246. end
  247.  
  248. end
RAW Paste Data