fix(Core/Spells): delete creatures threat list after taming them for t… (#10224)
This commit is contained in:
@@ -277,6 +277,17 @@ class spell_hun_taming_the_beast : public AuraScript
|
|||||||
{
|
{
|
||||||
PrepareAuraScript(spell_hun_taming_the_beast);
|
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*/)
|
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
{
|
{
|
||||||
if (Unit* target = GetTarget())
|
if (Unit* target = GetTarget())
|
||||||
@@ -286,6 +297,7 @@ class spell_hun_taming_the_beast : public AuraScript
|
|||||||
|
|
||||||
void Register() override
|
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);
|
OnEffectRemove += AuraEffectRemoveFn(spell_hun_taming_the_beast::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user