mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Creatures: Fix boss level calculation
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user