diff options
| author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-06-08 20:06:41 +0200 |
|---|---|---|
| committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-06-08 20:06:41 +0200 |
| commit | 9505607d957ad4c74528ab1b37aa9a47bac6a518 (patch) | |
| tree | e863a1ede191781606cd3097c3b6d947997bfe47 /src/server/scripts | |
| parent | e1483329e0dd1abb3159aec8d22129d29672ff44 (diff) | |
Scripts/Spells: Proper target selection for 62775 - with thanks to Kaelima
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp index 1bc5e048ffa..732a61dff05 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp @@ -818,6 +818,46 @@ class spell_xt002_heart_overload_periodic : public SpellScriptLoader } }; +class PlayerOrPetCheck +{ + public: + bool operator() (Unit* unit) + { + if (unit->GetTypeId() != TYPEID_PLAYER) + if (!unit->ToCreature()->isPet()) + return true; + + return false; + } +}; + +class spell_xt002_tympanic_tantrum : public SpellScriptLoader +{ + public: + spell_xt002_tympanic_tantrum() : SpellScriptLoader("spell_xt002_tympanic_tantrum") { } + + class spell_xt002_tympanic_tantrum_SpellScript : public SpellScript + { + PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript); + + void FilterTargets(std::list<Unit*>& unitList) + { + unitList.remove_if(PlayerOrPetCheck()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC); + OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_AREA_ENEMY_SRC); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_xt002_tympanic_tantrum_SpellScript(); + } +}; + void AddSC_boss_xt002() { new mob_xt002_heart(); @@ -831,4 +871,5 @@ void AddSC_boss_xt002() new spell_xt002_searing_light_spawn_life_spark(); new spell_xt002_gravity_bomb_spawn_void_zone(); new spell_xt002_heart_overload_periodic(); + new spell_xt002_tympanic_tantrum(); } |
