mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
Scripts/Spells: Suppression Aura should not hit stealthed units. (#11270)
* 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>
This commit is contained in:
@@ -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');
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user