Scripts/Spells: Proper target selection for 62775 - with thanks to Kaelima

This commit is contained in:
Machiavelli
2011-06-08 20:06:41 +02:00
parent e1483329e0
commit 9505607d95
4 changed files with 45 additions and 5 deletions
-5
View File
@@ -4023,11 +4023,6 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 62775: // Tympanic Tantrum
spellInfo->EffectRadiusIndex[EFFECT_0] = 12; // 100yds instead of 500
spellInfo->EffectRadiusIndex[EFFECT_1] = 12;
count++;
break;
// ENDOF ULDUAR SPELLS
//
// ICECROWN CITADEL SPELLS
@@ -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();
}