Save-Point
KReviveOnce VX - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker VX/VXAce (RGSS2/3) Engines (https://www.save-point.org/forum-117.html)
+---- Thread: KReviveOnce VX (/thread-13347.html)



KReviveOnce VX - kyonides - 12-10-2025

KReviveOnce VX

by Kyonides

Introduction

Sometimes your heroes deserve a second chance to defeat that terrible mega boss. Or you might simply think that their story should not end because they were just too weak after an epic battle as to also Worried worry about facing a couple of slimes right away.

No matter what your excuse might be, now your heroes can be automatically revived once!

Just set a specific state ID and the HP percentage they will recover and that's it!

Happy with a sweat Of course, if a given hero dies without having that state listed at that critical moment, it's Skull game over for him or her! Laughing

The Script

Code:
# * KReviveOnce VX * #
#   Scripter : Kyonides
#   2025-12-10

# Let your heroes revive ONCE if they got a very specific state before
# they met their premature demises.

module KRevive
  ONCE_STATE_ID = 25
  ONCE_STATE_PERC = 25
end

class Game_Battler
  alias :kyon_revive_once_gm_btlr_remove_state :remove_state
  def check_revive_once(state_id)
    @can_revive = (KRevive::ONCE_STATE_ID == state_id and state?(state_id))
  end

  def remove_state(state_id)
    check_revive_once(state_id)
    kyon_revive_once_gm_btlr_remove_state(state_id)
    apply_revive_once
  end

  def apply_revive_once
    if @can_revive and !state?(KRevive::ONCE_STATE_ID) and @hp < 2
      @states.delete(1)
      @hp = maxhp * KRevive::ONCE_STATE_PERC
    end
    @can_revive = false
  end
end

Terms & Conditions

Free as in Beer beer.
Include me in your game credits.
That's it! Tongue sticking out