Core/Creatures: Fix boss level calculation

This commit is contained in:
Shauren
2025-10-15 11:34:40 +02:00
parent 0da653e9c1
commit d08e299974

View File

@@ -3077,8 +3077,6 @@ float Creature::GetHealthMultiplierForTarget(WorldObject const* target) const
return 1.0f;
uint8 levelForTarget = GetLevelForTarget(target);
if (GetLevel() < levelForTarget)
return 1.0f;
return double(GetMaxHealthByLevel(levelForTarget)) / double(GetCreateHealth());
}
@@ -3122,12 +3120,6 @@ uint8 Creature::GetLevelForTarget(WorldObject const* target) const
{
if (Unit const* unitTarget = target->ToUnit())
{
if (isWorldBoss())
{
uint8 level = unitTarget->GetLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
return RoundToInterval<uint8>(level, 1u, 255u);
}
// If this creature should scale level, adapt level depending of target level
// between UNIT_FIELD_SCALING_LEVEL_MIN and UNIT_FIELD_SCALING_LEVEL_MAX
if (HasScalableLevels())
@@ -3136,9 +3128,7 @@ uint8 Creature::GetLevelForTarget(WorldObject const* target) const
int32 scalingLevelMax = m_unitData->ScalingLevelMax;
int32 scalingLevelDelta = m_unitData->ScalingLevelDelta;
uint8 scalingFactionGroup = m_unitData->ScalingFactionGroup;
int32 targetLevel = unitTarget->m_unitData->EffectiveLevel;
if (!targetLevel)
targetLevel = unitTarget->GetLevel();
int32 targetLevel = unitTarget->GetEffectiveLevel();
int32 targetLevelDelta = 0;