Virulent Plague

This commit is contained in:
luis
2026-09-27 14:07:13 -03:00
parent 494468f669
commit 36aebfe1e8
+54
View File
@@ -115,6 +115,7 @@ enum DeathKnightSpells
SPELL_DK_SUBDUING_GRASP_TALENT = 454822,
SPELL_DK_UNHOLY = 137007,
SPELL_DK_UNHOLY_VIGOR = 196263,
SPELL_DK_VIRULENT_PLAGUE = 191587,
SPELL_DH_VORACIOUS_LEECH = 274009,
SPELL_DH_VORACIOUS_TALENT = 273953,
@@ -2061,6 +2062,58 @@ class spell_dk_dread_plague : public AuraScript
}
};
// 191587 - Virulent Plague
// The plague carries the periodic damage, the caster scaling and the dummy holding the spread
// radius, so the spreading is driven from the aura apply using the radius stored in effect 1.
class spell_dk_virulent_plague : public AuraScript
{
// Spreading applies the plague again, and that application would spread once more, so the
// nested applications are not allowed to spread or it never stops
bool _spreading = false;
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_VIRULENT_PLAGUE });
}
void HandleSpread(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (_spreading)
return;
Unit* caster = GetCaster();
Unit* target = GetTarget();
if (!caster || !target)
return;
float const radius = float(GetSpellInfo()->GetEffect(EFFECT_1).CalcBaseValue(caster, target, 0, 0));
if (radius <= 0.0f)
return;
std::list<Unit*> enemyList;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck check(target, caster, radius);
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(target, enemyList, check);
Cell::VisitAllObjects(target, searcher, radius);
_spreading = true;
for (Unit* unit : enemyList)
{
if (unit == target || unit->HasAura(SPELL_DK_VIRULENT_PLAGUE, caster->GetGUID()))
continue;
caster->CastSpell(unit, SPELL_DK_VIRULENT_PLAGUE, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
});
}
_spreading = false;
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_dk_virulent_plague::HandleSpread, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
// 1256576 - Forbidden Sacrifice (triggered by Putrefy when 1256565 - Forbidden Knowledge is known)
class spell_dk_forbidden_sacrifice : public AuraScript
{
@@ -2285,6 +2338,7 @@ void AddSC_deathknight_spell_scripts()
RegisterSpellScript(spell_dk_festering_strike);
RegisterSpellScript(spell_dk_festering_strike_scourge_strike);
RegisterSpellScript(spell_dk_dread_plague);
RegisterSpellScript(spell_dk_virulent_plague);
RegisterSpellScript(spell_dk_forbidden_sacrifice);
RegisterSpellScript(spell_dk_frozen_dominion);
RegisterSpellScript(spell_dk_pillar_of_frost);