From 5e485cba769d3b640d56a00ea179a8ee0090febc Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Apr 2012 15:15:16 +0200 Subject: Scripts/Icecrown Citadel: Fixed Mystic Buffet applying on targets hidden behind Ice Tombs --- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 843966e5b1f..514bd112894 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1280,6 +1280,46 @@ class spell_sindragosa_icy_grip : public SpellScriptLoader } }; +class MysticBuffetTargetFilter +{ + public: + explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { } + + bool operator()(Unit* unit) + { + return !unit->IsWithinLOSInMap(_caster); + } + + private: + Unit* _caster; +}; + +class spell_sindragosa_mystic_buffet : public SpellScriptLoader +{ + public: + spell_sindragosa_mystic_buffet() : SpellScriptLoader("spell_sindragosa_mystic_buffet") { } + + class spell_sindragosa_mystic_buffet_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sindragosa_mystic_buffet_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(MysticBuffetTargetFilter(GetCaster())); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sindragosa_mystic_buffet_SpellScript(); + } +}; + class spell_rimefang_icy_blast : public SpellScriptLoader { public: @@ -1505,6 +1545,7 @@ void AddSC_boss_sindragosa() new spell_sindragosa_frost_beacon(); new spell_sindragosa_ice_tomb(); new spell_sindragosa_icy_grip(); + new spell_sindragosa_mystic_buffet(); new spell_rimefang_icy_blast(); new spell_frostwarden_handler_order_whelp(); new spell_frostwarden_handler_focus_fire(); -- cgit v1.2.3