Core/DataStores: Implemented new ContentTuning offset type

Port From (https://github.com/TrinityCore/TrinityCore/commit/584676e628a1ffd31800b18b7d6c7d00e9f390d1)
This commit is contained in:
Hondacrx
2024-08-25 14:07:58 -04:00
parent edb6934082
commit 2273f3f22d
2 changed files with 7 additions and 5 deletions
+4 -3
View File
@@ -1221,9 +1221,10 @@ namespace Framework.Constants
public enum ContentTuningCalcType public enum ContentTuningCalcType
{ {
Base = 0, None = 0,
PlusOne = 1, MinLevel = 1,
PlusMaxLevelForExpansion = 2 MaxLevel = 2,
PrevExpansionMaxLevel = 3
} }
[Flags] [Flags]
+3 -2
View File
@@ -1096,8 +1096,9 @@ namespace Game.DataStorage
static int getLevelAdjustment(ContentTuningCalcType type) => type switch static int getLevelAdjustment(ContentTuningCalcType type) => type switch
{ {
ContentTuningCalcType.PlusOne => 1, ContentTuningCalcType.MinLevel => 1,
ContentTuningCalcType.PlusMaxLevelForExpansion => (int)Global.ObjectMgr.GetMaxLevelForExpansion((Expansion)WorldConfig.GetUIntValue(WorldCfg.Expansion)), ContentTuningCalcType.MaxLevel => (int)Global.ObjectMgr.GetMaxLevelForExpansion((Expansion)WorldConfig.GetUIntValue(WorldCfg.Expansion)),
ContentTuningCalcType.PrevExpansionMaxLevel => (int)Global.ObjectMgr.GetMaxLevelForExpansion((Expansion)Math.Max(WorldConfig.GetUIntValue(WorldCfg.Expansion) - 1, 0)),
_ => 0 _ => 0
}; };