CriticalAlert XP
#1
CriticalAlert XP

by Kyonides

Introduction

This scriptlet allows you to let the game call a preset common event whenever an actor or an enemy strikes the foe with a critical hit. The only thing you have to do is setting the appropriate common event ID's and that's it, guys! Grinning

XP Script

Code:
# * CriticalAlert XP * #
#  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_atk_fx :attack_effect
  alias :kyon_critical_alert_gm_bltr_skill_fx :skill_effect
  def attack_effect(attacker)
    result = kyon_critical_alert_gm_bltr_atk_fx(attacker)
    critical_hit_reserve_common_event(attacker)
    result
  end

  def skill_effect(user)
    result = kyon_critical_alert_gm_bltr_skill_fx(user)
    critical_hit_reserve_common_event(user)
    result
  end

  def critical_hit_reserve_common_event(user)
    return unless @critical
    if user.is_a?(Game_Actor)
      event_id = CriticalAlert::ACTOR_COMMON_EVENT_ID
    else
      event_id = CriticalAlert::ENEMY_COMMON_EVENT_ID
    end
    $game_temp.common_event_id = event_id
  end
end

Terms & Conditions

Free for use in any game.
Don't buy cat treats for a week! Tongue sticking out
That's it! Winking
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
CriticalAlert XP - by kyonides - 06-06-2023, 07:38 PM



Users browsing this thread: 1 Guest(s)