-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(Scripts/Naxx): Thaddius Ball Lightning should check all players i… #24392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| if (me->IsWithinMeleeRange(me->GetVictim())) | ||
| if (IsAnyPlayerInMeleeRange()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This IsAnyPlayerInMeleeRange is better part of the ballLightningEnabled check.
else if (ballLightningEnabled && !IsAnyPlayerInMeleeRange)| bool IsAnyPlayerInMeleeRange() const | ||
| { | ||
| for (auto const& ref : me->GetThreatMgr().GetThreatList()) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra brackets can be removed
https://www.azerothcore.org/wiki/cpp-code-standards#brackets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forced pushed commit
|
I faintly remember something like SelectNearestPlayer() existing |
…n melee range Ball Lightning was being cast even when melee players (other than the tank) were in range of the boss. Added IsAnyPlayerInMeleeRange() helper function to check if any player on the threat list is within melee range. Closes azerothcore#24372
b12bf4f to
62b7346
Compare
| bool IsAnyPlayerInMeleeRange() const | ||
| { | ||
| for (auto const& ref : me->GetThreatMgr().GetThreatList()) | ||
| if (Unit* target = ref->getTarget()) | ||
| if (target->IsPlayer() && me->IsWithinMeleeRange(target)) | ||
| return true; | ||
| return false; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just use SelectNearestTarget() to see if it returns anything within melee range
Ball Lightning was being cast even when melee players (other than the tank) were in range of the boss. Added IsAnyPlayerInMeleeRange() helper function to check if any player on the threat list is within melee range.
Closes #24372
Changes Proposed:
This PR proposes changes to:
AI-assisted Pull Requests
Claude was used to help analyze the code and identify the root cause of the issue.
Issues Addressed:
SOURCE:
The changes have been validated through:
Sources from the issue:
Both sources confirm Ball Lightning should only be cast when no players are in melee range.
Tests Performed:
This PR has been:
How to Test the Changes:
Known Issues and TODO List: