mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-07-10 19:03:11 +00:00
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:
@@ -679,25 +679,29 @@ struct boss_malygos : public BossAI
|
|||||||
{
|
{
|
||||||
for (uint8 i = 0; i < NUM_MAX_SURGE_TARGETS; ++i)
|
for (uint8 i = 0; i < NUM_MAX_SURGE_TARGETS; ++i)
|
||||||
_surgeTargetGUID[i].Clear();
|
_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->m_Events.AddEventAtOffset([this]
|
||||||
{
|
{
|
||||||
me->CastSpell((Unit*)nullptr, SPELL_PH3_SURGE_OF_POWER_25, true);
|
DoCastAOE(SPELL_PH3_SURGE_OF_POWER_25, true);
|
||||||
}, 3s);
|
}, 3s);
|
||||||
}
|
}
|
||||||
else
|
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 (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, false, true, SPELL_RIDE_RED_DRAGON_BUDDY))
|
||||||
{
|
{
|
||||||
if (Vehicle* vehicle = target->GetVehicleKit())
|
if (Vehicle* vehicle = target->GetVehicleKit())
|
||||||
if (Unit* passenger = vehicle->GetPassenger(0))
|
if (Unit* passenger = vehicle->GetPassenger(0))
|
||||||
if (Player* player = passenger->ToPlayer())
|
if (Player* player = passenger->ToPlayer())
|
||||||
Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, player);
|
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))
|
DoCastAOE(SPELL_PH3_SURGE_OF_POWER, true);
|
||||||
me->CastSpell(delayedTarget, SPELL_PH3_SURGE_OF_POWER, true);
|
|
||||||
}, 3s);
|
}, 3s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1277,15 +1281,22 @@ class spell_eoe_ph3_surge_of_power : public SpellScript
|
|||||||
{
|
{
|
||||||
PrepareSpellScript(spell_eoe_ph3_surge_of_power);
|
PrepareSpellScript(spell_eoe_ph3_surge_of_power);
|
||||||
|
|
||||||
|
bool Load() override
|
||||||
|
{
|
||||||
|
return GetCaster()->IsCreature();
|
||||||
|
}
|
||||||
|
|
||||||
void FilterTargets(std::list<WorldObject*>& targets)
|
void FilterTargets(std::list<WorldObject*>& targets)
|
||||||
{
|
{
|
||||||
// Target selection and warning are handled in boss AI.
|
// The spell targets an area, but only the drake that received the fixate warning
|
||||||
// Here we just restrict area targets to the explicit cast target.
|
// should be hit. The boss AI stores that drake's GUID; keep only that target.
|
||||||
if (Unit* explTarget = GetExplTargetUnit())
|
Creature* caster = GetCaster()->ToCreature();
|
||||||
|
ObjectGuid targetGuid = caster->AI()->GetGUID(DATA_FIRST_SURGE_TARGET_GUID);
|
||||||
|
|
||||||
|
targets.remove_if([targetGuid](WorldObject* target)
|
||||||
{
|
{
|
||||||
targets.clear();
|
return target->GetGUID() != targetGuid;
|
||||||
targets.push_back(explTarget);
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
|
|||||||
Reference in New Issue
Block a user