diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-04-08 15:15:16 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-04-08 15:15:16 +0200 |
commit | 5e485cba769d3b640d56a00ea179a8ee0090febc (patch) | |
tree | 862d1ebea031eff75eaa58245168bf7221f0eee9 | |
parent | 2d0e5e2e0c16ce1a7683ecf9cdc83cdc644d1eb0 (diff) |
Scripts/Icecrown Citadel: Fixed Mystic Buffet applying on targets hidden behind Ice Tombs
-rw-r--r-- | sql/updates/world/2012_04_08_01_world_creature_template.sql (renamed from sql/updates/world/2012_04_08_00_world_creature_template.sql) | 0 | ||||
-rw-r--r-- | sql/updates/world/2012_04_08_02_world_spell_script_names.sql | 6 | ||||
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 41 |
3 files changed, 47 insertions, 0 deletions
diff --git a/sql/updates/world/2012_04_08_00_world_creature_template.sql b/sql/updates/world/2012_04_08_01_world_creature_template.sql index c6665729b75..c6665729b75 100644 --- a/sql/updates/world/2012_04_08_00_world_creature_template.sql +++ b/sql/updates/world/2012_04_08_01_world_creature_template.sql diff --git a/sql/updates/world/2012_04_08_02_world_spell_script_names.sql b/sql/updates/world/2012_04_08_02_world_spell_script_names.sql new file mode 100644 index 00000000000..dd23c9ef560 --- /dev/null +++ b/sql/updates/world/2012_04_08_02_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_mystic_buffet'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(70127,'spell_sindragosa_mystic_buffet'), +(72528,'spell_sindragosa_mystic_buffet'), +(72529,'spell_sindragosa_mystic_buffet'), +(72530,'spell_sindragosa_mystic_buffet'); 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<Unit*>& 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(); |