Core/Misc: Add functionality to allow low level quests/kills/discoveries to grant experience

Port From (https://github.com/TrinityCore/TrinityCore/commit/502f77fe8cb082843f7eb385159dd5038a059443)
This commit is contained in:
hondacrx
2021-02-02 10:28:22 -05:00
parent 3234d5c42c
commit 91459cde06
6 changed files with 86 additions and 9 deletions
+7
View File
@@ -136,6 +136,13 @@ namespace Game
baseGain = 0;
}
if (WorldConfig.GetIntValue(WorldCfg.MinCreatureScaledXpRatio) != 0 && pl_level != mob_level)
{
// Use mob level instead of player level to avoid overscaling on gain in a min is enforced
uint baseGainMin = BaseGain(pl_level, pl_level) * WorldConfig.GetUIntValue(WorldCfg.MinCreatureScaledXpRatio) / 100;
baseGain = Math.Max(baseGainMin, baseGain);
}
Global.ScriptMgr.OnBaseGainCalculation(baseGain, pl_level, mob_level);
return baseGain;
}