LiTTleDRAgo

[RGSS] Tons of Addons Part 3 (edited)

Sep 24th, 2013
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 84.23 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # Tons of Add-ons by Blizzard
  3. # Version: 7.65b
  4. # Type: Add-on Collection Control Script
  5. # Date v7.65b:  11.04.2013
  6. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  7. #
  8. #                                    PART 3
  9. #
  10. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  11. #  
  12. #  This work is protected by the following license:
  13. # #----------------------------------------------------------------------------
  14. # #  
  15. # #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
  16. # #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
  17. # #  
  18. # #  You are free:
  19. # #  
  20. # #  to Share - to copy, distribute and transmit the work
  21. # #  to Remix - to adapt the work
  22. # #  
  23. # #  Under the following conditions:
  24. # #  
  25. # #  Attribution. You must attribute the work in the manner specified by the
  26. # #  author or licensor (but not in any way that suggests that they endorse you
  27. # #  or your use of the work).
  28. # #  
  29. # #  Noncommercial. You may not use this work for commercial purposes.
  30. # #  
  31. # #  Share alike. If you alter, transform, or build upon this work, you may
  32. # #  distribute the resulting work only under the same or similar license to
  33. # #  this one.
  34. # #  
  35. # #  - For any reuse or distribution, you must make clear to others the license
  36. # #    terms of this work. The best way to do this is with a link to this web
  37. # #    page.
  38. # #  
  39. # #  - Any of the above conditions can be waived if you get permission from the
  40. # #    copyright holder.
  41. # #  
  42. # #  - Nothing in this license impairs or restricts the author's moral rights.
  43. # #  
  44. # #----------------------------------------------------------------------------
  45. #
  46. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  47. #
  48. # VERY IMPORTANT NOTE:
  49. #
  50. #   Tons of Add-ons now has to be used as 3-parts script because of a weird
  51. #   behaviour of RMXP during bug detection. Insert the 3 parts in the correct
  52. #   order and the system should work without problems. Do NOT remove any of the
  53. #   parts, the script NEEDS all 3 parts to work with other systems.
  54. #
  55. #
  56. # If you find any bugs, please report them here:
  57. # http://forum.chaos-project.com
  58. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  59.  
  60. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  61. #                                                                             #
  62. #   ###   ###  #   # #####  #   #### #   # ####   ###  #####  #   ###  #   #  #
  63. #  #   # #   # ##  # #      #  #     #   # #   # #   #   #    #  #   # ##  #  #
  64. #  #     #   # # # # ####   #  #  ## #   # ####  #   #   #    #  #   # # # #  #
  65. #  #   # #   # #  ## #      #  #   # #   # #   # #####   #    #  #   # #  ##  #
  66. #   ###   ###  #   # #      #   ####  ###  #   # #   #   #    #   ###  #   #  #
  67. #                                                                             #
  68. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  69.  
  70. #==============================================================================
  71. # Game_System
  72. #==============================================================================
  73.  
  74. class Game_System
  75.  
  76.   alias init_tons_of_addons3_later initialize_tons_of_addons
  77.   def initialize_tons_of_addons
  78.     init_tons_of_addons3_later
  79. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  80. # START Configuration 3-2, STATUS EFFECT and SKILL add-ons
  81. #
  82. #   You can enable/disable any add-on here if you wish. Set the value to false
  83. #   to disable it initially. To turn it on/off ingame, just use the Call script
  84. #   command with one of these syntaxes:
  85. #
  86. #     $game_system.NAME_OF_THE_ADDON = true
  87. #     $game_system.NAME_OF_THE_ADDON = false
  88. #
  89. #   where NAME_OF_THE_ADDON is the same variable as the one used below.
  90. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  91.     # the STATUS EFFECT add-ons
  92.     @ZOMBIE_STATUS       = false
  93.     @REGEN_STATUS        = false
  94.     @AUTO_REVIVE         = false
  95.     @FURY_STATUS         = false
  96.     @INVINCIBLE_STATUS   = false
  97.     @SP_COST_MOD         = false
  98.     @FROZEN              = false
  99.     @BLUE_MAGIC_STATUS   = false
  100.     @DOOM_STATUS         = false
  101.     # the SKILL add-ons
  102.     @ABSORB_HP_SP        = false
  103.     @STATE_BREAKER       = false
  104.     @BLUE_MAGIC_SKILL    = false
  105.     @DEMI_SKILL          = false
  106.     @REVENGE_SKILL       = false
  107.     @DESTRUCTOR_SKILL    = false
  108.     @SP_DAMAGE_SKILL     = false
  109.     @CHARGE_SKILL        = false
  110.     @ENERGY_SKILL        = false
  111.     @MASTER_THIEF        = false
  112.     @HP_SKILL            = false
  113.     # the ITEM add-ons
  114.     @SKILL_TEACHING_ITEM = false
  115.     @LEVEL_UPDOWN_ITEM   = false
  116. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  117. # END Configuration 3-2
  118. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  119.   end
  120.  
  121. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  122. # I suggest you don't edit anything below this line except for the
  123. # configurations for the add-ons.
  124. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  125.  
  126.   attr_accessor :ZOMBIE_STATUS
  127.   attr_accessor :REGEN_STATUS
  128.   attr_accessor :AUTO_REVIVE
  129.   attr_accessor :FURY_STATUS
  130.   attr_accessor :INVINCIBLE_STATUS
  131.   attr_accessor :SP_COST_MOD
  132.   attr_accessor :FROZEN
  133.   attr_accessor :BLUE_MAGIC_STATUS
  134.   attr_accessor :DOOM_STATUS
  135.  
  136.   attr_accessor :ABSORB_HP_SP
  137.   attr_accessor :STATE_BREAKER
  138.   attr_accessor :BLUE_MAGIC_SKILL
  139.   attr_accessor :DEMI_SKILL
  140.   attr_accessor :REVENGE_SKILL
  141.   attr_accessor :DESTRUCTOR_SKILL
  142.   attr_accessor :SP_DAMAGE_SKILL
  143.   attr_accessor :CHARGE_SKILL
  144.   attr_accessor :ENERGY_SKILL
  145.   attr_accessor :MASTER_THIEF
  146.   attr_accessor :HP_SKILL
  147.  
  148.   attr_accessor :SKILL_TEACHING_ITEM
  149.   attr_accessor :LEVEL_UPDOWN_ITEM
  150.  
  151. end
  152.  
  153. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  154. #                                                                             #
  155. #  ##### #####  ###  ##### #   # #####    ##### ##### ##### #####  ###  ##### #
  156. #  #       #   #   #   #   #   # #        #     #     #     #     #   #   #   #
  157. #  #####   #   #   #   #   #   # #####    ####  ####  ####  ####  #       #   #
  158. #      #   #   #####   #   #   #     #    #     #     #     #     #   #   #   #
  159. #  #####   #   #   #   #    ###  #####    ##### #     #     #####  ###    #   #
  160. #                                                                             #
  161. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  162.  
  163. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  164. # Zombie Status Effect by Blizzard
  165. # Version: 1.3b
  166. # Type: Game Experience Improvement
  167. # Date: 26.9.2006
  168. # Date v1.1b: 18.3.2007
  169. # Date v1.2b: 13.11.2007
  170. # Date v1.3b: 19.10.2008
  171. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  172. #
  173. # new in v1.1b:
  174. #   - working itself without you needing to do anything except the
  175. #     configuration
  176. #   - actual code
  177. #   - works with attacks and items now as well
  178. #
  179. # new in v1.2b:
  180. #   - improved coding
  181. #   - now possible to have more than one zombie status
  182. #
  183. # new in v1.3b:
  184. #   - improved coding
  185. #   - fixed possible problems
  186. #
  187. #
  188. # Configuration:
  189. #
  190. #   ZOMBIE_IDS       - the IDs of the Zombie status effects
  191. #   LIGHT_ELEMENT_ID - the ID of the light element
  192. #   ZOMBIE_POWER     - how much stronger should light attacks be
  193. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  194.  
  195. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  196. # START Configuration
  197. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  198.  
  199. ZOMBIE_IDS = [19]
  200. LIGHT_ELEMENT_ID = 7
  201. ZOMBIE_POWER = 1.5
  202.  
  203. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  204. # END Configuration
  205. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  206.  
  207. #==============================================================================
  208. # Game_Battler
  209. #==============================================================================
  210.  
  211. class Game_Battler
  212.  
  213.   alias attack_effect_zombie_later attack_effect
  214.   def attack_effect(attacker)
  215.     last_hp = self.hp
  216.     last_sr = (($crls && self.is_a?(Game_Actor)) ? self.sr : nil)
  217.     result = attack_effect_zombie_later(attacker)
  218.     zombie_effect(last_hp, last_sr, attacker) if self.damage.is_a?(Numeric)
  219.     return result
  220.   end
  221.  
  222.   alias skill_effect_zombie_later skill_effect
  223.   def skill_effect(user, skill)
  224.     last_hp = self.hp
  225.     last_sr = (($crls && self.is_a?(Game_Actor)) ? self.sr : nil)
  226.     result = skill_effect_zombie_later(user, skill)
  227.     zombie_effect(last_hp, last_sr, skill) if self.damage.is_a?(Numeric)
  228.     return result
  229.   end
  230.  
  231.   alias item_effect_zombie_later item_effect
  232.   def item_effect(item, battler = nil)
  233.     if $game_system.ACTOR_ITEMS && self.is_a?(Game_Actor)
  234.       return false if !FTSConfigs.item_can_consume?(self.id, item.id)
  235.     end
  236.     last_hp = self.hp
  237.     last_sr = (($crls && self.is_a?(Game_Actor)) ? self.sr : nil)
  238.     if battler == nil
  239.       result = item_effect_zombie_later(item)
  240.     else
  241.       result = item_effect_zombie_later(item, battler)
  242.     end
  243.     zombie_effect(last_hp, last_sr, item) if self.damage.is_a?(Numeric)
  244.     return result
  245.   end
  246.  
  247.   def zombie_effect(last_hp, last_sr, object)
  248.     if $game_system.ZOMBIE_STATUS && ZOMBIE_IDS.any? {|i| @states.include?(i)}
  249.       self.hp = last_hp
  250.       self.hp = self.hp
  251.       self.sr = last_sr if last_sr != nil
  252.       if self.damage.is_a?(Numeric) && self.damage < 0
  253.         self.damage = -self.damage
  254.       end
  255.       if object.element_set.include?(LIGHT_ELEMENT_ID)
  256.         self.damage = (self.damage * ZOMBIE_POWER).to_i
  257.       end
  258.       self.hp -= self.damage
  259.     end
  260.   end
  261.  
  262. end
  263.  
  264. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  265. # Regen Status Effect by Blizzard
  266. # Version: 2.0b
  267. # Type: Game Experience Improvement
  268. # Date: 4.5.2006
  269. # Date v1.1b: 12.1.2007
  270. # Date v2.0: 22.10.2007
  271. # Date v2.0b: 13.11.2007
  272. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  273. #
  274. # new in v1.1b:
  275. #   - fixed glitches, improved code and made it possible to have Regen and
  276. #     Poison at the same time (they nullificate each other on the map, but not
  277. #     in battle)
  278. #
  279. # new in v2.0:
  280. #   - overworked system
  281. #   - added SP Regen effect
  282. #   - added SP Poison effect
  283. #  
  284. # new in v2.0b:
  285. #   - fixed eventual bugs
  286. #   - now possible to have more than one Regen status effect
  287. #   - now beta
  288. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  289.  
  290. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  291. # START Configuration
  292. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  293.  
  294. HP_REGEN_IDS = [18] # add any status effect IDs that will be HP Regen
  295. SP_REGEN_IDS = [19] # add any status effect IDs that will be SP Regen
  296. SP_POISON_IDS = [20] # add any status effect IDs that will be SP Poison
  297.  
  298. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  299. # END Configuration
  300. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  301.  
  302. #==============================================================================
  303. # Game_Party
  304. #==============================================================================
  305.  
  306. class Game_Party
  307.  
  308.   alias check_map_slip_damage_regen_later check_map_slip_damage
  309.   def check_map_slip_damage
  310.     check_map_slip_damage_regen_later
  311.     if $game_system.REGEN_STATUS
  312.       @actors.each {|actor|
  313.           if actor.hp > 0
  314.             if HP_REGEN_IDS.any? {|i| actor.states.include?(i)}
  315.               actor.hp += [actor.maxhp / 100, 1].max
  316.             end
  317.             if SP_REGEN_IDS.any? {|i| actor.states.include?(i)}
  318.               actor.sp += [actor.maxsp / 100, 1].max
  319.             end
  320.             if SP_POISON_IDS.any? {|i| actor.states.include?(i)}
  321.               actor.sp -= [actor.maxsp / 100, 0].max
  322.             end
  323.           end}
  324.     end
  325.   end
  326.  
  327. end
  328.  
  329. #==============================================================================
  330. # Game_Battler
  331. #==============================================================================
  332.  
  333. class Game_Battler
  334.  
  335.   alias slip_damage_regen_later? slip_damage?
  336.   def slip_damage?
  337.     if $game_system.REGEN_STATUS && !$scene.is_a?(Scene_Map) &&
  338.         (HP_REGEN_IDS + SP_REGEN_IDS + SP_POISON_IDS).any? {|i| @states.include?(i)}
  339.       return true
  340.     end
  341.     return slip_damage_regen_later?
  342.   end
  343.  
  344.   alias slip_damage_effect_regen_later slip_damage_effect
  345.   def slip_damage_effect
  346.     if $game_system.REGEN_STATUS
  347.       if !(HP_REGEN_IDS.any? {|i| @states.include?(i)}) &&
  348.           slip_damage_regen_later?
  349.         slip_damage_effect_regen_later
  350.       elsif (HP_REGEN_IDS.any? {|i| @states.include?(i)}) &&
  351.           !slip_damage_regen_later?
  352.         dam = -self.maxhp / 10
  353.         if dam.abs > 0
  354.           amp = [dam.abs * 15 / 100, 1].max
  355.           dam -= rand(amp+1) + rand(amp+1) - amp
  356.         end
  357.         self.hp -= dam
  358.         self.damage = 0 if self.damage == nil
  359.         self.damage += dam
  360.       end
  361.       if (SP_REGEN_IDS.any? {|i| @states.include?(i)}) !=
  362.           (SP_POISON_IDS.any? {|i| @states.include?(i)})
  363.         dam = self.maxsp / 10
  364.         if dam > 0
  365.           amp = [dam * 15 / 100, 1].max
  366.           dam += rand(amp+1) + rand(amp+1) + amp
  367.         end
  368.         dam = -dam if SP_REGEN_IDS.any? {|i| @states.include?(i)}
  369.         self.sp -= dam
  370.         self.damage = 0 if self.damage == nil
  371.         self.damage += dam
  372.       end
  373.     else
  374.       slip_damage_effect_regen_later
  375.     end
  376.   end
  377.  
  378. end
  379.  
  380. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  381. # Auto-Revive Status Effect by Blizzard
  382. # Version: 1.25b
  383. # Type: Game Experience Improvement
  384. # Date: 5.6.2006
  385. # Date v1.2b: 14.11.2006
  386. # Date v1.21b: 12.1.2007
  387. # Date v1.22b: 13.11.2007
  388. # Date v1.23b: 19.11.2007
  389. # Date v1.24b: 10.12.2007
  390. # Date v1.25b: 19.10.2008
  391. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  392. #
  393. # new in v1.2b:
  394. #   - less and better code, much more compatible, easier to use
  395. #
  396. # new in v1.21b:
  397. #   - removed an obsolete constant
  398. #
  399. # new in v1.22b:
  400. #   - now possible to have more than one Auto-Revive status effect
  401. #
  402. # new in v1.23b:
  403. #   - fixed bug where game over would be automatically initiated when in battle
  404. #
  405. # new in v1.24b:
  406. #   - fixed bug due to typing mistake
  407. #
  408. # new in v1.25b:
  409. #   - fixed bug with RTAB
  410. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  411.  
  412. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  413. # START Configuration
  414. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  415.  
  416. AUTO_REVIVE_IDS = [19] # IDs of status effects
  417. REVIVE_ANIMATION_ID = 25 # ID of the Revive animation
  418. REVIVE_TEXT = 'Auto-Revive!' # text displayed
  419. DEAD_ID = 1 # ID of the "dead" status effect
  420.  
  421. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  422. # END Configuration
  423. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  424.  
  425. #==============================================================================
  426. # Game_Party
  427. #==============================================================================
  428.  
  429. class Game_Party
  430.  
  431.   alias all_dead_autorevive_later? all_dead?
  432.   def all_dead?
  433.     if $game_system.AUTO_REVIVE && (@actors.any? {|a| AUTO_REVIVE_IDS.any? {|i|
  434.         a.states.include?(i)}})
  435.       return false
  436.     end
  437.     return all_dead_autorevive_later?
  438.   end
  439.  
  440. end
  441.  
  442. #==============================================================================
  443. # Sprite
  444. #==============================================================================
  445.  
  446. class RPG::Sprite
  447.  
  448.   alias damage_regen_later damage
  449.   def damage(damage, critical, type = nil)
  450.     if damage == REVIVE_TEXT
  451.       dispose_damage
  452.       bitmap = Bitmap.new(160, 48)
  453.       bitmap.font.name, bitmap.font.size = 'Arial Black', 32
  454.       bitmap.font.color.set(0, 0, 0)
  455.       bitmap.draw_text_shaded_later(-1, 12-1, 160, 36, REVIVE_TEXT, 1)
  456.       bitmap.draw_text_shaded_later(-1, 12+1, 160, 36, REVIVE_TEXT, 1)
  457.       bitmap.draw_text_shaded_later(1, 12-1, 160, 36, REVIVE_TEXT, 1)
  458.       bitmap.draw_text_shaded_later(1, 12+1, 160, 36, REVIVE_TEXT, 1)
  459.       bitmap.font.color.set(0, 192, 255)
  460.       bitmap.font.size = 32
  461.       bitmap.draw_text_shaded_later(0, 12, 160, 36, REVIVE_TEXT, 1)
  462.       @_damage_sprite = ::Sprite.new(self.viewport)
  463.       @_damage_sprite.bitmap = bitmap
  464.       @_damage_sprite.ox, @_damage_sprite.oy = 80, 20
  465.       @_damage_sprite.x, @_damage_sprite.y = self.x, self.y-self.oy/2
  466.       @_damage_sprite.z, @_damage_duration = 3000, 40
  467.     elsif type != nil
  468.       damage_regen_later(damage, critical, type)
  469.     else
  470.       damage_regen_later(damage, critical)
  471.     end
  472.   end
  473.  
  474. end
  475.  
  476. #==============================================================================
  477. # Scene_Battle
  478. #==============================================================================
  479.  
  480. class Scene_Battle
  481.  
  482.   alias judge_autorevive_later judge
  483.   def judge
  484.     if $game_system.AUTO_REVIVE
  485.       flag = false
  486.       $game_party.actors.each {|actor|
  487.           if actor.hp == 0 && AUTO_REVIVE_IDS.any? {|i| actor.states.include?(i)}
  488.             actor.hp += actor.maxhp / 5
  489.             (AUTO_REVIVE_IDS + [DEAD_ID]).each {|i| actor.remove_state(i)}
  490.             actor.animation_id, actor.damage = REVIVE_ANIMATION_ID, REVIVE_TEXT
  491.             actor.damage_pop = flag = true
  492.           end}
  493.       @status_window.refresh if flag
  494.     end
  495.     return judge_autorevive_later
  496.   end
  497.  
  498. end
  499.  
  500. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  501. # Fury Status Effect by Blizzard
  502. # Version: 1.1b
  503. # Type: Game Experience Improvement
  504. # Date: 10.10.2006
  505. # Date 1.1b: 4.7.2008
  506. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  507. #
  508. # Compatibility:
  509. #
  510. #   99% compatible with SDK v1.x. 70% compatible with SDK v2.x. Could cause
  511. #   problems with exotic CBS-es.
  512. #
  513. #
  514. # new in v1.1b:
  515. #   - compatible with Blizz-ABS 1.99 and higher
  516. #
  517. #
  518. # Instructions:
  519. #
  520. # - Explanation:
  521. #
  522. #   This add-on will make specific characters get inflicted with the status
  523. #   effect called "Fury" if another specific character gets killed during battle.
  524. #   Also make the status effect end after the battle is over.
  525. #
  526. # - Configuration:
  527. #
  528. #   Configure your database further below like this template:
  529. #
  530. #     when X then return Y
  531. #
  532. #   X - ID of the dead character
  533. #   Y - ID of the character who will inflicted with Fury.
  534. #  
  535. #   Set FURY_ID to the status effect ID.
  536. #
  537. #
  538. # If you find any bugs, please report them here:
  539. # http://forum.chaos-project.com/
  540. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  541.  
  542. FURY_ID = 23
  543.  
  544. #==============================================================================
  545. # module BlizzCFG
  546. #==============================================================================
  547.  
  548. module BlizzCFG
  549.  
  550.   def self.fury_database(id)
  551.     case id
  552. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  553. # START Fury Database
  554. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  555.     when 1 then return 2
  556.     when 2 then return 7
  557.     when 7 then return 8
  558.     when 8 then return 1
  559. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  560. # END Fury Database
  561. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  562.     else
  563.       return 0
  564.     end
  565.   end
  566.  
  567.   def self.fury_execution
  568.     ids = []
  569.     $game_party.actors.each {|a| ids.push(self.fury_database(a.id)) if a.dead?}
  570.     $game_party.actors.each {|a| a.remove_state(FURY_ID)}
  571.     ids.each {|id|
  572.         if $game_actors[id] != nil && $game_party.actors.include?($game_actors[id])
  573.           $game_actors[id].add_state(FURY_ID) unless $game_actors[id].dead?
  574.         end}
  575.   end
  576.  
  577. end
  578.  
  579. #==============================================================================
  580. # Scene_Battle
  581. #==============================================================================
  582.  
  583. class Scene_Battle
  584.  
  585.   alias upd_fury_later update
  586.   def update
  587.     BlizzCFG.fury_execution if $game_system.FURY_STATUS
  588.     upd_fury_later
  589.   end
  590.  
  591. end
  592.  
  593. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  594. # Invincible Status Effect by Blizzard
  595. # Version: 2.0b
  596. # Type: Game Experience Improvement
  597. # Date: 4.12.2006
  598. # Date v2.0b: 13.11.2007
  599. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  600. #
  601. # new in v2.0b:
  602. #   - overworked for more convenience
  603. #   - added possibility to have more than one Invincible status effect
  604. #   - improved compatbility
  605. #
  606. #
  607. # Compatibility:
  608. #
  609. #   99% compatible with SDK v1.x. 70% compatible with SDK v2.x. Could cause
  610. #   problems with exotic CBS-es.
  611. #
  612. #
  613. # Instructions:
  614. #
  615. # - Explanation:
  616. #
  617. #   This add-on will allow having a status effect that makes a character
  618. #   invincible. Add any status effect IDs into INVINCIBLE_IDS.
  619. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  620.  
  621. INVINCIBLE_IDS = [17]
  622.  
  623. #==============================================================================
  624. # Game_Battler
  625. #==============================================================================
  626.  
  627. class Game_Battler
  628.  
  629.   alias hp_actor_invincible_later hp=
  630.   def hp=(val)
  631.     if $game_system.INVINCIBLE_STATUS && val < @hp
  632.       return if INVINCIBLE_IDS.any? {|i| @states.include?(i)}
  633.     end
  634.     hp_actor_invincible_later(val)
  635.   end
  636.  
  637.   alias damage_is_invincible_later damage=
  638.   def damage=(val)
  639.     if $game_system.INVINCIBLE_STATUS && val.is_a?(Numeric) && val > 0 &&
  640.         INVINCIBLE_IDS.any? {|i| @states.include?(i)}
  641.       damage_is_invincible_later(0)
  642.     else
  643.       damage_is_invincible_later(val)
  644.     end
  645.   end
  646.  
  647. end
  648.  
  649. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  650. # SP Cost Mod Status Effect by Blizzard
  651. # Version: 3.0b
  652. # Type: Game Experience Improvement
  653. # Date v2.0: 13.11.2007
  654. # Date v2.0b: 20.3.2008
  655. # Date v3.0b: 23.7.2008
  656. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  657. # Half SP Date: 8.4.2006
  658. # Half SP Date v1.3b: 13.12.2006
  659. # Half SP Date v1.31b: 12.3.2007
  660. # Half SP Date v1.4b: 24.3.2007
  661. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  662. # 1 SP Date: 12.3.2007
  663. # 1 SP Date v1.1b: 24.3.2007
  664. # 1 SP Date v1.11b: 26.8.2007
  665. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  666. #
  667. # new in v2.0:
  668. #   - completely overworked, now features any SP cost modifier
  669. #
  670. # new in v2.0b:
  671. #   - improved coding
  672. #   - now beta
  673. #
  674. # new in v3.0b:
  675. #   - improved instructions
  676. #   - improved compatibility
  677. #   - improved coding
  678. #
  679. #
  680. # Compatibility:
  681. #
  682. #   99% compatible with SDK v1.x. 70% compatible with SDK v2.x. Should be 100%
  683. #   compatible with everything else. Can cause incompatibility issues with
  684. #   exotic CBS-es and exotic CMS-es, but only if different Skills Windows are
  685. #   used. There is a high chance that this problem can be solved. Please see the
  686. #   note at the bottom for more information.
  687. #
  688. #
  689. # Configuration:
  690. #
  691. #   Configure your database further below like this template:
  692. #
  693. #     when X then return [Y, Z]
  694. #
  695. #   X - ID of the status effect
  696. #   Y - true for percentual decrease, false for fixed cost
  697. #   Z - percentage of SP cost or fixed SP cost
  698. #  
  699. #   Example:
  700. #  
  701. #     when 50 then return [true, 25]
  702. #     when 51 then return [false, 5]
  703. #
  704. #   With this configuration somebody with inflicted status effect 50 would have
  705. #   each skill SP cost decreased to 25% of the original cost, somebody with
  706. #   inflicted status effect 51 would have each skill at an SP cost of 5. If two
  707. #   or more status effects are inflicted, the one that is higher on the list
  708. #   will have the higher priority.
  709. #  
  710. #  
  711. # Compatibility Help:
  712. #  
  713. #   In most skill windows the skill cost is drawn by simply accessing the SP
  714. #   cost of the skill from the database. If this system is to work with custom
  715. #   skill windows, there needs to be done a little edit in those windows.
  716. #   There should be a line in the method "draw_item" similar to this one:
  717. #  
  718. #     self.contents.draw_text(X, Y, W, H, sp_cost.to_s, A)
  719. #  
  720. #   In that case it is sufficient to add this line ABOVE the line mentioned
  721. #   before.
  722. #  
  723. #     sp_cost = BlizzCFG.get_cost_mod(@actor.states, sp_cost)
  724. #  
  725. #   Another possibility is a line like this one:
  726. #  
  727. #     self.contents.draw_text(X, Y, W, H, skill.sp_cost.to_s, A)
  728. #  
  729. #   In that case the line should be changed into thos two here:
  730. #  
  731. #     sp_cost = BlizzCFG.get_cost_mod(@actor.states, skill.sp_cost)
  732. #     self.contents.draw_text(X, Y, W, H, sp_cost.to_s, A)
  733. #  
  734. #   X, Y, W, H and A can be any numeric parameters and are irrelevelant. A is
  735. #   an optional parameter and could have been omitted in some cases.
  736. #  
  737. #  
  738. # If you find any bugs, please report them here:
  739. # http://forum.chaos-project.com/
  740. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  741.  
  742. #==============================================================================
  743. # module BlizzCFG
  744. #==============================================================================
  745.  
  746. module BlizzCFG
  747.  
  748.   def self.sp_cost_mod(id)
  749.     case id
  750. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  751. # START SP Cost Mod Database
  752. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  753.     when 25 then return [true, 50]
  754.     when 20 then return [false, 1]
  755. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  756. # END SP Cost Mod Database
  757. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  758.     end
  759.     return nil
  760.   end
  761.  
  762.   def self.get_cost_mod(states, cost)
  763.     data = nil
  764.     states.each {|i|
  765.         data = BlizzCFG.sp_cost_mod(i)
  766.         break if data != nil}
  767.     return cost if data == nil
  768.     return data[1] unless data[0]
  769.     return cost * (100 - data[1]) / 100
  770.   end
  771.  
  772. end
  773.  
  774. #==============================================================================
  775. # Game_Battler
  776. #==============================================================================
  777.  
  778. class Game_Battler
  779.  
  780.   alias sp_actor_halfsp_later sp=
  781.   def sp=(val)
  782.     if val < self.sp && val >= 0 && $game_system.SP_COST_MOD
  783.       val = self.sp - BlizzCFG.get_cost_mod(@states, self.sp-val)
  784.     end
  785.     sp_actor_halfsp_later(val)
  786.   end
  787.  
  788.   alias skill_can_use_halfsp_later? skill_can_use?
  789.   def skill_can_use?(skill_id)
  790.     if $game_system.SP_COST_MOD
  791.       cost = BlizzCFG.get_cost_mod(@states, $data_skills[skill_id].sp_cost)
  792.       return false if self.sp < cost
  793.     end
  794.     return skill_can_use_halfsp_later?(skill_id)
  795.   end
  796.  
  797. end
  798.  
  799. #==============================================================================
  800. # Window_Skill
  801. #==============================================================================
  802.  
  803. class Window_Skill ###
  804.  
  805.   alias draw_item_halfsp_later draw_item
  806.   def draw_item(index)
  807.     draw_item_halfsp_later(index)
  808.     return if $game_system.SKILL_SEPARATION
  809.     if $game_system.SP_COST_MOD
  810.       skill = @data[index]
  811.       if @actor.skill_can_use?(skill.id)
  812.         self.contents.font.color = normal_color
  813.       else
  814.         self.contents.font.color = disabled_color
  815.       end
  816.       x, y = 4+index%2*320, index/2*32
  817.       rect = Rect.new(x + 232, y, 48, 32)
  818.       self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  819.       sp_cost = BlizzCFG.get_cost_mod(@actor.states, skill.sp_cost)
  820.       self.contents.draw_text(x + 232, y, 48, 32, sp_cost.to_s, 2)
  821.     end
  822.   end
  823.  
  824. end
  825.  
  826. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  827. # Frozen Status Effect by Blizzard
  828. # Version: 1.0b
  829. # Type: Game Experience Improvement
  830. # Date: 20.10.2007
  831. # Date v1.0b: 13.11.2007
  832. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  833. #
  834. # new in v1.0b:
  835. #   - possible to have more than one Frozen Status effect
  836. #   - now beta
  837. #
  838. #
  839. # Compatibility:
  840. #
  841. #   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Could cause
  842. #   problems with exotic CBS-es.
  843. #
  844. #
  845. # Instructions:
  846. #
  847. # - Explanation:
  848. #
  849. #   This add-on will allow having a status effect that makes a character die as
  850. #   soon as he get damaged. Set FROZEN_ID to the status effect ID. Keep in mind
  851. #   that the battler who has this status inflicted cannot act, so set it up
  852. #   correctly in your database.
  853. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  854.  
  855. FROZEN_IDS = [29]
  856.  
  857. #==============================================================================
  858. # Game_Battler
  859. #==============================================================================
  860.  
  861. class Game_Battler
  862.  
  863.   alias hp_actor_frozen_later hp=
  864.   def hp=(val)
  865.     if $game_system.FROZEN && val < @hp && FROZEN_IDS.any? {|i| @states.include?(i)}
  866.       hp_actor_frozen_later(0)
  867.     else
  868.       hp_actor_invincible_later(val)
  869.     end
  870.   end
  871.  
  872. end
  873.  
  874. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  875. # Blue Magic via Status Effect by Blizzard
  876. # Version: 1.0
  877. # Type: Skill Learning Status Effect
  878. # Date: 17.2.2008
  879. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  880. #
  881. #   This actor will learn the enemy's skill he was attacked with while this
  882. #   status effect is inflicted. If an actor is inflicted with more than one
  883. #   "learning" status effect at the same time, every one of them contributes
  884. #   to the chance of learning the skill.
  885. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  886.  
  887. #==============================================================================
  888. # module BlizzCFG
  889. #==============================================================================
  890.  
  891. module BlizzCFG
  892.  
  893.   def self.blue_states(id)
  894.     case id
  895. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  896. # START Blue Status Database
  897. #  
  898. #   Set up the database below using following template:
  899. #  
  900. #     when STATE_ID then return [CHANCE, GROUP_1, GROUP_2, ...]
  901. #    
  902. #   STATE_ID - the state ID in the database
  903. #   CHANCE   - the probability in % that the skill will be learned
  904. #   GROUP    - "class" from which skills can be learned
  905. #  
  906. #   Every status effect that is not defined here has a chance of 0% to make the
  907. #   attacked actor learn the skill of the attacker. Depending on the state,
  908. #   only enemies', actors' or both groups' skills can be learned. Add one or
  909. #   more of the following classes after the probability factor:
  910. #    
  911. #     Game_Enemy - represents enemies
  912. #     Game_Actor - represents actors
  913. #  
  914. #   Keep in mind that you need at least one group from which skills can be
  915. #   learned.
  916. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  917.     when 27 then return [50, Game_Enemy] # 50% chance to learn from enemies
  918.     when 28 then return [10, Game_Actor, Game_Enemy] # 10% chance to learn from enemies or actors
  919.     when 29 then return [20, Game_Actor] # 20% chance to learn from actors
  920. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  921. # END Blue Status Database
  922. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  923.     end
  924.     return [0]
  925.   end
  926.  
  927. end
  928.  
  929. #==============================================================================
  930. # Game_Battler
  931. #==============================================================================
  932.  
  933. class Game_Battler
  934.  
  935.   alias skill_effect_bluestatus_later skill_effect
  936.   def skill_effect(user, skill)
  937.     if $game_system.BLUE_MAGIC_STATUS && self.is_a?(Game_Actor)
  938.       @states.each {|id|
  939.           data = BlizzCFG.blue_states(id)
  940.           if data.size > 1 && rand(100) < data[0] &&
  941.               data[1, data.size-1].include?(user.class)
  942.             learn_skill(skill.id)
  943.             break
  944.           end}
  945.     end
  946.     return skill_effect_bluestatus_later(user, skill)
  947.   end
  948.  
  949. end
  950.  
  951. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  952. # Doom Status Effect by Blizzard
  953. # Version: 1.0b
  954. # Type: Enhanced Status Effect
  955. # Date: 20.10.2007
  956. # Date v1.0b: 28.10.2007
  957. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  958. #
  959. # Explanation:
  960. #
  961. #   With this add-on you are able to create "Doom" skills. Doom skills inflict
  962. #   a status effect that kills the inflicted character after a defined number
  963. #   of turns. Usually a timer is displayed.
  964. #
  965. # new in v1.0b:
  966. #   - timer appears now when damage is supposed to appear
  967. #   - actors get killed as soon as the counter reaches zero and not as soon
  968. #     they try to act while the counter is zero
  969. #   - actor who killed the last enemy doesn't die
  970. #   - now beta
  971. #
  972. #
  973. # Compatibility:
  974. #
  975. #   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Could cause
  976. #   problems with exotic CBS-es.
  977. #
  978. #
  979. # Instructions:
  980. #
  981. # - Configuration  
  982. #  
  983. #   DOOM_IDS            - include any IDs of Doom status effects and separate
  984. #                         them with commas (i.e. [24, 25, 26])
  985. #   DOOM_TIMER_VISIBLE  - set it to either true or false whether you want to
  986. #                         display the timer or not
  987. #   DOOM_TIMER_POSITION - set this value to 0 to display it "above" the sprite,
  988. #                         set it to 1 to display it on top of the sprite or set
  989. #                         it to 2 to display it at the center of the sprite
  990. #  
  991. #   You need to create status effects and set up the "Release Conditions".
  992. #   Set the condition "Release at the end of battle" and set the X in "After X
  993. #   turns 100% chance" to the number of turns available for this specific
  994. #   status effect (it is important that the probability is 100%). This way you
  995. #   are able to create more than one Doom Effect, each Doom Effect can have a
  996. #   different countdown starting number. All that is left to do is to create
  997. #   skills that inflict those status effects.
  998. #  
  999. #
  1000. # Important note:
  1001. #  
  1002. #   It is recommended that you make the status effects "Non-resistance" and
  1003. #   that you make them cancel each other. Also should the "Death" status effect
  1004. #   cancel Doom, otherwise the timer will not disappear. Also, make the status
  1005. #   effect wear off after battle for convenience.
  1006. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1007.  
  1008. DOOM_IDS = [22, 27, 28]
  1009. DOOM_TIMER_VISIBLE = true
  1010. DOOM_TIMER_POSITION = 1
  1011. DOOM_FONT = 'Arial Black'
  1012. DOOM_SIZE = 32
  1013.  
  1014. #==============================================================================
  1015. # Game_Battler
  1016. #==============================================================================
  1017.  
  1018. class Game_Battler
  1019.  
  1020.   attr_reader :states_turn
  1021.  
  1022. end
  1023.  
  1024. #==============================================================================
  1025. # Sprite_Battler
  1026. #==============================================================================
  1027.  
  1028. class Sprite_Battler
  1029.  
  1030.   alias upd_doomskill_later update
  1031.   def update
  1032.     upd_doomskill_later
  1033.     return unless @battler && $game_system.DOOM_STATUS && DOOM_TIMER_VISIBLE
  1034.     dooms = @battler.states.find_all {|i| DOOM_IDS.include?(i)}
  1035.     if dooms != []
  1036.       if $scene.is_a?(Scene_Battle) && $scene.phase4_step == 6
  1037.         if @doom == nil
  1038.           @doom = Sprite.new
  1039.           @doom.bitmap = Bitmap.new(48, 48)
  1040.           @doom.bitmap.font.name, @doom.bitmap.font.size = DOOM_FONT, DOOM_SIZE
  1041.           @doom.x, @doom.z, @doom.ox, @doom.oy = self.x, self.z + 100, 24, 48
  1042.           @doom.y = case DOOM_TIMER_POSITION
  1043.           when 0 then self.y - self.oy
  1044.           when 1 then self.y - self.oy+24
  1045.           when 2 then self.y - self.oy/2
  1046.           end
  1047.         end
  1048.         if @turns_left != @battler.states_turn[dooms[0]]
  1049.           @turns_left = @battler.states_turn[dooms[0]]
  1050.           @doom.bitmap.clear
  1051.           if @turns_left == 0 && $game_troop.enemies.any? {|enemy| enemy.exist?}
  1052.             @battler.hp = 0
  1053.           end
  1054.           if $Blizz_Art
  1055.             @doom.bitmap.draw_text_full(0, 0, 48, 32, @turns_left.to_s, 1)
  1056.           else
  1057.             @doom.bitmap.draw_text(0, 0, 48, 32, @turns_left.to_s, 1)
  1058.           end
  1059.         end
  1060.       end
  1061.     elsif @doom != nil && $scene.is_a?(Scene_Battle) && $scene.phase4_step == 2
  1062.       @doom.dispose
  1063.       @doom = nil
  1064.     end
  1065.   end
  1066.  
  1067.   alias disp_doomskill_later dispose
  1068.   def dispose
  1069.     unless @doom == nil || @doom.disposed?
  1070.       @doom.dispose
  1071.       @doom = nil
  1072.     end
  1073.     disp_doomskill_later
  1074.   end
  1075.  
  1076. end
  1077.  
  1078. #==============================================================================
  1079. # Scene_Battle
  1080. #==============================================================================
  1081.  
  1082. class Scene_Battle
  1083.  
  1084.   attr_reader :phase4_step
  1085.  
  1086. end
  1087.  
  1088. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  1089. #                                                                             #
  1090. #                         ##### #   #  #  #     #                             #
  1091. #                         #     #  #   #  #     #                             #
  1092. #                         ##### ###    #  #     #                             #
  1093. #                             # #  #   #  #     #                             #
  1094. #                         ##### #   #  #  ##### #####                         #
  1095. #                                                                             #
  1096. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  1097.  
  1098. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1099. # Absorb HP/SP Skill by Blizzard
  1100. # Version: 2.0b
  1101. # Type: Enhanced Skill
  1102. # Date: 8.5.2006
  1103. # Date v1.7b: 14.11.2006
  1104. # Date v1.72b: 20.10.2007
  1105. # Date v1.8b: 20.3.2008
  1106. # Date v2.0b: 13.7.2008
  1107. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1108. #
  1109. # new in v1.7b:
  1110. #   - overworked code, fixed bugs and glitches, added "undead SP"
  1111. #
  1112. # new in v1.72b:
  1113. #   - slightly improved code and slight system change
  1114. #
  1115. # new in v1.8b:
  1116. #   - fixed a bug with SP absorbing that would kill an enemy instead of taking
  1117. #     all remaining SP
  1118. #
  1119. # new in v2.0b:
  1120. #   - enhanced compatibility with Full Reflection System and Blizz-ABS
  1121. #
  1122. #   Just include all the skill IDs that are supposed to steal HP/SP. You can
  1123. #   also define undead enemies who will (due to common belief...) revert the HP
  1124. #   absorb effect. Also you may add any IDs of enemies who use the same undead
  1125. #   effect, but on SP. Just add the IDs into UNDEAD_SP. Note that you can make
  1126. #   enemies who only are "undead" for HP stealing, SP stealing or even both.
  1127. #
  1128. # Note:
  1129. #   If you let a skill steal both HP and SP, only HP will be stolen.
  1130. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1131.  
  1132. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1133. # START Configuration
  1134. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1135.  
  1136. SKILL_IDS_HP = [90] # add any Skill IDs and separate them with commas
  1137. SKILL_IDS_SP = [91] # add any Skill IDs and separate them with commas
  1138. UNDEAD_IDS = [1] # add IDS and separate them with commas
  1139. UNDEAD_SP = [32] # add IDS and separate them with commas
  1140.  
  1141. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1142. # END Configuration
  1143. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1144.  
  1145. #==============================================================================
  1146. # Game_Battler
  1147. #==============================================================================
  1148.  
  1149. class Game_Battler
  1150.  
  1151.   alias skill_effect_hpsp_absorb_later skill_effect
  1152.   def skill_effect(user, skill)
  1153.     last_hp = self.hp
  1154.     last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  1155.     result = skill_effect_hpsp_absorb_later(user, skill)
  1156.     if $game_system.ABSORB_HP_SP && self.damage.is_a?(Numeric)
  1157.       if SKILL_IDS_SP.include?(skill.id)
  1158.         self.hp = last_hp
  1159.         self.hp = self.hp
  1160.         self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1161.         if user != self
  1162.           if self.is_a?(Game_Enemy) && UNDEAD_SP.include?(self.id)
  1163.             self.damage = -self.damage
  1164.           end
  1165.           if self.sp >= self.damage
  1166.             self.sp -= self.damage
  1167.           else
  1168.             self.damage, self.sp = self.sp, 0
  1169.           end
  1170.         else
  1171.           self.damage = 0
  1172.         end
  1173.       elsif SKILL_IDS_HP.include?(skill.id)
  1174.         self.hp = last_hp
  1175.         self.hp = self.hp
  1176.         self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1177.         if user != self
  1178.           if self.is_a?(Game_Enemy) && UNDEAD_IDS.include?(self.id)
  1179.             self.damage = -self.damage
  1180.           end
  1181.           if self.hp >= self.damage
  1182.             self.hp -= self.damage
  1183.           else
  1184.             self.damage, self.hp = self.hp, 0
  1185.           end
  1186.         else
  1187.           self.damage = 0
  1188.         end
  1189.       end
  1190.     end
  1191.     return result
  1192.   end
  1193.  
  1194. end
  1195.  
  1196. #==============================================================================
  1197. # Scene_Battle
  1198. #==============================================================================
  1199.  
  1200. class Scene_Battle
  1201.  
  1202.   alias update_phase4_step5_hpsp_absorb_later update_phase4_step5
  1203.   def update_phase4_step5(battler = nil)
  1204.     if $game_system.ABSORB_HP_SP
  1205.       @status_window.refresh
  1206.       @help_window.visible, damages = false, 0
  1207.       @target_battlers.each {|target|
  1208.           if target.damage != nil
  1209.             target.damage_pop = true
  1210.             damages += target.damage if target.damage.is_a?(Numeric)
  1211.           end}
  1212.       if check_absorb(@active_battler, @active_battler.current_action.skill_id,
  1213.           damages)
  1214.         @status_window.refresh
  1215.       end
  1216.       @skill, @phase4_step = nil, 6
  1217.     elsif battler == nil
  1218.       update_phase4_step5_hpsp_absorb_later
  1219.     else
  1220.       update_phase4_step5_hpsp_absorb_later(battler)
  1221.     end
  1222.   end
  1223.  
  1224.   def check_absorb(user, id, damage)
  1225.     if (SKILL_IDS_HP | SKILL_IDS_SP).include?(id)
  1226.       if SKILL_IDS_HP.include?(id)
  1227.         user.hp += damage
  1228.       elsif SKILL_IDS_SP.include?(id)
  1229.         user.sp += damage
  1230.       end
  1231.       user.damage, user.damage_pop = -damage, true
  1232.       return true
  1233.     end
  1234.     return false
  1235.   end
  1236.    
  1237. end
  1238.  
  1239. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1240. # State Breaker Skill by Blizzard
  1241. # Version: 1.0
  1242. # Type: Enhanced Skill
  1243. # Date: 19.10.2008
  1244. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1245. #
  1246. #   This skill will inflict all status effects that a skill can inflict on the
  1247. #   target. To make somebody immune to this skill's effect, just set the
  1248. #   immunity to the different status effects to F. It is recommended that the
  1249. #   skill does not have any additional effects.
  1250. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1251.  
  1252. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1253. # START Configuration
  1254. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1255.  
  1256. STATE_BREAKER_IDS = [66, 57] # add any Skill IDs and separate them with commas
  1257. IMMUNE_TEXT = 'Immune' # text for enemies that are immune to all states
  1258. MISS_TEXT = 'Miss' # "Miss" text in your game
  1259.  
  1260. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1261. # END Configuration
  1262. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1263.  
  1264. #==============================================================================
  1265. # Game_Battler
  1266. #==============================================================================
  1267.  
  1268. class Game_Battler
  1269.  
  1270.   alias skill_effect_state_breaker_later skill_effect
  1271.   def skill_effect(user, skill)
  1272.     result = skill_effect_state_breaker_later(user, skill)
  1273.     if $game_system.STATE_BREAKER && STATE_BREAKER_IDS.include?(skill.id)
  1274.       if skill.plus_state_set.all? {|id|
  1275.           state_ranks[id] == 6 || state_ranks[id] == 0}
  1276.         self.damage = IMMUNE_TEXT if self.damage == MISS_TEXT
  1277.       else
  1278.         skill.plus_state_set.each {|id| add_state(id)}
  1279.         self.damage = nil if self.damage == MISS_TEXT
  1280.       end
  1281.     end
  1282.     return result
  1283.   end
  1284.  
  1285. end
  1286.  
  1287. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1288. # Blue Magic via Skill by Blizzard
  1289. # Version: 1.5
  1290. # Type: Skill Learning Skill
  1291. # Date: 14.11.2006
  1292. # Date v1.5: 17.2.2008
  1293. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1294. #
  1295. #   This actor will learn one of the target's skills. Making this skill target
  1296. #   all allies/enemies, ONLY ONE SKILL WILL BE LEARNED FROM A RANDOM TARGET!
  1297. #   Make the skill do no damage to the target and use the hit rate to determine
  1298. #   the success chance of the skill.
  1299. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1300.  
  1301. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1302. # START Configuration
  1303. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1304.  
  1305. BLUE_MAGIC_IDS = [92] # add any Skill IDs and separate them with commas
  1306.  
  1307. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1308. # END Configuration
  1309. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1310.  
  1311. #==============================================================================
  1312. # Scene_Battle
  1313. #==============================================================================
  1314.  
  1315. class Scene_Battle
  1316.  
  1317.   alias make_skill_action_result_blue_later make_skill_action_result
  1318.   def make_skill_action_result(battler = nil, plus_id = nil)
  1319.     if battler == nil
  1320.       make_skill_action_result_blue_later
  1321.       battler, targets = @active_battler, @target_battlers
  1322.     elsif plus_id == nil
  1323.       make_skill_action_result_blue_later(battler)
  1324.       targets = battler.target
  1325.     else
  1326.       make_skill_action_result_blue_later(battler, plus_id)
  1327.       targets = battler.target
  1328.     end
  1329.     if $game_system.BLUE_MAGIC_SKILL &&
  1330.         BLUE_MAGIC_IDS.include?(battler.current_action.skill_id)
  1331.       targets.each {|target| target.damage = nil}
  1332.       target = targets[rand(targets.size)]
  1333.       if rand(100) < $data_skills[battler.current_action.skill_id].hit
  1334.         if target.is_a?(Game_Enemy)
  1335.           ids = []
  1336.           target.actions.each {|act| ids.push(act.skill_id) if act.kind == 1}
  1337.         elsif target.is_a?(Game_Actor)
  1338.           ids = target.skills.clone
  1339.         end
  1340.         if ids.size > 0
  1341.           skill = $data_skills[ids[rand(ids.size)]]
  1342.           if battler.skills.include?(skill.id)
  1343.             target.damage = "#{skill.name} known"
  1344.           else
  1345.             battler.learn_skill(skill.id)
  1346.             target.damage = "#{skill.name} learned"
  1347.           end
  1348.         else
  1349.           target.damage = 'None available'
  1350.         end
  1351.       else
  1352.         target.damage = 'Miss'
  1353.       end
  1354.     end
  1355.   end
  1356.    
  1357. end
  1358.  
  1359. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1360. # Demi Skill by Blizzard
  1361. # Version: 1.02b
  1362. # Type: Enhanced Skill
  1363. # Date: 5.9.2008
  1364. # Date v1.02b: 19.10.2008
  1365. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1366. #
  1367. # Explanation:
  1368. #
  1369. #   This skill deals damage equal to a percentage of the remaining HP.
  1370. #
  1371. #
  1372. # Configuration:
  1373. #
  1374. #   Scroll down to START Demi Database and create Demi skills. This system work
  1375. #   on both sides, both enemies and actors can use it.
  1376. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1377.  
  1378. #==============================================================================
  1379. # module BlizzCFG
  1380. #==============================================================================
  1381.  
  1382. module BlizzCFG
  1383.  
  1384.   def self.demi_database(id)
  1385.     case id
  1386. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1387. # START Demi Database
  1388. #
  1389. #   Use following template to create Demi skills:
  1390. #
  1391. #     when ID then return RATE
  1392. #
  1393. #   ID   - ID of the skill in the database
  1394. #   RATE - percentage of how much of the remaining HP should be taken away
  1395. #
  1396. #   Example:
  1397. #
  1398. #     when 88 then return 25
  1399. #  
  1400. #   Skill with ID 88 will do damage equal to 25% of the enemies' remaining HP.
  1401. #
  1402. #   Note that using values equal to or greater than 100 will kill instantly.
  1403. #   Negative values will heal instead.
  1404. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1405.     when 88 then return 25
  1406.     when 89 then return 50
  1407.     when 58 then return 50
  1408. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1409. # END Demi Database
  1410. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1411.     end
  1412.     return 0
  1413.   end
  1414.  
  1415. end
  1416.  
  1417. #==============================================================================
  1418. # Game_Battler
  1419. #==============================================================================
  1420.  
  1421. class Game_Battler
  1422.  
  1423.   alias skill_effect_demi_skill_later skill_effect
  1424.   def skill_effect(user, skill)
  1425.     last_hp = self.hp
  1426.     last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  1427.     result = skill_effect_demi_skill_later(user, skill)
  1428.     if $game_system.DEMI_SKILL
  1429.       rate = BlizzCFG.demi_database(skill.id)
  1430.       if rate != 0
  1431.         self.hp = last_hp
  1432.         self.hp = self.hp
  1433.         self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1434.         if result || self.damage.is_a?(Numeric)
  1435.           self.damage = last_hp * rate / 100
  1436.           self.hp -= self.damage
  1437.         end
  1438.       end
  1439.     end
  1440.     return result
  1441.   end
  1442.  
  1443. end
  1444.  
  1445. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1446. # Revenge Skill by Blizzard
  1447. # Version: 1.1b
  1448. # Type: Enhanced Skill
  1449. # Date: 22.10.2007
  1450. # Date v1.0b: 7.12.2007
  1451. # Date v1.1b: 1.10.2009
  1452. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1453. #
  1454. # new in v1.0b:
  1455. #   - now does damage equal to the skill user's max HP - current HP (like it is
  1456. #     supposed to be)
  1457. #   - now beta
  1458. #
  1459. # new in v1.1b:
  1460. #   - fixed a bug
  1461. #
  1462. # Compatibility:
  1463. #
  1464. #   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Could cause
  1465. #   problems with exotic CBS-es.
  1466. #
  1467. #
  1468. # Instructions:
  1469. #
  1470. # - Explanation:
  1471. #
  1472. #   This add-on allows you to create skills that deal damage equal to the
  1473. #   difference between the max HP and the current HP of the user.
  1474. #  
  1475. # - Configuration  
  1476. #  
  1477. #   REVENGE_IDS - include any IDs of Revenge Skills and separate them with
  1478. #                 commas (i.e. [52, 53, 54])
  1479. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1480.  
  1481. REVENGE_IDS = [52, 53, 54]
  1482.  
  1483. #==============================================================================
  1484. # Game_Battler
  1485. #==============================================================================
  1486.  
  1487. class Game_Battler
  1488.  
  1489.   alias skill_effect_revenge_skill_later skill_effect
  1490.   def skill_effect(user, skill)
  1491.     last_hp = self.hp
  1492.     last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  1493.     result = skill_effect_revenge_skill_later(user, skill)
  1494.     if $game_system.REVENGE_SKILL && REVENGE_IDS.include?(skill.id)
  1495.       self.hp = last_hp
  1496.       self.hp = self.hp
  1497.       self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1498.       if result || self.damage.is_a?(Numeric)
  1499.         self.damage = user.maxhp - user.hp
  1500.         self.hp -= self.damage
  1501.       end
  1502.     end
  1503.     return result
  1504.   end
  1505.  
  1506. end
  1507.  
  1508. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1509. # Destructor Skill by Blizzard
  1510. # Version: 1.2b
  1511. # Type: Enhanced Skill
  1512. # Date: 22.10.2007
  1513. # Date v1.0b: 28.10.2007
  1514. # Date v1.1b: 7.12.2007
  1515. # Date v1.2b: 20.3.2008
  1516. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1517. #
  1518. # Explanation:
  1519. #
  1520. #   This add-on allows you to create skills that kill the user upon use.
  1521. #
  1522. # new in v1.0b:
  1523. #   - fixed bugs and tested
  1524. #   - now beta
  1525. #
  1526. # new in v1.1b:
  1527. #   - fixed glitch where user would die before casting animation
  1528. #   - improved coding
  1529. #   - now easier to set up
  1530. #
  1531. # new in v1.2b:
  1532. #   - fixed problem when using on full-HP allies
  1533. #
  1534. #
  1535. # Compatibility:
  1536. #
  1537. #   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Could cause
  1538. #   problems with exotic CBS-es.
  1539. #
  1540. #
  1541. # Instructions:
  1542. #
  1543. # - Configuration
  1544. #  
  1545. #   DESTRUCT_IDS   - include any IDs of basic Destructor Skills and separate
  1546. #                    them with commas (i.e. [55, 56, 57])
  1547. #   NORMALIZE_IDS  - include any IDs of Destructor Skills that deal damage/heal
  1548. #                    HP equal to the number of HP the user has left and
  1549. #                    separate them with commas
  1550. #   ULTRA_DESTRUCT - include any IDs of Destructor Skills that heal all HP and
  1551. #                    SP of the target
  1552. #   REGEN_TEXT     - damage text displayed if somebody was hit by an
  1553. #                    Ultra Destructor Skill
  1554. #  
  1555. #   Keep in mind that a Normalized Skill will react like a normal skill (heal
  1556. #   HP or deal damage), only the number will be set to the user's HP.
  1557. #   The three skill type HAVE TO be separated. A skill can't be of more than
  1558. #   one type.
  1559. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1560.  
  1561. DESTRUCT_IDS = [55]
  1562. NORMALIZE_IDS = [56]
  1563. ULTRA_DESTRUCT = [57]
  1564. REGEN_TEXT = 'Full!'
  1565.  
  1566. #==============================================================================
  1567. # Game_Battler
  1568. #==============================================================================
  1569.  
  1570. class Game_Battler
  1571.  
  1572.   attr_writer :set_to_die
  1573.  
  1574.   def set_to_die
  1575.     result, @set_to_die = @set_to_die, nil
  1576.     return result
  1577.   end
  1578.  
  1579.   alias skill_effect_destruct_skill_later skill_effect
  1580.   def skill_effect(user, skill)
  1581.     last_hp = self.hp
  1582.     last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  1583.     result = skill_effect_destruct_skill_later(user, skill)
  1584.     if $game_system.DESTRUCTOR_SKILL &&
  1585.         (DESTRUCT_IDS + NORMALIZE_IDS + ULTRA_DESTRUCT).include?(skill.id)
  1586.       if NORMALIZE_IDS.include?(skill.id)
  1587.         self.hp = last_hp
  1588.         self.hp = self.hp
  1589.         self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1590.         self.damage = (self.class == user.class ? -user.hp : user.hp)
  1591.         self.hp -= self.damage
  1592.       elsif ULTRA_DESTRUCT.include?(skill.id)
  1593.         self.hp = last_hp
  1594.         self.hp = self.hp
  1595.         self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1596.         self.damage = REGEN_TEXT
  1597.         self.hp, self.sp = self.maxhp, self.maxsp
  1598.       end
  1599.       user.set_to_die = true
  1600.     end
  1601.     return result
  1602.   end
  1603.  
  1604. end
  1605.  
  1606. #==============================================================================
  1607. # Scene_Battle
  1608. #==============================================================================
  1609.  
  1610. class Scene_Battle
  1611.  
  1612.   alias update_phase4_step5_destruct_skill_later update_phase4_step5
  1613.   def update_phase4_step5(battler = nil)
  1614.     ($game_party.actors + $game_troop.enemies).each {|b|
  1615.         b.hp = 0 if b.set_to_die}
  1616.     if battler == nil
  1617.       update_phase4_step5_destruct_skill_later
  1618.     else
  1619.       update_phase4_step5_multi_hit_later(battler)
  1620.     end
  1621.   end
  1622.  
  1623. end
  1624.  
  1625. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1626. # SP Damage Skill by Blizzard
  1627. # Version: 1.0b
  1628. # Type: Enhanced Skill
  1629. # Date: 5.9.2008
  1630. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1631. #
  1632. # Compatibility:
  1633. #
  1634. #   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Could cause
  1635. #   problems with exotic CBS-es.
  1636. #
  1637. #
  1638. # Instructions:
  1639. #
  1640. # - Explanation:
  1641. #
  1642. #   Instead of dealing damage / healing HP, this add-on allows your skill toä
  1643. #   do damage to / heal SP.
  1644. #  
  1645. # - Configuration
  1646. #  
  1647. #   SPKILL_IDS - include any IDs of SP Damage Skills and separate them with
  1648. #                commas (i.e. [58, 59, 60])
  1649. #   SP_TEXT    - set this to true if you want the SP word to be displayed in
  1650. #                the damage
  1651. #  
  1652. #   Keep in mind that if you use the SP_TEXT option, the damage text will
  1653. #   always be white and a + or - will be added for convenience.
  1654. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1655.  
  1656. SPKILL_IDS = [58, 59, 60]
  1657. SP_TEXT = false
  1658.  
  1659. #==============================================================================
  1660. # Game_Battler
  1661. #==============================================================================
  1662.  
  1663. class Game_Battler
  1664.  
  1665.   alias skill_effect_spkill_skill_later skill_effect
  1666.   def skill_effect(user, skill)
  1667.     last_hp = self.hp
  1668.     last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  1669.     result = skill_effect_spkill_skill_later(user, skill)
  1670.     if $game_system.SP_DAMAGE_SKILL && SPKILL_IDS.include?(skill.id)
  1671.       self.hp = last_hp
  1672.       self.hp = self.hp
  1673.       self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1674.       if self.damage.is_a?(Numeric)
  1675.         self.sp -= self.damage
  1676.         if SP_TEXT
  1677.           self.damage = sprintf('%+d %s', -self.damage, $data_system.words.sp)
  1678.         end
  1679.       end
  1680.     end
  1681.     return result
  1682.   end
  1683.  
  1684. end
  1685.  
  1686. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1687. # Charging Skill by Blizzard
  1688. # Version: 1.0b
  1689. # Type: Enhanced Skill
  1690. # Date: 7.12.2007
  1691. # Date v1.0b: 10.12.2007
  1692. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1693. #
  1694. # new in v1.0b:
  1695. #   - fixed bugs
  1696. #   - now possible to create a charging skill that executes a different one
  1697. #   - now beta
  1698. #
  1699. #
  1700. # Compatibility:
  1701. #
  1702. #   99% compatible with SDK v1.x. 80% compatible with SDK v2.x. Can cause
  1703. #   problems with exotic CBS-es. Compatible with Soul Rage System and Soul
  1704. #   Limit System. Not compatible with Chaos Drive System (cannot charge a Chaos
  1705. #   Drive transforming skill).
  1706. #
  1707. #
  1708. # Explanation:
  1709. #  
  1710. #   This add-on allows you to create skills that need to charge first upon use.
  1711. #   The battler will count backwards until he can use the skill.
  1712. #  
  1713. #  
  1714. # Configuration:
  1715. #  
  1716. #   CHARGE_ID - Set this value to the ID of the status effect to be inflicted
  1717. #               when charging up a skill. In this case let the status effect
  1718. #               disappear after the battle is over. Set it to 0 to disable it.
  1719. #               This feature is optional.
  1720. #  
  1721. #  
  1722. # Important Notes:
  1723. #  
  1724. #   Keep in mind that the skill requirement needs to be met all the time. If
  1725. #   the battler loses SP for some reason, gets killed or something similar, the
  1726. #   countdown will stopped and the battler returned to a normal action state.
  1727. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1728.  
  1729. #==============================================================================
  1730. # module BlizzCFG
  1731. #==============================================================================
  1732.  
  1733. module BlizzCFG
  1734.  
  1735. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1736. # START Configuration
  1737. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1738.   CHARGE_ID = 0
  1739. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1740. # END Configuration
  1741. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1742.  
  1743.   def self.charge_skill(id)
  1744.     case id
  1745. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1746. # START Charging Skill Database
  1747. #  
  1748. #   Set up the database below using following template:
  1749. #  
  1750. #   1)  when TRIGGER_ID then return [TURNS]
  1751. #   2)  when TRIGGER_ID then return [TURNS, EXECUTE_ID]
  1752. #    
  1753. #   TRIGGER_ID - the triggering skill ID in the database
  1754. #   EXECUTE_ID - the execution skill ID in the database
  1755. #   TURNS      - the number of turns the skill needs to charge up
  1756. #  
  1757. #   If you define only the number of turns for a skill, it will trigger itself
  1758. #   instead of the other skill. Use the first syntax in this case.
  1759. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1760.     when 57 then return [1, 9]
  1761. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1762. # END Charging Skill Database
  1763. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1764.     end
  1765.     return [0]
  1766.   end
  1767.  
  1768. end
  1769.  
  1770. #==============================================================================
  1771. # Game_Battler
  1772. #==============================================================================
  1773.  
  1774. class Game_Battler
  1775.  
  1776.   attr_accessor :charging
  1777.   attr_accessor :current_action
  1778.  
  1779.   alias restriction_charge_skill_later restriction
  1780.   def restriction
  1781.     return (@charging != nil ? 4 : restriction_charge_skill_later)
  1782.   end
  1783.  
  1784. end
  1785.  
  1786. #==============================================================================
  1787. # Scene_Battle
  1788. #==============================================================================
  1789.  
  1790. class Scene_Battle
  1791.  
  1792.   alias main_charge_skill_later main
  1793.   def main
  1794.     main_charge_skill_later
  1795.     $game_party.actors.each {|actor| actor.charging = nil}
  1796.   end
  1797.  
  1798.   alias update_phase4_step2_charge_skill_later update_phase4_step2
  1799.   def update_phase4_step2(battler = nil)
  1800.     if $game_system.CHARGE_SKILL
  1801.       b = (battler == nil ? @active_battler : battler)
  1802.       if b.restriction > 1
  1803.         if b.charging != nil && b.charging[0] > 0
  1804.           b.charging[0] -= 1
  1805.           make_charge_action_result(b)
  1806.           if b.charging == nil && b.is_a?(Game_Actor) &&
  1807.               !b.skills.include?(b.current_action.skill_id)
  1808.             b.learn_skill(b.current_action.skill_id)
  1809.             skill_id = b.current_action.skill_id
  1810.           end
  1811.         end
  1812.       elsif ($crls ? [1, 3, 9] : [1]).include?(b.current_action.kind)
  1813.         turns = BlizzCFG.charge_skill(b.current_action.skill_id)
  1814.         if turns[0] > 0
  1815.           b.charging = [turns[0], b.current_action.clone]
  1816.           b.add_state(BlizzCFG::CHARGE_ID) if BlizzCFG::CHARGE_ID > 0
  1817.           make_charge_action_result(b, turns[1])
  1818.         end
  1819.       end
  1820.     end
  1821.     if battler == nil
  1822.       update_phase4_step2_charge_skill_later
  1823.     else
  1824.       update_phase4_step2_charge_skill_later(battler)
  1825.     end
  1826.     b.forget_skill(skill_id) if skill_id != nil
  1827.   end
  1828.  
  1829.   def make_charge_action_result(battler, trigger = nil)
  1830.     if battler.charging != nil && battler.charging[0] == 0
  1831.       battler.current_action, battler.charging = battler.charging[1], nil
  1832.       battler.remove_state(BlizzCFG::CHARGE_ID) if BlizzCFG::CHARGE_ID > 0
  1833.       return
  1834.     end
  1835.     @wait_count, battler.white_flash = 30, true
  1836.     @status_window.refresh
  1837.     if trigger
  1838.       @help_window.set_text($data_skills[battler.charging[1].skill_id].name, 1)
  1839.       battler.charging[1].skill_id = trigger
  1840.     else
  1841.       @help_window.set_text(battler.charging[0].to_s, 1)
  1842.     end
  1843.     @phase4_step = 3 if @phase4_step == 2
  1844.   end
  1845.  
  1846. end
  1847.  
  1848. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1849. # Energy Skill by Blizzard
  1850. # Version: 1.0
  1851. # Type: Enhanced Skill
  1852. # Date: 3.4.2008
  1853. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1854. #
  1855. # Compatibility:
  1856. #
  1857. #   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Could cause
  1858. #   problems with exotic CBS-es.
  1859. #
  1860. #
  1861. # Instructions:
  1862. #
  1863. # - Explanation:
  1864. #
  1865. #   This add-on allows you to create skills that deal damage equal to the
  1866. #   current HP of the user.
  1867. #  
  1868. # - Configuration  
  1869. #  
  1870. #   ENERGY_SKILL_IDS - include any IDs of Energy Skills and separate them with
  1871. #                      commas (i.e. [55, 56])
  1872. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1873.  
  1874. ENERGY_SKILL_IDS = [55, 56]
  1875.  
  1876. #==============================================================================
  1877. # Game_Battler
  1878. #==============================================================================
  1879.  
  1880. class Game_Battler
  1881.  
  1882.   alias skill_effect_energy_skill_later skill_effect
  1883.   def skill_effect(user, skill)
  1884.     last_hp = self.hp
  1885.     last_sr = self.sr if $crls && self.is_a?(Game_Actor)
  1886.     result = skill_effect_energy_skill_later(user, skill)
  1887.     if $game_system.ENERGY_SKILL && ENERGY_SKILL_IDS.include?(skill.id)
  1888.       self.hp = last_hp
  1889.       self.hp = self.hp
  1890.       self.sr = last_sr if $crls && self.is_a?(Game_Actor)
  1891.       if result
  1892.         self.damage = user.hp * skill.power / skill.power.abs
  1893.         self.hp -= self.damage
  1894.       end
  1895.     end
  1896.     return result
  1897.   end
  1898.  
  1899. end
  1900.  
  1901. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1902. # Master Thief Skill by Blizzard
  1903. # Version: 1.0b
  1904. # Type: Enhanced Skill
  1905. # Date: 19.10.2008
  1906. # Date v1.0b: 6.10.2009
  1907. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1908. #
  1909. #   This skill allows stealing items or gold from enemies or vice versa. The
  1910. #   skill success probability is multiplied with the enemy success probability
  1911. #   which makes it possible to make different skills and enemy combinations.
  1912. #   Success rates of skills higher than 100% will make it easier to steal from
  1913. #   enemies.
  1914. #  
  1915. #   Gold and item loot are slightly different. While only one item can be
  1916. #   stolen at the time, gold can be stolen all at once. The loot with a higher
  1917. #   success rate has priority over loot with lower success priority.
  1918. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1919.  
  1920. #==============================================================================
  1921. # module BlizzCFG
  1922. #==============================================================================
  1923.  
  1924. module BlizzCFG
  1925.  
  1926.   def self.steal_skill_database(id)
  1927.     case id
  1928. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1929. # START Steal Database
  1930. #
  1931. #   Use following template to create Stealing Skills:
  1932. #
  1933. #     when ID then return RATE
  1934. #
  1935. #   ID   - ID of the skill in the database
  1936. #   RATE - success multiplier rate in percents
  1937. #
  1938. #   Example:
  1939. #
  1940. #     when 23 then return 200
  1941. #     when 24 then return 100
  1942. #  
  1943. #   Skill with ID 23 will be twice as successful when stealing things than
  1944. #   skill with ID 24.
  1945. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1946.     when 23 then return 200
  1947.     when 24 then return 100
  1948.     when 25 then return 50
  1949.     when 57 then return 100
  1950. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1951. # END Demi Database
  1952. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1953.     end
  1954.     return 0
  1955.   end
  1956.  
  1957.   def self.weapon_loot_database(id)
  1958.     case id
  1959. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1960. # START Weapon Loot Database
  1961. #
  1962. #   Use following template to create weapon loot for enemies:
  1963. #
  1964. #     when ID then return [[WEAPON_ID1, AMOUNT1, RATE1], ...]
  1965. #
  1966. #   WEAPON_ID - ID of the item in the database
  1967. #   AMOUNT   - how many can be stolen
  1968. #   RATE     - success rate in percents
  1969. #
  1970. #   Example:
  1971. #
  1972. #     when 1 then return [[1, 2, 50], [4, 1, 10]]
  1973. #  
  1974. #   Enemy with ID 1 possesses 2 weapons of ID 1 and the success rate to steal
  1975. #   one is 50% and 1 weapon of ID 4 with a success rate of 10%.
  1976. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1977.     when 1 then return [[1, 2, 50], [2, 1, 10]]
  1978.     when 2 then return [[2, 1, 80]]
  1979. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1980. # END Item Loot Database
  1981. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1982.     end
  1983.     return []
  1984.   end
  1985.  
  1986.   def self.armor_loot_database(id)
  1987.     case id
  1988. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1989. # START Armor Loot Database
  1990. #
  1991. #   Use following template to create armor loot for enemies:
  1992. #
  1993. #     when ID then return [[ARMOR_ID1, AMOUNT1, RATE1], ...]
  1994. #
  1995. #   ARMOR_ID - ID of the item in the database
  1996. #   AMOUNT   - how many can be stolen
  1997. #   RATE     - success rate in percents
  1998. #
  1999. #   Example:
  2000. #
  2001. #     when 1 then return [[1, 2, 50], [4, 1, 10]]
  2002. #  
  2003. #   Enemy with ID 1 possesses 2 armors of ID 1 and the success rate to steal
  2004. #   one is 50% and 1 armor of ID 4 with a success rate of 10%.
  2005. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2006.     when 3 then return [[1, 1, 20], [2, 1, 30]]
  2007. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2008. # END Item Loot Database
  2009. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2010.     end
  2011.     return []
  2012.   end
  2013.  
  2014.   def self.item_loot_database(id)
  2015.     case id
  2016. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2017. # START Item Loot Database
  2018. #
  2019. #   Use following template to create item loot for enemies:
  2020. #
  2021. #     when ID then return [[ITEM_ID1, AMOUNT1, RATE1], ...]
  2022. #
  2023. #   ITEM_ID - ID of the item in the database
  2024. #   AMOUNT  - how many can be stolen
  2025. #   RATE    - success rate in percents
  2026. #
  2027. #   Example:
  2028. #
  2029. #     when 1 then return [[1, 2, 50], [4, 1, 10]]
  2030. #  
  2031. #   Enemy with ID 1 possesses 2 items of ID 1 and the success rate to steal one
  2032. #   is 50% and 1 item of ID 4 with a success rate of 10%.
  2033. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2034.     when 4 then return [[4, 1, 100]]
  2035. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2036. # END Item Loot Database
  2037. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2038.     end
  2039.     return []
  2040.   end
  2041.  
  2042.   def self.gold_loot_database(id)
  2043.     case id
  2044. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2045. # START Gold Loot Database
  2046. #
  2047. #   Use following template to create gold loot for enemies:
  2048. #
  2049. #     when ID then return [AMOUNT, BASE, RATE]
  2050. #
  2051. #   AMOUNT - how many can be stolen
  2052. #   BASE   - probability calculation base
  2053. #   RATE   - success rate in percents
  2054. #
  2055. #   Example:
  2056. #
  2057. #     when 3 then return [300, 100, 90]
  2058. #  
  2059. #   Enemy with ID 1 possesses 300 gold and the success rate to steal each 100
  2060. #   pieces of gold is 90%. Since the enemy has 300 gold, the success chance to
  2061. #   steal all 300 at once is 90% * 90% * 90% = 72.9%. If at first 100 gold was
  2062. #   stolen, the enemy is still in possession of 200 more gold hence the
  2063. #   success rate to steal the remaining 200 gold is 90% * 90% = 81%.
  2064. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2065.     when 1 then return [500, 50, 90]
  2066.     when 3 then return [1000, 200, 70]
  2067. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2068. # END Gold Loot Database
  2069. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2070.     end
  2071.     return nil
  2072.   end
  2073.  
  2074. end
  2075.  
  2076. #==============================================================================
  2077. # Game_Temp
  2078. #==============================================================================
  2079.  
  2080. class Game_Temp
  2081.  
  2082.   attr_accessor :loot_data
  2083.  
  2084. end
  2085.  
  2086. #==============================================================================
  2087. # Game_Battler
  2088. #==============================================================================
  2089.  
  2090. class Game_Battler
  2091.  
  2092.   alias skill_effect_master_thief_later skill_effect
  2093.   def skill_effect(user, skill)
  2094.     result = skill_effect_master_thief_later(user, skill)
  2095.     if $game_system.MASTER_THIEF && self.is_a?(Game_Enemy)
  2096.       rate = BlizzCFG.steal_skill_database(skill.id)
  2097.       self.set_loot(rate) if rate != 0
  2098.     end
  2099.     return result
  2100.   end
  2101.  
  2102. end
  2103.  
  2104. #==============================================================================
  2105. # Game_Enemy
  2106. #==============================================================================
  2107.  
  2108. class Game_Enemy
  2109.  
  2110.   alias init_master_thief_later initialize
  2111.   def initialize(troop_id, member_index)
  2112.     init_master_thief_later(troop_id, member_index)
  2113.     @loot = []
  2114.     BlizzCFG.weapon_loot_database(self.id).each {|w| @loot.push([0] + w)}
  2115.     BlizzCFG.armor_loot_database(self.id).each {|a| @loot.push([1] + a)}
  2116.     BlizzCFG.item_loot_database(self.id).each {|i| @loot.push([2] + i)}
  2117.     gold = BlizzCFG.gold_loot_database(self.id)
  2118.     @loot.push([3] + gold) if gold != nil
  2119.   end
  2120.  
  2121.   def set_loot(rate)
  2122.     possible_loot = self.get_possible_loot(rate)
  2123.     if possible_loot == nil
  2124.       $game_temp.loot_data = [false]
  2125.     elsif possible_loot.size == 0
  2126.       $game_temp.loot_data = [true]
  2127.     else
  2128.       $game_temp.loot_data = possible_loot.max {|a, b| a[2] <=> b[2]}
  2129.       if $game_temp.loot_data[0] == 3
  2130.         @loot.each_index {|i|
  2131.             if @loot[i][0] == 3
  2132.               @loot[i][1] -= $game_temp.loot_data[1]
  2133.               @loot[i] = nil if @loot[i][1] <= 0
  2134.             end}
  2135.         @loot.compact!
  2136.       else
  2137.         $game_temp.loot_data[2] -= 1
  2138.         @loot.delete($game_temp.loot_data) if $game_temp.loot_data[2] == 0
  2139.       end
  2140.     end
  2141.   end
  2142.  
  2143.   def get_possible_loot(rate)
  2144.     return nil if @loot.size == 0
  2145.     possible_loot = []
  2146.     @loot.each {|loot|
  2147.         if loot[0] == 3
  2148.           gold, rates = 0, 1.0
  2149.           (loot[1].to_f / loot[2]).ceil.times {
  2150.               if rand(100) < loot[3] * rate / 100
  2151.                 rates *= loot[3].to_f / 100
  2152.                 gold += loot[2]
  2153.               end}
  2154.           possible_loot.push([3, gold, 0, (rates * 100).to_i]) if gold != 0
  2155.         else
  2156.           possible_loot.push(loot) if rand(100) < loot[3] * rate / 100
  2157.         end}
  2158.     return possible_loot
  2159.   end
  2160.  
  2161. end
  2162.  
  2163. #==============================================================================
  2164. # Scene_Battle
  2165. #==============================================================================
  2166.  
  2167. class Scene_Battle
  2168.  
  2169.   alias update_phase4_step5_master_thief_later update_phase4_step5
  2170.   def update_phase4_step5(battler = nil)
  2171.     if battler != nil
  2172.       update_phase4_step5_master_thief_later(battler)
  2173.     else
  2174.       update_phase4_step5_master_thief_later
  2175.     end
  2176.     if $game_temp.loot_data != nil
  2177.       loot = nil
  2178.       case $game_temp.loot_data[0]
  2179.       when 0
  2180.         $game_party.gain_weapon($game_temp.loot_data[1], 1)
  2181.         loot = "#{$data_weapons[$game_temp.loot_data[1]].name} stolen"
  2182.       when 1
  2183.         $game_party.gain_armor($game_temp.loot_data[1], 1)
  2184.         loot = "#{$data_armors[$game_temp.loot_data[1]].name} stolen"
  2185.       when 2
  2186.         $game_party.gain_item($game_temp.loot_data[1], 1)
  2187.         loot = "#{$data_items[$game_temp.loot_data[1]].name} stolen"
  2188.       when 3
  2189.         $game_party.gain_gold($game_temp.loot_data[1])
  2190.         loot = "#{$game_temp.loot_data[1]} #{$data_system.words.gold} stolen"
  2191.       when true
  2192.         loot = 'Stealing failed'
  2193.       when false
  2194.         loot = 'Nothing left'
  2195.       end
  2196.       @help_window.set_text(loot, 1) if loot != nil
  2197.     end
  2198.   end
  2199.  
  2200.   alias update_phase4_step6_master_thief_later update_phase4_step6
  2201.   def update_phase4_step6(battler = nil)
  2202.     if $game_temp.loot_data != nil
  2203.       @help_window.visible, $game_temp.loot_data = false, nil
  2204.     end
  2205.     if battler != nil
  2206.       update_phase4_step6_master_thief_later(battler)
  2207.     else
  2208.       update_phase4_step6_master_thief_later
  2209.     end
  2210.   end
  2211.  
  2212. end
  2213.  
  2214. #==============================================================================
  2215. # HP Consuming Skill
  2216. # Author: game_guy
  2217. # Type: Custom Skill
  2218. # Version: 1.1
  2219. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2220. # - code reviewed, optimized, integrated into Tons of Add-ons, freed from
  2221. #   potential bugs and beta tested by Blizzard
  2222. # - this add-on is part of Tons of Add-ons with full permission of the original
  2223. #   author(s)
  2224. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2225. #==============================================================================
  2226. =begin
  2227. Intro:
  2228. Skills that consume HP instead of SP. Or even both HP and SP.
  2229.  
  2230. Instructions:
  2231. If you want skills that only consume HP simply set the skill's SP cost to 0.
  2232.  
  2233. Then go to CONFIG HP COST and follow the instructions there.
  2234. =end
  2235.  
  2236. #==============================================================================
  2237. # RPG::Skill
  2238. #==============================================================================
  2239.  
  2240. class RPG::Skill
  2241.  
  2242.   def hp_cost
  2243.     return 0 if !$game_system.HP_SKILL
  2244.     case @id
  2245.     #===================================
  2246.     # CONFIG HP COST
  2247.     # when SKILL_ID then return HP_COST
  2248.     #===================================
  2249.     when 57 then return 50
  2250.     #===================================
  2251.     end
  2252.     return 0
  2253.   end
  2254.  
  2255. end
  2256.  
  2257. #==============================================================================
  2258. # Game_Battler
  2259. #==============================================================================
  2260.  
  2261. class Game_Battler
  2262.  
  2263.   alias skill_can_use_hp_consuming_skills_later? skill_can_use?
  2264.   def skill_can_use?(id)
  2265.     if $data_skills[id].hp_cost > 0 && self.hp <= $data_skills[id].hp_cost
  2266.       return false
  2267.     end
  2268.     return skill_can_use_hp_consuming_skills_later?(id)
  2269.   end
  2270.  
  2271. end
  2272.  
  2273. #==============================================================================
  2274. # Scene_Battle
  2275. #==============================================================================
  2276.  
  2277. class Scene_Battle
  2278.  
  2279.   alias make_skill_action_result_hp_consuming_skills_later make_skill_action_result
  2280.   def make_skill_action_result(battler = nil)
  2281.     if battler != nil
  2282.       make_skill_action_result_hp_consuming_skills_later(battler)
  2283.     else
  2284.       make_skill_action_result_hp_consuming_skills_later
  2285.       battler = @active_battler
  2286.     end
  2287.     battler.hp -= @skill.hp_cost if @phase != 1 && @skill.hp_cost > 0
  2288.   end
  2289.  
  2290. end
  2291.  
  2292. #==============================================================================
  2293. # Scene_Skill
  2294. #==============================================================================
  2295.  
  2296. class Scene_Skill
  2297.  
  2298.   alias update_skill_hp_consuming_skills_later update_skill
  2299.   def update_skill
  2300.     update_skill_hp_consuming_skills_later
  2301.     if Input.trigger?(Input::C)
  2302.       return if @skill == nil || !@actor.skill_can_use?(@skill.id)
  2303.       if @skill.scope < 3 && @skill.common_event_id > 0
  2304.         @actor.hp -= @skill.hp_cost if @skill.hp_cost > 0
  2305.       end
  2306.     end
  2307.   end
  2308.  
  2309.   def update_target
  2310.     if Input.trigger?(Input::B)
  2311.       $game_system.se_play($data_system.cancel_se)
  2312.       @skill_window.active = true
  2313.       @target_window.visible = false
  2314.       @target_window.active = false
  2315.     elsif Input.trigger?(Input::C)
  2316.       unless @actor.skill_can_use?(@skill.id)
  2317.         $game_system.se_play($data_system.buzzer_se)
  2318.         return
  2319.       end
  2320.       used = false
  2321.       if @target_window.index == -1
  2322.         $game_party.actors.each {|actor|
  2323.             used |= actor.skill_effect(@actor, @skill)}
  2324.       elsif @target_window.index <= -2
  2325.         target = $game_party.actors[@target_window.index + 10]
  2326.         used = target.skill_effect(@actor, @skill)
  2327.       elsif @target_window.index >= 0
  2328.         target = $game_party.actors[@target_window.index]
  2329.         used = target.skill_effect(@actor, @skill)
  2330.       end
  2331.       if used
  2332.         $game_system.se_play(@skill.menu_se)
  2333.         @actor.sp -= @skill.sp_cost
  2334.         ### START EDIT
  2335.         @actor.hp -= @skill.hp_cost if @skill.hp_cost > 0
  2336.         ### END EDIT
  2337.         @status_window.refresh
  2338.         @skill_window.refresh
  2339.         @target_window.refresh
  2340.         if $game_party.all_dead?
  2341.           $scene = Scene_Gameover.new
  2342.         elsif @skill.common_event_id > 0
  2343.           $game_temp.common_event_id = @skill.common_event_id
  2344.           $scene = Scene_Map.new
  2345.         end
  2346.       else
  2347.         $game_system.se_play($data_system.buzzer_se)
  2348.       end
  2349.     end
  2350.   end
  2351.  
  2352. end
  2353.  
  2354. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  2355. #                                                                             #
  2356. #                            # ##### ##### #     #                            #
  2357. #                            #   #   #     ##   ##                            #
  2358. #                            #   #   ####  # # # #                            #
  2359. #                            #   #   #     #  #  #                            #
  2360. #                            #   #   ##### #     #                            #
  2361. #                                                                             #
  2362. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  2363.  
  2364. #==============================================================================
  2365. # Script : Skill Teaching Item
  2366. # Auther : game_guy
  2367. # Type : Custom Item
  2368. # Version : 1.01
  2369. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2370. # - code reviewed, optimized, integrated into Tons of Add-ons, freed from
  2371. #   potential bugs and beta tested by Blizzard
  2372. # - this add-on is part of Tons of Add-ons with full permission of the original
  2373. #   author(s)
  2374. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2375. #==============================================================================
  2376. =begin
  2377. Intro:
  2378. Makes items teach players skills.
  2379.  
  2380. Instructions:
  2381. First go in the database, go to the System Tab and make a new element id and name
  2382. it Skill Item. Come back in here and change the 17 below in the module to the id
  2383. of the element you just made.
  2384.  
  2385. Now go further below and you'll see
  2386. # CONFIG use
  2387. follow those instructions to set skills to item id's. Then you're set.
  2388.  
  2389. Features:
  2390. Makes items teach actors skills. Does not work with enemies.
  2391. =end
  2392.  
  2393. class RPG::Item
  2394.  
  2395.   def skills
  2396.     return [] if !$game_system.SKILL_TEACHING_ITEM
  2397.     case id
  2398.     # CONFIG use
  2399.     # when x return [y, z]
  2400.     # x = item id, y = skill id, z = skill id
  2401.     # when 2 then return [13, 12]
  2402.     # The above will make item id 2 make an actor learn the skill id of 13 and
  2403.     # skill id of 12
  2404.     # You can add as many IDs as you want, separate them with commas
  2405.     when 2 then return [13, 12]
  2406.     when 1 then return [1]
  2407.     end
  2408.     return []
  2409.   end
  2410.  
  2411. end
  2412.  
  2413. #==============================================================================
  2414. # Game_Battler
  2415. #==============================================================================
  2416.  
  2417. class Game_Battler
  2418.  
  2419.   alias item_effect_skillteachingitems item_effect
  2420.   def item_effect(item, battler = nil)
  2421.     if battler == nil
  2422.       result = item_effect_skillteachingitems(item)
  2423.     else
  2424.       result = item_effect_skillteachingitems(item, battler)
  2425.     end
  2426.     item.skills.each {|id|
  2427.         if !@skills.include?(id)
  2428.           learn_skill(id)
  2429.           result = true
  2430.         end}
  2431.     return result
  2432.   end
  2433.  
  2434. end
  2435.  
  2436. #==============================================================================
  2437. # Script : Level Up/Down Item
  2438. # Auther : game_guy
  2439. # Type : Custom Item
  2440. # Version : 1.01
  2441. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2442. # - code reviewed, optimized, integrated into Tons of Add-ons, freed from
  2443. #   potential bugs and beta tested by Blizzard
  2444. # - this add-on is part of Tons of Add-ons with full permission of the original
  2445. #   author(s)
  2446. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2447. #==============================================================================
  2448. =begin
  2449. Intro:
  2450. Remember in pokemon how rare candies leveled up your pokemon? This does the same.
  2451.  
  2452. Instructions:
  2453. Configuration is down there in module GameGuy.
  2454.  
  2455. Features:
  2456. Makes items level up and/or level down actors. Does not work with enemies.
  2457. =end
  2458.  
  2459. #==============================================================================
  2460. # module GameGuy
  2461. #==============================================================================
  2462.  
  2463. module GameGuy
  2464.   # Place level up items in there. Seperate with commas.
  2465.   LevelUpItems = [1, 3]
  2466.   # Place level down items in there. Seperate with commas.
  2467.   LevelDownItems = [2, 4]
  2468. end
  2469.  
  2470. #==============================================================================
  2471. # Game_Battler
  2472. #==============================================================================
  2473.  
  2474. class Game_Battler
  2475.  
  2476.   alias item_effect_level_up_items item_effect
  2477.   def item_effect(item, battler = nil)
  2478.     if battler == nil
  2479.       result = item_effect_level_up_items(item)
  2480.     else
  2481.       result = item_effect_level_up_items(item, battler)
  2482.     end
  2483.     return result if !$game_system.LEVEL_UPDOWN_ITEM
  2484.     level_up = GameGuy::LevelUpItems.include?(item.id)
  2485.     level_down = GameGuy::LevelDownItems.include?(item.id)
  2486.     if level_up && level_down
  2487.       self.level = self.level
  2488.       result = true
  2489.     elsif level_up
  2490.       old_level = self.level
  2491.       self.level += 1
  2492.       result |= (old_level != self.level)
  2493.     elsif level_down
  2494.       old_level = self.level
  2495.       self.level -= 1
  2496.       result |= (old_level != self.level)
  2497.     end
  2498.     return result
  2499.   end
  2500.  
  2501. end
Advertisement
Add Comment
Please, Sign In to add comment