mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Core/Spell): Anti-Venom (#4711)
This commit is contained in:
@@ -907,6 +907,52 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_item_anti_venom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_anti_venom() : SpellScriptLoader("spell_item_anti_venom") {}
|
||||
|
||||
class spell_item_anti_venom_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_anti_venom_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
std::list<uint32> removeList;
|
||||
Unit::AuraMap const& auras = target->GetOwnedAuras();
|
||||
for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
Aura* aura = itr->second;
|
||||
if (aura->GetSpellInfo()->SpellLevel > 25 || aura->GetSpellInfo()->Dispel != DISPEL_POISON)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
removeList.push_back(aura->GetId());
|
||||
}
|
||||
|
||||
for (std::list<uint32>::const_iterator itr = removeList.begin(); itr != removeList.end(); ++itr)
|
||||
{
|
||||
target->RemoveAurasDueToSpell(*itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_anti_venom_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_item_anti_venom_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum GnomishShrinkRay
|
||||
{
|
||||
SPELL_GNOMISH_SHRINK_RAY_SELF = 13004,
|
||||
@@ -4272,6 +4318,7 @@ void AddSC_item_spell_scripts()
|
||||
new spell_item_feast();
|
||||
new spell_item_gnomish_universal_remote();
|
||||
new spell_item_strong_anti_venom();
|
||||
new spell_item_anti_venom();
|
||||
new spell_item_gnomish_shrink_ray();
|
||||
new spell_item_goblin_weather_machine();
|
||||
new spell_item_light_lamp();
|
||||
|
||||
Reference in New Issue
Block a user