Scripts/Spells: Wandering Plague should ignore targets under breakabl… (#26889)

* Scripts/Spells: Wandering Plague should ignore targets under breakable by damage crowd control effects.
Closes TrinityCore#26162
This commit is contained in:
Mikhail Redko
2021-09-11 23:46:16 +03:00
committed by GitHub
parent 70c3e58327
commit 5286ecfca8
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_dk_wandering_plague_damage';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(50526, 'spell_dk_wandering_plague_damage');

View File

@@ -2104,6 +2104,26 @@ class spell_dk_wandering_plague : public AuraScript
}
};
// 50526 - Wandering Plague (Damage)
class spell_dk_wandering_plague_damage : public SpellScript
{
PrepareSpellScript(spell_dk_wandering_plague_damage);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if([](WorldObject* object) -> bool
{
Unit* target = object->ToUnit();
return target && target->HasBreakableByDamageCrowdControlAura();
});
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dk_wandering_plague_damage::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
// -52284 - Will of the Necropolis
class spell_dk_will_of_the_necropolis : public AuraScript
{
@@ -2758,6 +2778,7 @@ void AddSC_deathknight_spell_scripts()
RegisterSpellScript(spell_dk_vampiric_blood);
RegisterSpellScript(spell_dk_vendetta);
RegisterSpellScript(spell_dk_wandering_plague);
RegisterSpellScript(spell_dk_wandering_plague_damage);
RegisterSpellScript(spell_dk_will_of_the_necropolis);
RegisterSpellScript(spell_dk_death_grip_initial);
RegisterSpellScript(spell_dk_raise_ally_initial);