Guest User

Untitled

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