fix(Scripts/HyjalSummit): Couple Archimonde adjustments. (#19193)
* Init. Co-Authored-By: cyberium <cyberium@users.noreply.github.com> Co-Authored-By: killerwife <killerwife@users.noreply.github.com> * Corrections. * Adjust fear timer. * Wrong spell. * Whitespace. * Use the much cooler and more hip scheduler. * Correct teleport timers. Matches up with sniffed 3.4.3 data. * Swap magic number for constant. Co-Authored-By: killerwife <killerwife@users.noreply.github.com> * Adjust notation. * Public. Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Kitzunu's fault. Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --------- Co-authored-by: cyberium <cyberium@users.noreply.github.com> Co-authored-by: killerwife <killerwife@users.noreply.github.com> Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -143,35 +143,37 @@ struct npc_doomfire_spirit : public ScriptedAI
|
|||||||
{
|
{
|
||||||
npc_doomfire_spirit(Creature* creature) : ScriptedAI(creature){ }
|
npc_doomfire_spirit(Creature* creature) : ScriptedAI(creature){ }
|
||||||
|
|
||||||
|
float const turnConstant = 0.785402f;
|
||||||
|
float fAngle = urand(0, M_PI * 2);
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
ScheduleTimedEvent(0s, [&] {
|
ScheduleTimedEvent(0s, [&] {
|
||||||
me->GetMotionMaster()->MovePoint(NEAR_POINT, DoomfireMovement(me->GetPosition()));
|
float nextOrientation = Position::NormalizeOrientation(me->GetOrientation() + irand(-1, 1) * turnConstant);
|
||||||
}, 1500ms);
|
Position pos = GetFirstRandomAngleCollisionPosition(8.f, nextOrientation); // both orientation and distance verified with sniffs
|
||||||
|
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), nextOrientation);
|
||||||
|
}, 1600ms);
|
||||||
|
|
||||||
|
fAngle = urand(0, M_PI * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
Position DoomfireMovement(Position mePos)
|
Position GetFirstRandomAngleCollisionPosition(float dist, float angle)
|
||||||
{
|
{
|
||||||
float angle = mePos.GetOrientation();
|
Position pos;
|
||||||
float distance = 100.0f;
|
for (uint32 i = 0; i < 10; ++i)
|
||||||
float newAngle = angle + ((rand() % 181) - 90) * M_PI / 180;
|
{
|
||||||
float x = mePos.GetPositionX() + distance * cos(newAngle);
|
pos = me->WorldObject::GetFirstCollisionPosition(dist, angle);
|
||||||
float y = mePos.GetPositionY() + distance * sin(newAngle);
|
if (me->GetDistance(pos) > dist * 0.8f) // if at least 80% distance, good enough
|
||||||
|
break;
|
||||||
Position targetPos = Position(x, y, me->GetPositionZ());
|
angle += (M_PI / 5); // else try slightly different angle
|
||||||
return targetPos;
|
}
|
||||||
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
scheduler.Update(diff);
|
scheduler.Update(diff);
|
||||||
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -313,7 +315,7 @@ struct boss_archimonde : public BossAI
|
|||||||
DoCastVictim(SPELL_RED_SKY_EFFECT);
|
DoCastVictim(SPELL_RED_SKY_EFFECT);
|
||||||
DoCastVictim(SPELL_HAND_OF_DEATH);
|
DoCastVictim(SPELL_HAND_OF_DEATH);
|
||||||
}, 3s);
|
}, 3s);
|
||||||
scheduler.Schedule(25s, 35s, GROUP_FEAR, [this](TaskContext context)
|
scheduler.Schedule(40s, GROUP_FEAR, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
DoCastAOE(SPELL_FEAR);
|
DoCastAOE(SPELL_FEAR);
|
||||||
context.Repeat(42s);
|
context.Repeat(42s);
|
||||||
@@ -381,11 +383,6 @@ struct boss_archimonde : public BossAI
|
|||||||
summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN);
|
summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN);
|
||||||
summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, 0, 0, me->GetGUID());
|
summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, 0, 0, me->GetGUID());
|
||||||
}
|
}
|
||||||
else if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT)
|
|
||||||
{
|
|
||||||
Position randomPosition = summoned->GetRandomNearPosition(40.0f);
|
|
||||||
summoned->GetMotionMaster()->MovePoint(0, randomPosition);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
summoned->SetFaction(me->GetFaction()); //remove?
|
summoned->SetFaction(me->GetFaction()); //remove?
|
||||||
|
|||||||
Reference in New Issue
Block a user