From 41c4d4e4a6ad6dedbb4e378d7573e368f0b2f9a6 Mon Sep 17 00:00:00 2001 From: Ovahlord <18347559+ovahlord@users.noreply.github.com> Date: Thu, 27 Aug 2026 17:00:12 +0200 Subject: [PATCH] Core/Creatures: fixed creature aggro radius calculation --- src/server/game/Entities/Creature/Creature.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index a0a9b3a2f3..f320a34beb 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2172,17 +2172,14 @@ float Creature::GetAttackDistance(Unit const* player) const float maxRadius = 45.0f * aggroRate; float minRadius = 5.0f * aggroRate; - int32 expansionMaxLevel = int32(GetMaxLevelForExpansion(GetCreatureTemplate()->RequiredExpansion)); + int32 expansionMaxLevel = int32(GetMaxLevelForExpansion(GetCreatureDifficulty()->GetHealthScalingExpansion())); int32 playerLevel = player->GetLevelForTarget(this); int32 creatureLevel = GetLevelForTarget(player); - int32 levelDifference = creatureLevel - playerLevel; - // The aggro radius for creatures with equal level as the player is 20 yards. + // The aggro radius for creatures with equal level as the player is 15 yards. // The combatreach should not get taken into account for the distance so we drop it from the range (see Supremus as expample) - float baseAggroDistance = 20.0f - GetCombatReach(); - - // + - 1 yard for each level difference between player and creature - float aggroRadius = baseAggroDistance + float(levelDifference); + float baseAggroDistance = 15.0f - GetCombatReach(); + float aggroRadius = baseAggroDistance; // detect range auras if (uint32(creatureLevel + 5) <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -2196,6 +2193,8 @@ float Creature::GetAttackDistance(Unit const* player) const // The following code is used for blizzlike behaviour such as skippable bosses if (creatureLevel > expansionMaxLevel) aggroRadius = baseAggroDistance + float(expansionMaxLevel - playerLevel); + else // + - 1 yard for each level difference between player and creature + aggroRadius += float(creatureLevel - playerLevel); // Make sure that we wont go over the total range limits if (aggroRadius > maxRadius)