Skip to content

Commit

Permalink
Scripts/Spells: Suppression Aura should not hit stealthed units. (#11270
Browse files Browse the repository at this point in the history
)

* Scripts/Spells: Suppression Aura should not hit stealthed units.

Fixes #11249

* Update.

* Update data/sql/updates/pending_db_world/rev_1648996451912542300.sql

Co-authored-by: Nefertumm <nefertum.dev@protonmail.com>
  • Loading branch information
UltraNix and Nefertumm committed Apr 7, 2022
1 parent f2a81d3 commit c047311
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/sql/updates/pending_db_world/rev_1648996451912542300.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1648996451912542300');

DELETE FROM `spell_script_names` WHERE `spell_id`=22247;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(22247,'spell_suppression_aura');
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "blackwing_lair.h"
#include "SpellScript.h"

enum Say
{
Expand Down Expand Up @@ -247,8 +248,28 @@ class go_suppression_device : public GameObjectScript
}
};

class spell_suppression_aura : public SpellScript
{
PrepareSpellScript(spell_suppression_aura);

void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if([&](WorldObject* target) -> bool
{
Unit* unit = target->ToUnit();
return !unit || unit->HasAuraType(SPELL_AURA_MOD_STEALTH);
});
}

void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_suppression_aura::FilterTargets, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
}
};

void AddSC_boss_broodlord()
{
new boss_broodlord();
new go_suppression_device();
RegisterSpellScript(spell_suppression_aura);
}

0 comments on commit c047311

Please sign in to comment.