diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-08-22 19:47:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-22 19:47:57 +0200 |
commit | 6f574a2bfcf6669aee52a68cfaf5c999b7473d76 (patch) | |
tree | 1ae7d517b75eff0aae4909e504237ce4b38e5bb2 /src | |
parent | e7448794057733f04d79319882323b7cebb36c6c (diff) |
Scripts/Spells: Implement guardian talent Dream of Cenarius (#30762)
Closes #29137
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 5c3fe103d10..abba7934f48 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -62,6 +62,8 @@ enum DruidSpells SPELL_DRUID_CULTIVATION_HEAL = 200389, SPELL_DRUID_CURIOUS_BRAMBLEPATCH = 330670, SPELL_DRUID_DREAMSTATE = 450346, + SPELL_DRUID_DREAM_OF_CENARIUS = 372152, + SPELL_DRUID_DREAM_OF_CENARIUS_COOLDOWN = 372523, SPELL_DRUID_EARTHWARDEN_AURA = 203975, SPELL_DRUID_ECLIPSE_DUMMY = 79577, SPELL_DRUID_ECLIPSE_LUNAR_AURA = 48518, @@ -475,6 +477,40 @@ class spell_dru_dash : public AuraScript } }; +// 372119 - Dream of Cenarius (Guardian) +class spell_dru_dream_of_cenarius_guardian : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DRUID_DREAM_OF_CENARIUS, SPELL_DRUID_DREAM_OF_CENARIUS_COOLDOWN }); + } + + bool CheckEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& /*eventInfo*/) const + { + if (GetUnitOwner()->HasAura(SPELL_DRUID_DREAM_OF_CENARIUS_COOLDOWN)) + return false; + + return roll_chance_f(GetUnitOwner()->GetUnitCriticalChanceDone(BASE_ATTACK)); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& /*procInfo*/) const + { + Unit* target = GetTarget(); + CastSpellExtraArgs args; + args.SetTriggeringAura(aurEff); + args.SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + + target->CastSpell(target, SPELL_DRUID_DREAM_OF_CENARIUS, args); + target->CastSpell(target, SPELL_DRUID_DREAM_OF_CENARIUS_COOLDOWN, args); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_dream_of_cenarius_guardian::CheckEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_dru_dream_of_cenarius_guardian::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + // 203974 - Earthwarden class spell_dru_earthwarden : public AuraScript { @@ -2390,6 +2426,7 @@ void AddSC_druid_spell_scripts() RegisterSpellScript(spell_dru_celestial_alignment); RegisterSpellScript(spell_dru_cultivation); RegisterSpellScript(spell_dru_dash); + RegisterSpellScript(spell_dru_dream_of_cenarius_guardian); RegisterSpellScript(spell_dru_earthwarden); RegisterSpellScript(spell_dru_eclipse_aura); RegisterSpellScript(spell_dru_eclipse_dummy); |