MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
182
First Language
Meowish
Primarily Uses
Made for a request here.

This script allows a state to auto revive and heal the actor when he/she is dead during the state is applied.

Features:

[1] Auto revive when dead

[2] Able to set heal % for revive

[3] Able to set animation for revive

[4] Able to set whether or not to reset states when dead during the state is applied

How to Use:

[1] Paste the script below Material and above Main in your script editor

[2] Edit the settings area in the script accordingly

Compatibility:

This script is using alias method, so it's unlikely to cause any conflicts.

If you find it not working right, simple place this script below other custom script will do the trick.

Terms of Use:

Free for both commercial and non-commercial

Script:

Code:
#==============================================================================# ■ Meow Face Auto Revive#------------------------------------------------------------------------------# Auto Revive when dead#==============================================================================module MEOWREVIVE #DO NOT REMOVE!#==============================================================================# Settings Area#==============================================================================  STATE_ID = 28 #State ID that auto revive when dead  HEAL_PERCENT = 10 #HP% to heal when revive  ANIMATION_ID = 42 #Animation to Play when revived  CLEAR_STATES = true #Clear States when Dead (true/false)#==============================================================================# End of Settings Area# Edit anything past this line at your own risk!#==============================================================================endclass Game_Battler < Game_BattlerBase  alias meowdie die  def die    if state?(MEOWREVIVE::STATE_ID)      @hp = [mhp * MEOWREVIVE::HEAL_PERCENT / 100, 1].max      @animation_id = MEOWREVIVE::ANIMATION_ID      if MEOWREVIVE::CLEAR_STATES        clear_states        clear_buffs      end    else      meowdie    end  endend
 

Genesis7

Warper
Member
Joined
Apr 21, 2019
Messages
3
Reaction score
1
First Language
english
Primarily Uses
RMVXA
My goodness this site sometimes... Fixed because why not.

Code:
#==============================================================================
# ■ Meow Face Auto Revive
#------------------------------------------------------------------------------
# Auto Revive when dead
#==============================================================================

module MEOWREVIVE
  #DO NOT REMOVE!
#==============================================================================
# Settings Area
#==============================================================================

  STATE_ID = 31         # State ID that auto revive when dead
  HEAL_PERCENT = 30     # HP% to heal when revive
  ANIMATION_ID = 42     # Animation to Play when revived
  CLEAR_STATES = true   # Clear States when Dead (true/false)

end
#==============================================================================
# End of Settings Area
# Edit anything past this line at your own risk!
#==============================================================================

class Game_Battler < Game_BattlerBase
  alias meowdie die
  def die
    if state?(MEOWREVIVE::STATE_ID)
      @hp = [mhp * MEOWREVIVE::HEAL_PERCENT / 100, 1].max
      @animation_id = MEOWREVIVE::ANIMATION_ID
      if MEOWREVIVE::CLEAR_STATES
        clear_states
        clear_buffs
      end
    else
      meowdie
    end
  end
end
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,002
Reaction score
11,318
First Language
English
Primarily Uses
RMVXA
@Genesis7 Thanks for taking the time to reformat the script. Sadly, when the forum moved to new software some 3(?) years back, it messed up the formatting and not all scripters were still around to sort theirs out.
 
Joined
Sep 15, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Do you know if the script can be adjusted to where if the player dies, and comes back to life with the Autolife, they'll still be able to perform whatever action they were gonna use, whether if it was a skill, regular attack, use an item, etc.?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

So its confirmed MZ will have tile size locked at 48x48. So thats extremely lame. Still probably going to get it for the assets but Im gonna pout the whole time.
A friend used to ask why I don't colorize most of my drawings? The answer: I'm colorblind.
Thought something big was going down when I saw a riot van and two cop cars outside my home. Nope. Just multiple calls about one man kicking off in the street. xD
RPG Maker MZ does confirm in its RPG Maker website blog about new features. Graphics of course look gorgeous, but how about what keeps the engine together?
This image made me realize... My new sky area needs flying dominoes. :LZSexcite:

Though I will probably make them more awkward in some unforeseen way. :LZSwink:

Forum statistics

Threads
99,335
Messages
964,267
Members
130,943
Latest member
AngyGoose
Top