Skip to content

Bug: AutoBalance interfere with other mods (Dungeon-Master) #225

Description

@mattthhdp

Current Behaviour

DungeonMaster does call SetLevel(targetLevel) when spawning the rare creature, but AutoBalance later resets it when the party count changes.

In ABAllCreatureScript.cpp
Lines 319–376: ResetCreatureIfNeeded() restores the creature to its original database level/health.
Lines 438–454: because the map is AutoBalance-disabled, it leaves the creature at that original level.
Lines 246–289: this reset is triggered during creature updates.

When AutoBalance is disabled for a dungeon, DungeonMaster creates creatures with temporary target levels and custom health/damage values.
However, when:
A player joins or leaves the group
A player levels up
The party size changes
AutoBalance updates the map configuration timestamp. ResetCreatureIfNeeded() then resets creatures to their original database level and stats, even though the map is disabled.
The disabled-map check in ModifyCreatureAttributes() happens afterward, so the creature remains at its original level. This caused creatures to jump from the DungeonMaster target range to native levels such as 70 or 82.

Expected Behaviour

If an instance is off, for example AutoBalance.Enable.5M=0, AutoBalance should ignore it even if a player level up or other player join the party

When AutoBalance is disabled for a map:
AutoBalance must not reset creature levels or stats.
DungeonMaster’s custom creature scaling must remain intact.
Party changes and player level-ups must not restore database values.
Enabled maps must retain the existing AutoBalance recalculation behavior

Steps to reproduce the problem

Configure AutoBalance:
AutoBalance.Enable.Global=1
AutoBalance.Enable.5M=0
Restart the worldserver and create a fresh DungeonMaster Ragefire Chasm instance.

Enter alone with a level-16 character.

Confirm the challenge shows one player and a target range around levels 10–19:

Party Size: 1 player(s)
Creature levels: 10-19
Select a DungeonMaster creature and run:
.npc info
.ab mapstat
Before the bug, the creature should show a DungeonMaster target level, for example:
Level: 14
Health (max): 90
The map report:
AutoBalance DISABLED
World health multiplier: 1.000
Invite another level-16 player while remaining inside the instance.

Wait a few seconds, then run .npc info again.

Buggy result
The creature reverts to its database values instead of keeping DungeonMaster’s target level and stats. Examples observed:
Level: 70
Health (max): 6986
or:
Level: 82
Health (max): 5647
This also occurs when a player levels up or when the party size changes.

Extra Notes

Tested with a DungeonMaster Ragefire Chasm instance:
Solo creatures were correctly scaled to the dungeon target level.
Inviting another player no longer restored creatures to their original database levels.
Player level changes no longer reset DungeonMaster creature stats.
AutoBalance.Enable.5M=0 remains effective for five-player dungeons.

AutoBalance Debug Commands

No response

AC rev. hash/commit

11:08:22] Using SSL version: OpenSSL 3.0.13 30 Jan 2024 (library: OpenSSL 3.0.13 30 Jan 2024)
[11:08:22] Using Boost version: 1.83.0
[11:08:22] Using CMake version: 3.28.3
[11:08:22] Using MySQL version: 80046
[11:08:22] Found MySQL Executable: /usr/bin/mysql
[11:08:22] Compiled on: Linux 5.15.0-181-generic
[11:08:22] Worldserver listening connections on port 8085
[11:08:22] Realmlist (Realm Id: 1) configured in port 8085
[11:08:22] VMAPs status: Enabled. LineOfSight: true, getHeight: true, indoorCheck: true
[11:08:22] MMAPs status: Enabled
[11:08:22] maps directory located in /azerothcore/env/dist/data/maps. Total size: 291014951 bytes
[11:08:22] vmaps directory located in /azerothcore/env/dist/data/vmaps. Total size: 657797442 bytes
[11:08:22] mmaps directory located in /azerothcore/env/dist/data/mmaps. Total size: 2192760616 bytes
[11:08:22] Default DBC locale: enUS.
[11:08:22] All available DBC locales: enUS
[11:08:22] Using World DB: ACDB 335.17-dev
[11:08:22] Using Playerbots DB Revision:
[11:08:22] Latest LoginDatabase update: 2026_06_01_00.sql
[11:08:22] Latest CharacterDatabase update: playerbots_names.sql
[11:08:22] Latest WorldDatabase update: zone_zangarmarsh.sql
[11:08:22] LoginDatabase queue size: 0
[11:08:22] CharacterDatabase queue size: 0
[11:08:22] WorldDatabase queue size: 0
[11:08:22] PlayerbotsDatabase queue size: 0

Operating system

Ubuntu

Custom changes or Modules

Fix
Added an early disabled-map guard in ResetCreatureIfNeeded():
if (!mapABInfo->enabled)
{
creatureABInfo->mapConfigTime = mapABInfo->mapConfigTime;
return false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions