fix(Scripts/Naxx): Thaddius Ball Lightning should check all players i… (#24392)

Co-authored-by: victor <vngodoyr@unap.cl>
This commit is contained in:
Victor Godoy
2026-01-31 13:44:19 -03:00
committed by GitHub
parent 324d014bb8
commit 4864b800b0

View File

@@ -129,6 +129,15 @@ public:
uint32 resetTimer{};
bool ballLightningEnabled;
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;
}
void DoAction(int32 param) override
{
if (param == ACTION_SUMMON_DIED)
@@ -327,17 +336,11 @@ public:
break;
}
if (me->IsWithinMeleeRange(me->GetVictim()))
{
if (IsAnyPlayerInMeleeRange())
DoMeleeAttackIfReady();
}
else if (ballLightningEnabled)
{
else if (ballLightningEnabled && !IsAnyPlayerInMeleeRange())
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat))
{
me->CastSpell(target, SPELL_BALL_LIGHTNING, false);
}
}
}
};
};