From d08e299974142e1354810d66ff09f5aa134a27f6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 15 Oct 2025 11:34:40 +0200 Subject: Core/Creatures: Fix boss level calculation --- src/server/game/Entities/Creature/Creature.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 2098fdaaad3..236788de292 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -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(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; -- cgit v1.2.3