Help - Search - Members - Calendar
Full Version: Level Up Health
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS-Submissions
Jako Drako
This is a handy little script that adds the same amount of health and SP to the heros' current HP and SP as the max HP and SP. For example, as Tomtaru said, the hero enters battle with full health 10/10. In battle he is injured to 6/10 HP. When he defeats the monster(s), he gets enough exp to level up. Not only does the hero's max HP rise by 10, but so does his current HP. So at the end of the battle, the hero's health is now 6/10 + 10/10 = 16/20.
I thought it might be a good idea to post it in this forum so that more people could see it and benefit wink.gif

Open the Game_Actor script and find the exp=(exp) attribute (just use ctrl+f to search for it). Replace the code of the method with this:
CODE
# exp=(exp) attribute that allows level up healing
# modified by: Jako Drako
# Give credit!
def exp=(exp)
 temp_level = @level
 @exp = [[exp, 9999999].min, 0].max
 while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
   @level += 1
   for j in $data_classes[@class_id].learnings
     if j.level == @level
       learn_skill(j.skill_id)
     end
   end
 end
 while @exp < @exp_list[@level]
   @level -= 1
 end
 if temp_level != @level
   actor = $data_actors[@actor_id]
   level_difference = @level - temp_level
   @hp += actor.parameters[0, @level] - actor.parameters[0, @level - level_difference]
   @sp += actor.parameters[1, @level] - actor.parameters[1, @level - level_difference]
   if @hp > maxhp
     @hp = maxhp
   end
   if @sp > maxsp
     @sp = maxsp
   end
 end
end
Tomtaru
very handy little script tongue.gif and keep up the good work and thanks again :Smilie7: :Smilie7:
barcow
great script.
Jako Drako
Thankest thou??? I never get much acknoowledgement for my scripts... much appreciated!
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.