Skip to content

fix(Scripts/MagtheridonsLair): prevent Hellfire Channelers from respawning during boss fight#25603

Open
TazzerMAN wants to merge 1 commit intoazerothcore:masterfrom
TazzerMAN:fix/magtheridon-channeler-respawn
Open

fix(Scripts/MagtheridonsLair): prevent Hellfire Channelers from respawning during boss fight#25603
TazzerMAN wants to merge 1 commit intoazerothcore:masterfrom
TazzerMAN:fix/magtheridon-channeler-respawn

Conversation

@TazzerMAN
Copy link
Copy Markdown

Changes Proposed:

This PR fixes a bug in Magtheridon's Lair where killing the 5 Hellfire Channelers in phase 1 caused them to respawn and rejoin the boss fight as soon as Magtheridon himself engaged the raid.

Root cause: SetBossState(DATA_MAGTHERIDON, IN_PROGRESS) was triggered late in the encounter (when Magtheridon engaged), at which point InstanceScript::UpdateMinionState() iterated over the registered minions (the Channelers) and called Respawn() on every dead one. The boss script never excluded that path.

Fix: transition the encounter to IN_PROGRESS as soon as the first Channeler enters combat. By the time Magtheridon's own JustEngagedWith runs, the state is already IN_PROGRESS and UpdateMinionState becomes a no-op for the dead Channelers.

Side benefit (intentional): room doors close and boss mods (DBM, etc.) are notified the moment a Channeler is engaged, rather than waiting for Magtheridon to attack a player. This matches the way the encounter behaves on retail.

Phase-1 wipe handling: since Magtheridon stays passive (immune to PC) until the last Channeler dies, his BossAI never triggers _EnterEvadeMode. The instance script now resets the encounter to NOT_STARTED when all Channelers have evaded; otherwise, after a phase-1 wipe, the room doors would stay locked. A new SmartAI hook on SMART_EVENT_EVADE for entry 17256 sends DATA_CHANNELER_COMBAT with data=0 to trigger the reset.

This PR proposes changes to:

  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

AI-assisted Pull Requests

  • AI tools (e.g. ChatGPT, Claude, or similar) were used entirely or partially in preparing this pull request.

I used Claude (Anthropic) to help analyze the AzerothCore source, identify the root cause, and draft the patch. I tested all scenarios in-game on a current master build (which already includes #25379) and I understand the changes I'm submitting.

Issues Addressed:

Related to #25375 (closed on 2026-04-05 by #25379). #25379 fixed the scheduler-vs-UpdateVictim deadlock in boss_magtheridon.cpp so Magtheridon now becomes engageable properly, but it did not touch the Channeler-respawn flow described above — that flow is what this PR addresses.

No open issue currently tracks the respawn bug. I'm happy to open one if a maintainer prefers having a dedicated issue reference.

SOURCE:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Knowledge databases or other public sources

On retail/Classic, killing the Hellfire Channelers permanently removes them for the duration of the encounter — they never respawn during phase 2/3. Confirmed via Wowhead, player guides and video evidence.

Tests Performed:

  • Tested in-game by the author.
  • Tested in-game by other community members.
  • This pull request requires further testing and may have edge cases to be tested.

I tested on a current master build (commit 295e45b0a, which includes #25379).

How to Test the Changes:

  • This pull request requires further testing.

Test scenarios

  1. Normal kill — Enter Magtheridon's Lair, attack one of the Hellfire Channelers. Expect: doors close immediately, encounter is IN_PROGRESS. Kill all 5 Channelers; wait for Magtheridon to be released; defeat him. Expect: no Channeler ever respawns during phase 2/3.

  2. Phase-1 wipe — Engage the Channelers, then wipe the raid. Expect: surviving Channelers evade and reset; once the last one is back home, the encounter resets to NOT_STARTED, doors open, and the raid can re-enter.

  3. Phase-1 leave — Engage a Channeler, then have everyone leave the room (Feign Death / vanish / out of range). Expect: same as wipe — encounter resets when Channelers evade.

  4. Phase 2/3 wipe — Kill all Channelers, engage Magtheridon, wipe. Expect: standard BossAI::_EnterEvadeMode reset; doors open. (Verifies the new code path doesn't interfere with the existing one.)

  5. Victory — Defeat Magtheridon. Expect: doors open, encounter state DONE.

Known Issues and TODO List:

  • None known. The fix is contained to the Magtheridon's Lair instance script and SmartAI for entry 17256.

@github-actions github-actions Bot added DB related to the SQL database Script Refers to C++ Scripts for the Core file-cpp Used to trigger the matrix build labels Apr 26, 2026
@Rorschach91 Rorschach91 requested a review from Nyeriah April 26, 2026 21:06
@Nyeriah
Copy link
Copy Markdown
Member

Nyeriah commented Apr 28, 2026

I'm not sure I'm seeing this one, the issue was that the boss resets/reenters combat switching from IN_COMBAT to NONE then IN_COMBAT again. Since the ads are registered as minions they would respawn when it changed to IN_COMBAT. I think the solution would rather be use formations to handle the respawn instead of the minion system and avoid the respawn measure in place

@TazzerMAN
Copy link
Copy Markdown
Author

Thanks for the feedback, @Nyeriah :)

Formations make sense. In the case I ran into, it wasn’t really an oscillation, but rather the first transition to IN_PROGRESS when Mag engages after the 5th Channeler dies. That said, I think it still comes from the same root cause.
For v2 if you want, I’ll remove them from minionData[] and add a formation with RESPAWN_ON_EVADE.
Quick question: should the doors still close when a Channeler is pulled, or only once Mag engages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB related to the SQL database file-cpp Used to trigger the matrix build Script Refers to C++ Scripts for the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants