Merge pull request #16848 from P-Kito/debuff_remove
[3.3.5/6.x] Scripts/Spells: Add generic spell to handle ClearDebuffs spell (cherry picked from commit b2bd181a5f5e183c0f22695f0ea094c8045b3f08)
This commit is contained in:
@@ -4152,6 +4152,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();
|
||||
@@ -4240,4 +4274,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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user