Advertisement
Black_Mage

Enemy HP SP Limit Exceed Script

May 11th, 2016
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.33 KB | None | 0 0
  1. #==============================================================================
  2. # Enemy HP SP Limit Exceed Script by Black Mage (Credit required to use)
  3. # Version : 1.1
  4. #
  5. # http://nazr.in/144U
  6. #==============================================================================
  7.  
  8. #==============================================================================
  9. # This script enable you to set a new limit for enemy's Max HP and Max SP.
  10. # This set also enable you to set enemy's Max HP and Max SP manually.
  11. #
  12. # To use this script, put it above Main script in the script editor.
  13. #==============================================================================
  14.  
  15. #==============================================================================
  16. # Changelog:
  17. #==============================================================================
  18. # Version 1.1 (19 April 2019)
  19. #   – Simplifying the codes.
  20. # Version 1.0 (11 May 2016)
  21. #   – Initial design.
  22. #==============================================================================
  23.  
  24. module BLACK
  25. #==============================================================================
  26. # Enemy MAX HP Limit Exceed
  27. #==============================================================================
  28. #
  29. # First, you need to set the HP limit. The default limit is 999999.
  30. # Note that this limit is also applied to character's HP limit.
  31.  
  32.   HP_LIMIT = 9999999999
  33.  
  34. # Make a hash for enemy id and their max hp.
  35.  
  36. #                enemy id     enemy hp
  37.   E_CUSTOM_HP = {1  =>        20000,
  38.                  2  =>        200,
  39.                  3  =>        123456789
  40.                  }
  41. #==============================================================================
  42.  
  43. #==============================================================================
  44. # Enemy MAX SP Limit Exceed
  45. #==============================================================================
  46. #
  47. # First, you need to set the SP limit. The default limit is 9999
  48. # Note that this limit is also applied to character's SP limit.
  49.  
  50.   SP_LIMIT = 9999999999
  51.  
  52. # Make a hash for enemy id and their max hp.
  53.   E_CUSTOM_SP = {6   =>        20000,
  54.                  10  =>        999991,
  55.                  12  =>        123456789
  56.                  }
  57. #==============================================================================
  58. end
  59.  
  60. #------------------------------------------------------------------------------
  61. # * Beyond this is the sacred land of code. You need programming qualification
  62. #   to dwelve deeper, or it'll cause many unnecessary problems. Proceed on your
  63. #   own risk.
  64. #------------------------------------------------------------------------------
  65.  
  66. class Game_Battler
  67.   include BLACK
  68.   def maxhp
  69.     n = [[base_maxhp + @maxhp_plus, 1].max, HP_LIMIT].min
  70.     for i in @states do n *= $data_states[i].maxhp_rate / 100.0 end
  71.     n = [[Integer(n), 1].max, HP_LIMIT].min
  72.     return n
  73.   end
  74.   def maxsp
  75.     n = [[base_maxsp + @maxsp_plus, 0].max, SP_LIMIT].min
  76.     for i in @states do n *= $data_states[i].maxsp_rate / 100.0 end
  77.     n = [[Integer(n), 0].max, SP_LIMIT].min
  78.     return n
  79.   end
  80. end
  81. class Game_Enemy < Game_Battler
  82.   def base_maxhp
  83.     E_CUSTOM_HP[@enemy_id.to_i] ? E_CUSTOM_HP[@enemy_id] : $data_enemies[@enemy_id].maxhp
  84.   end
  85.   def base_maxsp
  86.     E_CUSTOM_SP[@enemy_id.to_i] ? E_CUSTOM_SP[@enemy_id] : $data_enemies[@enemy_id].maxsp
  87.   end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement