Core/Auras: Corrected SPELL_AURA_MOD_HONOR_GAIN_PCT implementation - it should only increase honor gains from some sources

Port From (https://github.com/TrinityCore/TrinityCore/commit/c56d18287dad88b214b4a33ccd785484b165acbe)
This commit is contained in:
Hondacrx
2025-12-08 14:03:10 -05:00
parent b267c12273
commit b3b42d29ad
8 changed files with 35 additions and 15 deletions
+4 -4
View File
@@ -45,7 +45,7 @@ namespace Game.Entities
m_lastHonorUpdateTime = now;
}
public bool RewardHonor(Unit victim, uint groupsize, int honor = -1, bool pvptoken = false)
public bool RewardHonor(Unit victim, uint groupsize, int honor = -1, HonorGainSource source = HonorGainSource.Kill)
{
// do not reward honor in arenas, but enable onkill spellproc
if (InArena())
@@ -146,7 +146,7 @@ namespace Game.Entities
honor_f /= groupsize;
// apply honor multiplier from aura (not stacking-get highest)
MathFunctions.AddPct(ref honor_f, GetMaxPositiveAuraModifier(AuraType.ModHonorGainPct));
MathFunctions.AddPct(ref honor_f, GetMaxPositiveAuraModifierByMiscMask(AuraType.ModHonorGainPctFromSource, 1u << (int)source));
honor_f += _restMgr.GetRestBonusFor(RestTypes.Honor, (uint)honor_f);
}
@@ -173,11 +173,11 @@ namespace Game.Entities
Battleground bg = GetBattleground();
if (bg != null)
{
bg.UpdatePlayerScore(this, ScoreType.BonusHonor, (uint)honor, false); //false: prevent looping
bg.UpdatePlayerScore(this, ScoreType.BonusHonor, (uint)honor, false, source); //false: prevent looping
}
}
if (WorldConfig.GetBoolValue(WorldCfg.PvpTokenEnable) && pvptoken)
if (WorldConfig.GetBoolValue(WorldCfg.PvpTokenEnable) && source == HonorGainSource.Kill)
{
if (victim == null || victim == this || victim.HasAuraType(AuraType.NoPvpCredit))
return true;