Core/Spells: Aura refresh improvements
Port From (https://github.com/TrinityCore/TrinityCore/commit/6cd16b0ca9ff43b025e286f336b6af03c49b37db)
This commit is contained in:
@@ -2461,7 +2461,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
return (effMask & availableEffectMask);
|
return (effMask & availableEffectMask);
|
||||||
}
|
}
|
||||||
public static Aura TryRefreshStackOrCreate(AuraCreateInfo createInfo)
|
public static Aura TryRefreshStackOrCreate(AuraCreateInfo createInfo, bool updateEffectMask = true)
|
||||||
{
|
{
|
||||||
Cypher.Assert(createInfo.Caster != null || !createInfo.CasterGUID.IsEmpty());
|
Cypher.Assert(createInfo.Caster != null || !createInfo.CasterGUID.IsEmpty());
|
||||||
|
|
||||||
@@ -2491,9 +2491,13 @@ namespace Game.Spells
|
|||||||
Unit unit = createInfo.GetOwner().ToUnit();
|
Unit unit = createInfo.GetOwner().ToUnit();
|
||||||
|
|
||||||
// check effmask on owner application (if existing)
|
// check effmask on owner application (if existing)
|
||||||
AuraApplication aurApp = foundAura.GetApplicationOfTarget(unit.GetGUID());
|
if (updateEffectMask)
|
||||||
if (aurApp != null)
|
{
|
||||||
aurApp.UpdateApplyEffectMask(effMask);
|
AuraApplication aurApp = foundAura.GetApplicationOfTarget(unit.GetGUID());
|
||||||
|
if (aurApp != null)
|
||||||
|
aurApp.UpdateApplyEffectMask(effMask);
|
||||||
|
}
|
||||||
|
|
||||||
return foundAura;
|
return foundAura;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2133,7 +2133,7 @@ namespace Game.Spells
|
|||||||
createInfo.SetPeriodicReset(resetPeriodicTimer);
|
createInfo.SetPeriodicReset(resetPeriodicTimer);
|
||||||
createInfo.SetOwnerEffectMask(aura_effmask);
|
createInfo.SetOwnerEffectMask(aura_effmask);
|
||||||
|
|
||||||
Aura aura = Aura.TryRefreshStackOrCreate(createInfo);
|
Aura aura = Aura.TryRefreshStackOrCreate(createInfo, false);
|
||||||
if (aura != null)
|
if (aura != null)
|
||||||
{
|
{
|
||||||
hitInfo.HitAura = aura.ToUnitAura();
|
hitInfo.HitAura = aura.ToUnitAura();
|
||||||
@@ -2147,7 +2147,6 @@ namespace Game.Spells
|
|||||||
hitInfo.HitAura.ModStackAmount(m_spellValue.AuraStackAmount);
|
hitInfo.HitAura.ModStackAmount(m_spellValue.AuraStackAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
hitInfo.HitAura.SetDiminishGroup(hitInfo.DRGroup);
|
hitInfo.HitAura.SetDiminishGroup(hitInfo.DRGroup);
|
||||||
|
|
||||||
if (!m_spellValue.Duration.HasValue)
|
if (!m_spellValue.Duration.HasValue)
|
||||||
@@ -2189,6 +2188,9 @@ namespace Game.Spells
|
|||||||
hitInfo.HitAura.SetMaxDuration(hitInfo.AuraDuration);
|
hitInfo.HitAura.SetMaxDuration(hitInfo.AuraDuration);
|
||||||
hitInfo.HitAura.SetDuration(hitInfo.AuraDuration);
|
hitInfo.HitAura.SetDuration(hitInfo.AuraDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (createInfo.IsRefresh)
|
||||||
|
hitInfo.HitAura.AddStaticApplication(unit, aura_effmask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user