Core/Players: Fixed traits not updating aura values when changing rank

Port From (https://github.com/TrinityCore/TrinityCore/commit/e6b553b913152667bcd1cfb79790ec70790d0f6e)
This commit is contained in:
Hondacrx
2025-08-18 10:32:35 -04:00
parent 51fbf8e33e
commit 32d166380c
4 changed files with 91 additions and 60 deletions
+31
View File
@@ -4107,7 +4107,38 @@ namespace Game.Spells
Unit casterUnit = null;
if (caster != null)
{
casterUnit = caster.ToUnit();
Player playerCaster = caster.ToPlayer();
if (playerCaster != null)
{
PlayerSpellTrait trait = playerCaster.GetTraitInfoForSpell(_spellInfo.Id);
if (trait != null)
{
var traitDefinitionEffectPoints = TraitMgr.GetTraitDefinitionEffectPointModifiers(trait.DefinitionId);
if (traitDefinitionEffectPoints != null)
{
var pointsOverride = traitDefinitionEffectPoints.Find(p => p.EffectIndex == EffectIndex);
if (pointsOverride != null)
{
float traitBasePoints = Global.DB2Mgr.GetCurveValueAt((uint)pointsOverride.CurveID, trait.Rank);
switch (pointsOverride.GetOperationType())
{
case TraitPointsOperationType.Set:
value = traitBasePoints;
break;
case TraitPointsOperationType.Multiply:
value *= traitBasePoints;
break;
case TraitPointsOperationType.None:
default:
break;
}
}
}
}
}
}
if (Scaling.Variance != 0)
{