Core/Auras: Fixed SPELLVALUE_AURA_STACK adding incorrect number of stacks on aura refresh

Port From (https://github.com/TrinityCore/TrinityCore/commit/4c605ce621a137f32cf02527d48e36fed1b6e235)
This commit is contained in:
Hondacrx
2025-08-09 21:38:54 -04:00
parent 59cfc97e15
commit e48d7c9778
5 changed files with 13 additions and 16 deletions
+2 -1
View File
@@ -919,6 +919,7 @@ namespace Game.Entities
AuraCreateInfo createInfo = new(castId, spellInfo, difficulty, key.EffectMask, this);
createInfo.SetCasterGUID(casterGuid);
createInfo.SetBaseAmount(info.BaseAmounts);
createInfo.SetStackAmount(stackCount);
Aura aura = Aura.TryCreate(createInfo);
if (aura != null)
@@ -928,7 +929,7 @@ namespace Game.Entities
aura.Remove();
continue;
}
aura.SetLoadedState(maxDuration, remainTime, remainCharges, stackCount, recalculateMask, info.Amounts);
aura.SetLoadedState(maxDuration, remainTime, remainCharges, recalculateMask, info.Amounts);
aura.ApplyForTargets();
Log.outInfo(LogFilter.Pet, "Added aura spellid {0}, effectmask {1}", spellInfo.Id, key.EffectMask);
}
+2 -1
View File
@@ -571,6 +571,7 @@ namespace Game.Entities
createInfo.SetCasterGUID(casterGuid);
createInfo.SetBaseAmount(info.BaseAmounts);
createInfo.SetCastItem(itemGuid, castItemId, castItemLevel);
createInfo.SetStackAmount(stackCount);
Aura aura = Aura.TryCreate(createInfo);
if (aura != null)
@@ -581,7 +582,7 @@ namespace Game.Entities
continue;
}
aura.SetLoadedState(maxDuration, remainTime, remainCharges, stackCount, recalculateMask, info.Amounts);
aura.SetLoadedState(maxDuration, remainTime, remainCharges, recalculateMask, info.Amounts);
aura.ApplyForTargets();
Log.outInfo(LogFilter.Player, "Added aura spellid {0}, effectmask {1}", spellInfo.Id, key.EffectMask);
}
+3 -2
View File
@@ -3245,6 +3245,7 @@ namespace Game.Entities
AuraCreateInfo createInfo = new(aura.GetCastId(), aura.GetSpellInfo(), aura.GetCastDifficulty(), effMask, stealer);
createInfo.SetCasterGUID(aura.GetCasterGUID());
createInfo.SetBaseAmount(baseDamage);
createInfo.SetStackAmount(stolenCharges);
Aura newAura = Aura.TryRefreshStackOrCreate(createInfo);
if (newAura != null)
@@ -3258,7 +3259,7 @@ namespace Game.Entities
caster.GetSingleCastAuras().Add(aura);
}
// FIXME: using aura.GetMaxDuration() maybe not blizzlike but it fixes stealing of spells like Innervate
newAura.SetLoadedState(aura.GetMaxDuration(), (int)dur, stealCharge ? stolenCharges : aura.GetCharges(), (byte)stolenCharges, recalculateMask, damage);
newAura.SetLoadedState(aura.GetMaxDuration(), (int)dur, stealCharge ? stolenCharges : aura.GetCharges(), recalculateMask, damage);
newAura.ApplyForTargets();
}
}
@@ -4262,7 +4263,7 @@ namespace Game.Entities
}
// try to increase stack amount
foundAura.ModStackAmount(1, AuraRemoveMode.Default, createInfo.ResetPeriodicTimer);
foundAura.ModStackAmount(createInfo.StackAmount, AuraRemoveMode.Default, createInfo.ResetPeriodicTimer);
return foundAura;
}
}