diff options
author | Mikhail Redko <ovitnez@gmail.com> | 2021-09-11 23:46:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 17:46:16 -0300 |
commit | 5286ecfca894df1f62b936d20c73d90eb89466ea (patch) | |
tree | 39e69b34da44ce653344f23ae174511fb7a462e7 | |
parent | 70c3e58327855eb0e05a235f31bf72e135846877 (diff) |
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
-rw-r--r-- | sql/updates/world/3.3.5/2021_09_11_00_world.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2021_09_11_00_world.sql b/sql/updates/world/3.3.5/2021_09_11_00_world.sql new file mode 100644 index 00000000000..39a5097bfa3 --- /dev/null +++ b/sql/updates/world/3.3.5/2021_09_11_00_world.sql @@ -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'); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 5e134b45f57..70842d399ab 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -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); |