Core/Creatures: Compute the level from ContentTuning
Port From (https://github.com/TrinityCore/TrinityCore/commit/562f65f3f8f271fc52cc428c71a562af22829dc0)
This commit is contained in:
@@ -1425,16 +1425,11 @@ namespace Game.Entities
|
||||
|
||||
public void SelectLevel()
|
||||
{
|
||||
CreatureTemplate cInfo = GetCreatureTemplate();
|
||||
|
||||
// level
|
||||
var minMaxLevels = cInfo.GetMinMaxLevel();
|
||||
int minlevel = Math.Min(minMaxLevels[0], minMaxLevels[1]);
|
||||
int maxlevel = Math.Max(minMaxLevels[0], minMaxLevels[1]);
|
||||
int level = (minlevel == maxlevel ? minlevel : RandomHelper.IRand(minlevel, maxlevel));
|
||||
SetLevel((uint)level);
|
||||
|
||||
// Level
|
||||
ApplyLevelScaling();
|
||||
int levelWithDelta = m_unitData.ScalingLevelMax + m_unitData.ScalingLevelDelta;
|
||||
byte level = (byte)MathFunctions.RoundToInterval(ref levelWithDelta, 1, SharedConst.StrongMaxLevel);
|
||||
SetLevel(level);
|
||||
|
||||
UpdateLevelDependantStats();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user