aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-10-15 11:34:40 +0200
committerShauren <shauren.trinity@gmail.com>2025-10-15 11:34:40 +0200
commitd08e299974142e1354810d66ff09f5aa134a27f6 (patch)
treec928b98eb665f7386eb6dd12e5c7cccc0ab39350 /src
parent0da653e9c131e78108e684a6567458ca8defe10e (diff)
Core/Creatures: Fix boss level calculation
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp12
1 files changed, 1 insertions, 11 deletions
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<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;