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