A script that activates a common event immediately after an actor or enemy lands a critical hit.

Koudelka

Regular
Regular
Joined
Oct 29, 2019
Messages
83
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,756
Reaction score
892
First Language
English
Primarily Uses
RMXP
EDITED / Expanded

Ruby:
# * CriticalAlert ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-06-06

# This scriptlet focuses on the attacker aka spellcaster.

module CriticalAlert
  ACTOR_COMMON_EVENT_ID = 1
  ENEMY_COMMON_EVENT_ID = 2
end

class Game_Battler
  alias :kyon_critical_alert_gm_bltr_exec_dmg :execute_damage
  def execute_damage(user)
    kyon_critical_alert_gm_bltr_exec_dmg(user)
    critical_hit_reserve_common_event(user)
  end

  def critical_hit_reserve_common_event(user)
    return unless @result.critical
    if user.actor?
      event_id = CriticalAlert::ACTOR_COMMON_EVENT_ID
    else
      event_id = CriticalAlert::ENEMY_COMMON_EVENT_ID
    end
    $game_temp.reserve_common_event(event_id)
  end
end
 
Last edited:

Koudelka

Regular
Regular
Joined
Oct 29, 2019
Messages
83
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
EDITED / Expanded

Ruby:
# * CriticalAlert ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-06-06

module CriticalAlert
  ACTOR_COMMON_EVENT_ID = 1
  ENEMY_COMMON_EVENT_ID = 2
end

class Game_Battler
  alias :kyon_critical_alert_gm_bltr_exec_dmg :execute_damage
  def execute_damage(user)
    kyon_critical_alert_gm_bltr_exec_dmg(user)
    critical_hit_reserve_common_event(user)
  end

  def critical_hit_reserve_common_event(user)
    return unless @result.critical
    if user.actor?
      event_id = CriticalAlert::ACTOR_COMMON_EVENT_ID
    else
      event_id = CriticalAlert::ENEMY_COMMON_EVENT_ID
    end
    $game_temp.reserve_common_event(event_id)
  end
end
THANK YOU! You saved my day and helped my game being more fun right now.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,756
Reaction score
892
First Language
English
Primarily Uses
RMXP
I had to add the following warning:

This scriptlet focuses on the attacker aka spellcaster.
 

Latest Threads

Latest Profile Posts

Resisting the urge to bust out watching spooky things all over. I still have days until it's Halloween month, gotta ration!
Made a free sample pack + leftovers. Free Sample Pack 1
I'm curious, how many hours in RPG Maker do you have? I'm clocked in at 2100 hours on MV and the vast majority of it is for one game. I wish I could track how much I used XP back in the day, I was on it a lot.
Why is it so early? Can I have twenty more minutes of sleep, please?
DK
Do you like this design?

GIF.gif

Forum statistics

Threads
134,810
Messages
1,250,849
Members
177,606
Latest member
Buffinto
Top