Scripts/Spells: Implement druid talent Astral Smolder (#30133)

This commit is contained in:
Aqua Deus
2024-08-19 16:05:55 +02:00
committed by GitHub
parent 2c06e7fcda
commit e9aafeff9c
2 changed files with 44 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ enum DruidSpells
{
SPELL_DRUID_ABUNDANCE = 207383,
SPELL_DRUID_ABUNDANCE_EFFECT = 207640,
SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE = 394061,
SPELL_DRUID_BALANCE_T10_BONUS = 70718,
SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721,
SPELL_DRUID_BEAR_FORM = 5487,
@@ -164,6 +165,41 @@ class spell_dru_abundance : public AuraScript
}
};
// 394058 - Astral Smolder
class spell_dru_astral_smolder : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellEffect({ { SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, EFFECT_0 } })
&& sSpellMgr->AssertSpellInfo(SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, DIFFICULTY_NONE)->GetMaxTicks();
}
bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
{
return eventInfo.GetProcTarget() != nullptr;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
{
PreventDefaultAction();
SpellInfo const* astralSmolderDmg = sSpellMgr->AssertSpellInfo(SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, GetCastDifficulty());
int32 pct = aurEff->GetAmount();
int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / astralSmolderDmg->GetMaxTicks());
CastSpellExtraArgs args(aurEff);
args.AddSpellMod(SPELLVALUE_BASE_POINT0, amount);
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, args);
}
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_astral_smolder::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_dru_astral_smolder::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
class spell_dru_base_transformer : public SpellScript
{
protected:
@@ -2094,6 +2130,7 @@ class spell_dru_yseras_gift_group_heal : public SpellScript
void AddSC_druid_spell_scripts()
{
RegisterSpellScript(spell_dru_abundance);
RegisterSpellScript(spell_dru_astral_smolder);
RegisterSpellScript(spell_dru_barkskin);
RegisterSpellScript(spell_dru_berserk);
RegisterSpellScript(spell_dru_brambles);