Skip to content

fix(Scripts/HoR): clear IMMUNE_TO_PC before engaging Falric and Marwyn#25273

Open
Nyeriah wants to merge 2 commits intoazerothcore:masterfrom
Nyeriah:issue-25259
Open

fix(Scripts/HoR): clear IMMUNE_TO_PC before engaging Falric and Marwyn#25273
Nyeriah wants to merge 2 commits intoazerothcore:masterfrom
Nyeriah:issue-25259

Conversation

@Nyeriah
Copy link
Copy Markdown
Member

@Nyeriah Nyeriah commented Mar 27, 2026

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

AI-assisted Pull Requests

Important

While the use of AI tools when preparing pull requests is not prohibited, contributors must clearly disclose when such tools have been used and specify the model involved.

Contributors are also expected to fully understand the changes they are submitting and must be able to explain and justify those changes when requested by maintainers.

  • AI tools (e.g. ChatGPT, Claude, or similar) were used entirely or partially in preparing this pull request. Please specify which tools were used, if any.
    • Claude Code (claude-opus-4-6) with AzerothMCP for database research and verification.

Issues Addressed:

Description:

Same root cause as #25263 — after the TrinityCore heap-based threat system port (#24715) and the removal of auto-immunity-clearing in Creature::AtEngage (#25121), creatures with IMMUNE_TO_PC (0x100) in their creature_template.unit_flags that don't explicitly clear it before entering combat are broken.

Both Falric (38112) and Marwyn (38113) have unit_flags = 832 which includes IMMUNE_TO_PC. Their scripts call SetImmuneToAll(false) inside JustEngagedWith(), but by that point ThreatReference::FlagsAllowFighting() has already returned false for all threat references created during SetInCombatWithZone(), marking them as OFFLINE. This causes UpdateVictim() to return nullptr, so the bosses appear to never engage.

Fix: Add SetImmuneToPC(false) before SetInCombatWithZone() in the delayed combat start lambda for both Falric and Marwyn, ensuring threat references are created with proper flags.

SOURCE:

The changes have been validated through:

  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)

Source code analysis of ThreatManager.cpp (FlagsAllowFighting, ShouldBeOffline) confirming the interaction between IMMUNE_TO_PC and the new threat reference system. Same pattern as #25263.

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.
  1. Enter Halls of Reflection (Normal or Heroic)
  2. Complete the intro event and clear all 5 waves
  3. Verify Falric says his aggro line and engages in combat after ~8 seconds
  4. Kill Falric, clear waves 6-10
  5. Verify Marwyn similarly engages after his aggro line

Known Issues and TODO List:

  • Verify wipe/resume behavior still works correctly after the fix
  • Regression test Marwyn (wave 10) engagement

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

After the threat system port (azerothcore#24715) and removal of auto-immunity
clearing in AtEngage (azerothcore#25121), IMMUNE_TO_PC causes FlagsAllowFighting()
to return false, setting all threat references OFFLINE. This makes
UpdateVictim() return null so the bosses never process combat events.

Closes azerothcore#25259

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 27, 2026 23:23
@github-actions github-actions bot added Script Refers to C++ Scripts for the Core file-cpp Used to trigger the matrix build labels Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Halls of Reflection boss engagement after the threat-system changes by ensuring UNIT_FLAG_IMMUNE_TO_PC is cleared before SetInCombatWithZone() creates threat references, allowing Falric and Marwyn to properly acquire a victim and start their AI.

Changes:

  • Clear IMMUNE_TO_PC right before delayed SetInCombatWithZone() for Falric.
  • Clear IMMUNE_TO_PC right before delayed SetInCombatWithZone() for Marwyn.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp Clears PC-immunity before forcing zone combat so threat refs aren’t created OFFLINE.
src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp Same fix for Marwyn’s delayed combat start path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

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.

In Halls of Reflection (Heroic), the first boss does not engage and remains inactive.

2 participants