Skip to content

fix(Core/SmartAI): Suppress evade during SMART_ACTION_COMBAT_STOP#25249

Open
blinkysc wants to merge 1 commit intoazerothcore:masterfrom
blinkysc:fix/ring-of-blood-mogor-behavior
Open

fix(Core/SmartAI): Suppress evade during SMART_ACTION_COMBAT_STOP#25249
blinkysc wants to merge 1 commit intoazerothcore:masterfrom
blinkysc:fix/ring-of-blood-mogor-behavior

Conversation

@blinkysc
Copy link
Copy Markdown
Contributor

@blinkysc blinkysc commented Mar 26, 2026

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).

SMART_ACTION_COMBAT_STOP (action_type 27) calls CombatStop(true), which triggers JustExitedCombatEnterEvadeMode. This causes any SmartAI creature that uses this action to unintentionally evade — firing evade handlers (despawn, fail quest, reset faction, walk home) and breaking the script's intended flow.

The fix adds a mSuppressEvade flag to SmartAI that completely blocks EnterEvadeMode while SMART_ACTION_COMBAT_STOP is executing. This is stronger than mEvadeDisabled, which still processes SMART_EVENT_EVADE handlers.

Affected creatures (27 uses across ~20 creatures/actionlists):

  • Mogor (Ring of Blood) — fake death + resurrect broken
  • Phoenix (Kael'thas) — stops at low HP for egg mechanic
  • Argent Crusade NPCs (Korfax, Eligor, Tyrosus, etc.) — training fight surrenders
  • Death Knight Initiate — DK starter zone duels
  • Wastewalker Slave/Worker — freed from cages
  • Dark Portal NPCs — timed event combat stops
  • Private Hendel, Tapoke Jahn — quest scripted surrenders

AI-assisted Pull Requests

  • 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 with azerothMCP was used to investigate the issue, trace the evade chain through the codebase, and prepare the fix.

Issues Addressed:

SOURCE:

The changes have been validated through:

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

Code tracing confirmed CombatStop(true)EndAllPvECombat()CombatReference::EndCombat()JustExitedCombat()EnterEvadeMode(). Debug logging on a live server confirmed the full evade chain fires for Mogor entry 18069.

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.

Regression testing recommended for other creatures using SMART_ACTION_COMBAT_STOP listed above.

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. .go c id 18069 to teleport to Mogor's area (Ring of Blood, Nagrand)
  2. Complete the Ring of Blood quest chain up to quest 9977 "The Final Challenge"
  3. Accept quest 9977 from Gurgthock — Mogor spawns and engages
  4. Fight Mogor until he feign-deaths at ~1% HP
  5. Wait for resurrection — Mogor should get up, yell, and attack the player aggressively
  6. Verify Mogor is hostile and attackable (not following like a pet)
  7. Kill Mogor — quest should complete successfully

Known Issues and TODO List:

  • Other creatures using SMART_ACTION_COMBAT_STOP should be regression tested (see list above)

CombatStop(true) triggers JustExitedCombat -> EnterEvadeMode, which
fires evade handlers (despawn, fail quest, reset faction) breaking any
script that stops combat intentionally (e.g. fake death + resurrect).

Add mSuppressEvade flag to SmartAI that completely blocks EnterEvadeMode
while SMART_ACTION_COMBAT_STOP is executing.

Closes azerothcore#25246
@github-actions github-actions bot added CORE Related to the core file-cpp Used to trigger the matrix build labels Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE Related to the core file-cpp Used to trigger the matrix build Ready to be Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ring of Blood] Mogor behaviour Shadow Vault Decree

1 participant