Scripts/Spells: Add generic spell to handle ClearDebuffs spell

This commit is contained in:
Kito authored and Aokromes committed 2016-05-12 08:19:56 +02:00
1 parent b837b2a2e6
commit 5430da8e81
1 file changed
+35
@@ -4151,6 +4151,40 @@ public:
}
};
// 34098 - ClearAllDebuffs
class spell_gen_clear_debuffs : public SpellScriptLoader
{
public:
spell_gen_clear_debuffs() : SpellScriptLoader("spell_gen_clear_debuffs") { }
class spell_gen_clear_debuffs_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_clear_debuffs_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
{
target->RemoveOwnedAuras([](Aura const* aura)
{
SpellInfo const* spellInfo = aura->GetSpellInfo();
return !spellInfo->IsPositive() && !spellInfo->IsPassive();
});
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_clear_debuffs_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_clear_debuffs_SpellScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -4239,4 +4273,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_stand();
new spell_gen_mixology_bonus();
new spell_gen_landmine_knockback_achievement();
new spell_gen_clear_debuffs();
}