The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: worale on June 11, 2008, 08:11:45 AM

Title: Recover HP/MP/States when Level Up
Post by: worale on June 11, 2008, 08:11:45 AM
Recover HP/MP/States when Level Up
Version 1.0
by Woratana
Release Date: 10/06/2008


Introduction
Here is a little snippet I scripted after lost one VX game. :P
I just think that it should be easier (for player) if actors' status are recover when they level up. :D

Enjoy~  :lol:


Screenshots
-No screenshot-


Script
Place it above main
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi28.tinypic.com%2F25thhqt.jpg&hash=833f5ec2a8321d5a9849e130e03ba2e23cc6930b)
Code: [Select]
#===============================================================
# ? [VX] ? Recover HP/MP/States when Level Up ? ?
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 10/06/2008
# ? Version: 1.0
#--------------------------------------------------------------
# ? How to use:
# Put this script above main, you can setup script below
#=================================================================

class Game_Actor < Game_Battler
 
  #==================================
  # * SCRIPT SETUP PART
  #----------------------------------
  RECOVER_HP = true # Recover HP when level up? (true/false)
  RECOVER_MP = true # Recover MP when level up?
  REMOVE_STATES = true # Cure all states when level up?
  #==================================
 
  alias wora_fullhpmp_gamact_lvup level_up
  def level_up
    wora_fullhpmp_gamact_lvup
    @hp = maxhp if RECOVER_HP
    @mp = maxmp if RECOVER_MP
    if REMOVE_STATES
      @states.clone.each {|i| remove_state(i) }
    end
  end
end


Instruction
Place the script above main.
You can setup script in setup part if you don't want to recover all HP/MP/states when level up.


Author's Notes
Free for use in your work if credit is included.


Bug Report?
Please give me these informations:
Quote
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?
Title: Re: Recover HP/MP/States when Level Up
Post by: Shiriko1989 on June 11, 2008, 01:16:18 PM
COOL!!! Is just What I want!!! Err... How to setup...?
Title: Re: Recover HP/MP/States when Level Up
Post by: worale on June 11, 2008, 03:32:08 PM
Code: [Select]
  RECOVER_HP = true # Recover HP when level up? (true/false)
  RECOVER_MP = true # Recover MP when level up?
  REMOVE_STATES = true # Cure all states when level up?
Change true to false if you don't want to recover some of these. :D
Title: Re: Recover HP/MP/States when Level Up
Post by: modern algebra on June 11, 2008, 05:46:54 PM
This should be useful for a lot of people. Nice job worale.
Title: Re: Recover HP/MP/States when Level Up
Post by: ahref on June 12, 2008, 06:24:29 PM
i love how your scripts are vital features that a maker might want yet there so tiny. Kinda makes me wonder why enterbrain didnt write them :D.

good job
Title: Re: Recover HP/MP/States when Level Up
Post by: AfterDark on July 08, 2008, 10:24:00 AM
Thanks alot this is useful for me, and i bet it is for alot of other people
Title: Re: Recover HP/MP/States when Level Up
Post by: narcodis on July 29, 2008, 07:21:12 AM
Righteous Script!! so simple, but so great.