Help - Search - Members - Calendar
Full Version: Level Up help in XP
RPG RPG Revolution Forums > Scripting > Script Development and Support > Script Requests
MrDenimLP
I'm a fairly new user of RPG Maker XP - only having it for 4 days now - And I am wondering if it is possible to event or script in where whenever the hero or any of the party members level up, their HP and SP are reset to that level's maximum. Any ideas? And an answer in a tutorial-like format would great!
Resource Dragon
Moved to RGSS Script Requests. ~RD
MrDenimLP
Nvm, I found a script. Here it is if you want to use it:

#==============================================================================
# ** Heal On Level Up
# By Ccoa
#------------------------------------------------------------------------------
# When you level up all your HP and SP will be return to max
#==============================================================================

class Game_Actor < Game_Battler
alias exp_normal exp
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# Level up
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# Learn skill
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
# heal
@hp = self.maxhp
@sp = self.maxsp
end
# Level down
while @exp < @exp_list[@level]
@level -= 1
end
# Correction if exceeding current max HP and max SP
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.