Scripts/Spells: Implement guardian talent Dream of Cenarius (#30762)

Closes #29137
This commit is contained in:
Aqua Deus
2025-08-22 19:47:57 +02:00
committed by GitHub
parent e744879405
commit 6f574a2bfc
2 changed files with 44 additions and 0 deletions

View File

@@ -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);