Skip to content

fix(Quest): make Doctor Sabnok immune to player damage#25682

Open
KaineOfficial wants to merge 2 commits intoazerothcore:masterfrom
KaineOfficial:fix/issue-25668-doctor-sabnok-immune
Open

fix(Quest): make Doctor Sabnok immune to player damage#25682
KaineOfficial wants to merge 2 commits intoazerothcore:masterfrom
KaineOfficial:fix/issue-25668-doctor-sabnok-immune

Conversation

@KaineOfficial
Copy link
Copy Markdown

Changes Proposed

Doctor Sabnok (NPC 30992) was attackable by the player during quest 13152 'A visit to the doctor'. The player could click on him and cast spells while the cinematic was playing, breaking the intended scripted fight where Patches kills him.

The OnSpawn SAI on entry 30992 was only setting UNIT_FLAG_NOT_SELECTABLE (256). That flag hides the target frame on the UI but it does not block AoE damage or already targeted abilities, so a player could still hit him.

Patches itself (NPC 30993) already uses the value 768 (NOT_SELECTABLE | IMMUNE_TO_PC) for the same purpose, so this PR aligns the Doctor with the same flag combination.

Issues Addressed

Closes #25668

How to Test the Changes

  1. .quest add 13152
  2. .go c i 30993 then click the apparatus to start the event
  3. When Doctor Sabnok arrives, try to target and cast on him

Before the fix, the cursor would highlight him and damage spells would land. After the fix he stays unselectable and immune to player damage, Patches kills him as intended.

Test Plan

  • Verified locally on a 3.3.5a server
  • Followed quest from start to completion
  • Confirmed Patches still receives the SetData event and the quest credits properly

Quest 13152 'A visit to the doctor', the player could attack and cast
spells on Doctor Sabnok (NPC 30992) during the cinematic. The OnSpawn
SAI was only setting UNIT_FLAG_NOT_SELECTABLE (256), which hides the
target frame but does not prevent damage.

Adding UNIT_FLAG_IMMUNE_TO_PC (512) so only Patches can damage him,
matching the flag combination already used on Patches itself (768).

Closes azerothcore#25668
@github-actions github-actions Bot added the DB related to the SQL database label May 1, 2026
@@ -0,0 +1,11 @@
--
-- Fix: Doctor Sabnok (NPC 30992) attackable by player during quest 13152 'A visit to the doctor'.
-- The OnSpawn SAI was setting only UNIT_FLAG_NOT_SELECTABLE (256), which hides the target frame
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wrong. This is UNIT_FLAG_IMMUNE_TO_PC, not UNIT_FLAG_NOT_SELECTABLE.

--
-- Fix: Doctor Sabnok (NPC 30992) attackable by player during quest 13152 'A visit to the doctor'.
-- The OnSpawn SAI was setting only UNIT_FLAG_NOT_SELECTABLE (256), which hides the target frame
-- but does not block damage. Adding UNIT_FLAG_IMMUNE_TO_PC (512) so only Patches can damage him.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Flag 512 is UNIT_FLAG_IMMUNE_TO_NPC.

-- Closes issue #25668.
--

UPDATE `smart_scripts`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This solution is incorrect. Sabnok spawns with Immune to Player active (row 6 of its SmartAI). The problem is in the last row of the action list 3099200 (remove unit flag immune to pc).
Removing that row, it will fix the issue.

@Rorschach91
Copy link
Copy Markdown
Member

If you are using an AI, please do not remove the section when it explicitly asks you if you are using it.
In addition, be careful using an AI in its chat version. If an AI doesn't have direct access to AzerothCore, its solutions will be based more on its speculations than the reality of things.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[QUEST] A visit to the doctor

2 participants