aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2016_04_09_13_world_2016_03_27_00_world.sql3
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp35
2 files changed, 38 insertions, 0 deletions
diff --git a/sql/updates/world/2016_04_09_13_world_2016_03_27_00_world.sql b/sql/updates/world/2016_04_09_13_world_2016_03_27_00_world.sql
new file mode 100644
index 00000000000..9421881c88a
--- /dev/null
+++ b/sql/updates/world/2016_04_09_13_world_2016_03_27_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_clear_debuffs';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(34098, 'spell_gen_clear_debuffs');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 85e94c19f93..14773601245 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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();
}