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 -1
View File
@@ -5007,7 +5007,7 @@ namespace Game.Entities
uint k_grey = Formulas.GetGrayLevel(GetLevel());
// Victim level less gray level
if (v_level < k_grey)
if (v_level < k_grey && WorldConfig.GetIntValue(WorldCfg.MinCreatureScaledXpRatio) == 0)
return false;
Creature creature = victim.ToCreature();
@@ -6172,6 +6172,12 @@ namespace Game.Entities
XP = (uint)(Global.ObjectMgr.GetBaseXP(areaLevel) * WorldConfig.GetFloatValue(WorldCfg.RateXpExplore));
}
if (WorldConfig.GetIntValue(WorldCfg.MinDiscoveredScaledXpRatio) != 0)
{
uint minScaledXP = (uint)(Global.ObjectMgr.GetBaseXP(areaLevel) * WorldConfig.GetFloatValue(WorldCfg.RateXpExplore)) * WorldConfig.GetUIntValue(WorldCfg.MinDiscoveredScaledXpRatio) / 100;
XP = Math.Max(minScaledXP, XP);
}
GiveXP(XP, null);
SendExplorationExperience(areaId, XP);
}