Scripts/Icecrown Citadel: Fixed Mystic Buffet applying on targets hidden behind Ice Tombs

This commit is contained in:
Shauren
2012-04-08 15:15:16 +02:00
parent 2d0e5e2e0c
commit 5e485cba76
3 changed files with 47 additions and 0 deletions

View File

@@ -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');

View File

@@ -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();