diff options
author | SargeroDeV <83485584+SargeroDeV@users.noreply.github.com> | 2023-05-21 07:27:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 13:27:02 +0200 |
commit | f0aa85c99e79ed353d69f5dd1f760a4fdc339650 (patch) | |
tree | 1ae08b931988a1d5d30cf0d78d21febfe7bbf356 /src | |
parent | 907d9f1a79b838b043420f11a9a2122e3fa155c7 (diff) |
Spells/Scripts: Implement Critical Thinking (#29005)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 5e41251a4aa..551fb17055a 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -43,6 +43,7 @@ enum WarriorSpells SPELL_WARRIOR_CHARGE_SLOW_EFFECT = 236027, SPELL_WARRIOR_COLOSSUS_SMASH = 167105, SPELL_WARRIOR_COLOSSUS_SMASH_AURA = 208086, + SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE = 392776, SPELL_WARRIOR_EXECUTE = 20647, SPELL_WARRIOR_FUELED_BY_VIOLENCE_HEAL = 383104, SPELL_WARRIOR_GLYPH_OF_THE_BLAZING_TRAIL = 123779, @@ -272,6 +273,29 @@ private: bool _bonusHaste = false; }; +// 389306 - Critical Thinking +class spell_warr_critical_thinking : public AuraScript +{ + PrepareAuraScript(spell_warr_critical_thinking); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE }); + } + + void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo) + { + if (Optional<int32> rageCost = eventInfo.GetProcSpell()->GetPowerTypeCostAmount(POWER_RAGE)) + GetTarget()->CastSpell(nullptr, SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE, CastSpellExtraArgs(TRIGGERED_FULL_MASK) + .AddSpellBP0(CalculatePct(*rageCost, aurEff->GetAmount()))); + } + + void Register() override + { + AfterEffectProc += AuraEffectProcFn(spell_warr_critical_thinking::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } +}; + // 383103 - Fueled by Violence class spell_warr_fueled_by_violence : public AuraScript { @@ -796,6 +820,7 @@ void AddSC_warrior_spell_scripts() RegisterSpellScript(spell_warr_charge_drop_fire_periodic); RegisterSpellScript(spell_warr_charge_effect); RegisterSpellScript(spell_warr_colossus_smash); + RegisterSpellScript(spell_warr_critical_thinking); RegisterSpellScript(spell_warr_fueled_by_violence); RegisterSpellScript(spell_warr_heroic_leap); RegisterSpellScript(spell_warr_heroic_leap_jump); |