Title.
A script that activates a common event immediately after an actor or enemy lands a critical hit.
RGSS3 Script RequestsEDITED / 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
THANK YOU! You saved my day and helped my game being more fun right now.
I had to add the following warning:
Original thread: https://forums.rpgmakerweb.com/threads/a-script-that-activates-a-common-event-immediately-after-an-actor-or-enemy-lands-a-critical-hit.158109/