Advertisement
Black_Mage

Special Equip Max HP SP Mod Script

Jan 16th, 2016
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.26 KB | None | 0 0
  1. ################################################################################
  2. # Special Equip Max HP SP Mod Script by Black Mage (Credit required to use)
  3. # Version : 1.0
  4. # https://burningwizard.wordpress.com/2016/01/16/special-equip-max-hp-sp-mod-script-rmxp-rgss/
  5. ################################################################################
  6.  
  7. # This script enable you to have an equip that increase and decrease mzx HP
  8. # or max MP of a character by equiping it.
  9.  
  10. # To use this script, put it above Main script in the script editor.
  11.  
  12. ################################################################################
  13. # MAX HP
  14. ################################################################################
  15. # Put the weapon ID on the brackets to have them increase max HP of whoever use it.
  16. $weaponhp      = [  1,  2, 10]
  17. # Put how much the HP will be increased if the weapon is equiped.
  18. $weaponvaluehp = [100,200,500]
  19. ################################################################################
  20. # Put the armor ID on the brackets to have them increase max HP of whoever use it.
  21. $armorhp       = [  1,  5,  3]
  22. # Put how much the HP will be increased if the armor is equiped.
  23. $armorvaluehp  = [200, 10,100]
  24. ################################################################################
  25.  
  26. ################################################################################
  27. # MAX MP
  28. ################################################################################
  29. # Put the weapon ID on the brackets to have them increase max HP of whoever use it.
  30. $weaponmp      = [  1,  2, 10]
  31. # Put how much the HP will be increased if the weapon is equiped.
  32. $weaponvaluemp = [100,200,500]
  33. ################################################################################
  34. # Put the armor ID on the brackets to have them increase max HP of whoever use it.
  35. $armormp       = [  1,  5,  3]
  36. # Put how much the HP will be increased if the armor is equiped.
  37. $armorvaluemp  = [200, 10,100]
  38. ################################################################################
  39.  
  40. $weaponplushp = []
  41. $armorplushp  = []
  42. $weaponplusmp = []
  43. $armorplusmp  = []
  44.  
  45. $data_weapons       = load_data("Data/Weapons.rxdata")
  46. $data_armors        = load_data("Data/Armors.rxdata")
  47.  
  48. for i in 0..$data_weapons.size
  49.   if $weaponhp.include?(i)
  50.   else
  51.     $weaponplushp[i] = 0
  52.   end  
  53. end
  54.  
  55. for i in 0..$data_armors.size
  56.   if $armorhp.include?(i)
  57.   else
  58.     $armorplushp[i] = 0
  59.   end  
  60. end
  61.  
  62. for i in 0..$data_weapons.size
  63.   if $weaponmp.include?(i)
  64.   else
  65.     $weaponplusmp[i] = 0
  66.   end  
  67. end
  68.  
  69. for i in 0..$data_armors.size
  70.   if $armormp.include?(i)
  71.   else
  72.     $armorplusmp[i] = 0
  73.   end  
  74. end
  75.  
  76. for i in 0..($weaponhp.size - 1)
  77.   $weaponplushp[$weaponhp[i]] = $weaponvaluehp[i]
  78. end
  79.  
  80. for i in 0..($armorhp.size - 1)
  81.   $armorplushp[$armorhp[i]] = $armorvaluehp[i]
  82. end
  83.  
  84. for i in 0..($weaponmp.size - 1)
  85.   $weaponplusmp[$weaponmp[i]] = $weaponvaluemp[i]
  86. end
  87.  
  88. for i in 0..($armormp.size - 1)
  89.   $armorplusmp[$armormp[i]] = $armorvaluemp[i]
  90. end
  91.  
  92.  
  93. class Game_Actor < Game_Battler
  94.   #--------------------------------------------------------------------------
  95.   # * Get Maximum HP
  96.   #--------------------------------------------------------------------------
  97.   def maxhp
  98.     n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
  99.     n = n + $weaponplushp[@weapon_id]
  100.     n = n + $armorplushp[@armor1_id]
  101.     n = n + $armorplushp[@armor2_id]
  102.     n = n + $armorplushp[@armor3_id]
  103.     n = n + $armorplushp[@armor4_id]
  104.     for i in @states
  105.       n *= $data_states[i].maxhp_rate / 100.0
  106.     end
  107.     n = [[Integer(n), 1].max, 9999].min
  108.     return n
  109.   end
  110.  
  111.   #--------------------------------------------------------------------------
  112.   # * Get Maximum SP
  113.   #--------------------------------------------------------------------------
  114.   def maxsp
  115.     n = [[base_maxsp + @maxsp_plus, 0].max, 9999].min
  116.     n = n + $weaponplusmp[@weapon_id]
  117.     n = n + $armorplusmp[@armor1_id]
  118.     n = n + $armorplusmp[@armor2_id]
  119.     n = n + $armorplusmp[@armor3_id]
  120.     n = n + $armorplusmp[@armor4_id]
  121.     for i in @states
  122.       n *= $data_states[i].maxsp_rate / 100.0
  123.     end
  124.     n = [[Integer(n), 0].max, 9999].min
  125.     return n
  126.   end
  127.  
  128. end
  129.  
  130. class Scene_Equip
  131.   def update_item
  132.     # If B button was pressed
  133.     if Input.trigger?(Input::B)
  134.       # Play cancel SE
  135.       $game_system.se_play($data_system.cancel_se)
  136.       # Activate right window
  137.       @right_window.active = true
  138.       @item_window.active = false
  139.       @item_window.index = -1
  140.       return
  141.     end
  142.     # If C button was pressed
  143.     if Input.trigger?(Input::C)
  144.       # Play equip SE
  145.       $game_system.se_play($data_system.equip_se)
  146.       # Get currently selected data on the item window
  147.       item = @item_window.item
  148.       # Change equipment
  149.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  150.       # Activate right window
  151.       @right_window.active = true
  152.       @item_window.active = false
  153.       @item_window.index = -1
  154.       # Remake right window and item window contents
  155.       @right_window.refresh
  156.       @item_window.refresh
  157.       if @actor.hp > @actor.maxhp
  158.         @actor.hp = @actor.maxhp
  159.       end
  160.       if @actor.sp > @actor.maxsp
  161.         @actor.sp = @actor.maxsp
  162.       end
  163.       return
  164.     end
  165.   end
  166. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement