Files
LonaRPG-Online-Games/ModScripts/100001_RemoveLevelCap.rb
T
2026-10-29 21:59:06 +04:00

36 lines
755 B
Ruby

# encoding: UTF-8
# Removes the vanilla level 99 cap by overriding Game_Actor#max_level.
# Keep it finite for compatibility with old UI/stat scripts.
if defined?(Game_Actor)
class Game_Actor
MP_LEVEL_CAP = 999 unless const_defined?(:MP_LEVEL_CAP)
if method_defined?(:max_level) && !method_defined?(:mp_level_cap_orig_max_level)
alias mp_level_cap_orig_max_level max_level
end
def max_level
base = 99
begin
base = mp_level_cap_orig_max_level.to_i
rescue
base = 99
end
cap = 999
begin
cap = MP_LEVEL_CAP.to_i
rescue
cap = 999
end
base = 1 if base <= 0
cap = 999 if cap <= 99
[base, cap].max
rescue
999
end
end
end