diff options
| author | Nefertumm <nefertum.dev@protonmail.com> | 2022-02-04 11:27:20 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-04 15:27:20 +0100 |
| commit | 634e41fc1ca0b803253076b904a0bb13385bb41c (patch) | |
| tree | 5622068460ba7c0b7b1ea6d41452b085d0334644 /src | |
| parent | 3a0a9ba08833558a32198237f6d823e81097ec85 (diff) | |
fix(Core/Spells): delete creatures threat list after taming them for t… (#10224)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 6560329e3e..961528844a 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -277,6 +277,17 @@ class spell_hun_taming_the_beast : public AuraScript { PrepareAuraScript(spell_hun_taming_the_beast); + void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + { + if (Creature* creature = target->ToCreature()) + { + creature->DeleteThreatList(); + } + } + } + void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* target = GetTarget()) @@ -286,6 +297,7 @@ class spell_hun_taming_the_beast : public AuraScript void Register() override { + OnEffectApply += AuraEffectApplyFn(spell_hun_taming_the_beast::HandleOnEffectApply, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_hun_taming_the_beast::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL); } }; |
