Core/Spells: Implemented SPELL_AURA_ALLOW_TALENT_SWAPPING
Port From (https://github.com/TrinityCore/TrinityCore/commit/49b47047b809ce654661df595b14a5f8c1f01c8c)
This commit is contained in:
@@ -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 ***/
|
||||
/****************************/
|
||||
|
||||
Reference in New Issue
Block a user