fix(Scripts/EoE): fix Malygos Phase 3 Surge of Power targeting (10-man) (#26515)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
Andrew
2026-07-08 16:01:31 -03:00
committed by GitHub
parent 5239460d10
commit 0f107f2cd4
@@ -679,25 +679,29 @@ struct boss_malygos : public BossAI
{
for (uint8 i = 0; i < NUM_MAX_SURGE_TARGETS; ++i)
_surgeTargetGUID[i].Clear();
me->CastSpell((Unit*)nullptr, SPELL_SURGE_OF_POWER_WARN_SELECTOR_25, true);
DoCastAOE(SPELL_SURGE_OF_POWER_WARN_SELECTOR_25, true);
me->m_Events.AddEventAtOffset([this]
{
me->CastSpell((Unit*)nullptr, SPELL_PH3_SURGE_OF_POWER_25, true);
DoCastAOE(SPELL_PH3_SURGE_OF_POWER_25, true);
}, 3s);
}
else
{
for (uint8 i = 0; i < NUM_MAX_SURGE_TARGETS; ++i)
_surgeTargetGUID[i].Clear();
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, false, true, SPELL_RIDE_RED_DRAGON_BUDDY))
{
if (Vehicle* vehicle = target->GetVehicleKit())
if (Unit* passenger = vehicle->GetPassenger(0))
if (Player* player = passenger->ToPlayer())
Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, player);
ObjectGuid targetGuid = target->GetGUID();
me->m_Events.AddEventAtOffset([this, targetGuid]
SetGUID(target->GetGUID(), DATA_FIRST_SURGE_TARGET_GUID);
me->m_Events.AddEventAtOffset([this]
{
if (Unit* delayedTarget = ObjectAccessor::GetUnit(*me, targetGuid))
me->CastSpell(delayedTarget, SPELL_PH3_SURGE_OF_POWER, true);
DoCastAOE(SPELL_PH3_SURGE_OF_POWER, true);
}, 3s);
}
}
@@ -1277,15 +1281,22 @@ class spell_eoe_ph3_surge_of_power : public SpellScript
{
PrepareSpellScript(spell_eoe_ph3_surge_of_power);
bool Load() override
{
return GetCaster()->IsCreature();
}
void FilterTargets(std::list<WorldObject*>& targets)
{
// Target selection and warning are handled in boss AI.
// Here we just restrict area targets to the explicit cast target.
if (Unit* explTarget = GetExplTargetUnit())
// The spell targets an area, but only the drake that received the fixate warning
// should be hit. The boss AI stores that drake's GUID; keep only that target.
Creature* caster = GetCaster()->ToCreature();
ObjectGuid targetGuid = caster->AI()->GetGUID(DATA_FIRST_SURGE_TARGET_GUID);
targets.remove_if([targetGuid](WorldObject* target)
{
targets.clear();
targets.push_back(explTarget);
}
return target->GetGUID() != targetGuid;
});
}
void Register() override