fix(Scripts/TheEye): ensure Ember of Al'ar always spawn in the right spot (#18511)

init
This commit is contained in:
Dan
2024-03-09 15:08:23 +01:00
committed by GitHub
parent 81d781388b
commit db7475f4f5

View File

@@ -139,7 +139,7 @@ struct boss_alar : public BossAI
if (_noQuillTimes++ > 0)
{
me->SetOrientation(alarPoints[_platform].GetOrientation());
SpawnPhoenixes(1, me, false);
SpawnPhoenixes(1, me);
}
me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[_platform], false, true);
_platform = (_platform+1)%4;
@@ -247,21 +247,14 @@ struct boss_alar : public BossAI
ScheduleMainSpellAttack(0s);
}
void SpawnPhoenixes(uint8 count, Unit* targetToSpawnAt, bool onPosition)
void SpawnPhoenixes(uint8 count, Unit* targetToSpawnAt)
{
if (targetToSpawnAt)
{
Position spawnPosition = DeterminePhoenixPosition(targetToSpawnAt->GetPosition());
for (uint8 i = 0; i < count; ++i)
{
if (onPosition)
{
Position spawnPosition = DeterminePhoenixPosition(targetToSpawnAt->GetPosition());
me->SummonCreature(NPC_EMBER_OF_ALAR, spawnPosition, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
}
else
{
me->SummonCreature(NPC_EMBER_OF_ALAR, *targetToSpawnAt, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
}
me->SummonCreature(NPC_EMBER_OF_ALAR, spawnPosition, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
}
}
}
@@ -273,7 +266,7 @@ struct boss_alar : public BossAI
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
{
SpawnPhoenixes(2, target, true);
SpawnPhoenixes(2, target);
}
}).Schedule(6s, [this](TaskContext)
{