fix(Scripts/ICC): Blood Queen Lana'thel allowing multiple Vampiric Bite targets due to missing difficulty-based aura checks#25349
Conversation
| uint8 difficulty = unit->GetMap()->GetSpawnMode(); | ||
|
|
||
| for (uint8 i = 0; i < 3; ++i) | ||
| if (unit->HasAura(vampireAuras[i][difficulty])) |
There was a problem hiding this comment.
I would say theres a function like hasAnyAura(..) taking multiple spell ids, also if these have entries in spell difficulty, the core probably automatically handles the different spell ids depending on raid difficulty
There was a problem hiding this comment.
Pull request overview
Fixes Blood Queen Lana'thel’s “double bite” targeting issue by ensuring vampire-state detection accounts for raid difficulty-specific aura spell IDs, preventing players (especially in heroic modes) from being considered valid bite targets after already being bitten.
Changes:
- Added a difficulty-indexed lookup table for the relevant “vampire” auras.
- Updated
IsVampire()to check the correct aura IDs based onMap::GetSpawnMode().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static uint32 const vampireAuras[3][4] = | ||
| { | ||
| {70867, 71473, 71532, 71533}, | ||
| {70879, 71525, 71530, 71531}, | ||
| {70877, 71474, 70877, 71474}, | ||
| }; | ||
|
|
||
| bool IsVampire(Unit const* unit) | ||
| { | ||
| if (unit->HasAnyAuras(SPELL_ESSENCE_OF_BLOOD_QUEEN, SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, SPELL_FRENZIED_BLOODTHIRST)) | ||
| return true; | ||
| uint8 difficulty = unit->GetMap()->GetSpawnMode(); | ||
|
|
||
| for (uint8 i = 0; i < 3; ++i) | ||
| if (unit->HasAura(vampireAuras[i][difficulty])) | ||
| return true; |
There was a problem hiding this comment.
IsVampire() now hardcodes a difficulty→spell mapping (vampireAuras) that duplicates the existing difficulty-resolution logic already used elsewhere in this script (e.g. sSpellMgr->GetSpellIdForDifficulty(SPELL_FRENZIED_BLOODTHIRST, ...)) and the DB-driven spelldifficulty_dbc entries (see data/sql/archive/db_world/2024_12_28_00.sql). This creates a second source of truth that can drift if spelldifficulty_dbc is updated.
Consider replacing vampireAuras with calls to sSpellMgr->GetSpellIdForDifficulty() for the 3 base spell IDs (Essence of Blood Queen / Essence of the Blood Queen (plr) / Frenzied Bloodthirst), and/or iterating difficulty using MAX_DIFFICULTY/Difficulty enums instead of hardcoding array sizes.
Players can be affected by Vampiric Bite multiple times during the Blood Queen Lana'thel encounter, especially in heroic difficulties.
This happens because the current IsVampire() check only validates auras from a single difficulty, ignoring other difficulty-specific spell IDs.
Changes Proposed:
This PR proposes changes to:
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.
Issues Addressed:
SOURCE:
The changes have been validated through:
Tests Performed:
This PR has been:
How to Test the Changes:
Known Issues and TODO List:
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.