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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user