Core/Spells: Implemented SPELL_AURA_ALLOW_TALENT_SWAPPING

Port From (https://github.com/TrinityCore/TrinityCore/commit/49b47047b809ce654661df595b14a5f8c1f01c8c)
This commit is contained in:
hondacrx
2021-03-08 13:36:49 -05:00
parent b0f951729f
commit 7b5c65244c
+16
View File
@@ -2106,6 +2106,22 @@ namespace Game.Spells
target.ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == AuraType.ModSkillTalent);
}
[AuraEffectHandler(AuraType.AllowTalentSwapping)]
void HandleAuraAllowTalentSwapping(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
return;
Player target = aurApp.GetTarget().ToPlayer();
if (target == null)
return;
if (apply)
target.AddUnitFlag2(UnitFlags2.AllowChangingTalents);
else if (!target.HasAuraType(GetAuraType()))
target.RemoveUnitFlag2(UnitFlags2.AllowChangingTalents);
}
/****************************/
/*** MOVEMENT ***/
/****************************/