mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Scripts/Ulduar): rework Mimiron's Spinning Up cadence, arc anchoring and facing (#26917)
This commit is contained in:
@@ -1205,6 +1205,12 @@ private:
|
||||
uint8 _phase;
|
||||
};
|
||||
|
||||
// Sniffed P3Wx2 Laser Barrage arcs start at a fixed room angle and advance 60 degrees
|
||||
// counterclockwise each cycle, independent of the player targeted during Spinning Up.
|
||||
// Phase 4 restarts the sequence from the initial angle.
|
||||
constexpr float VX001_BARRAGE_ARC_START = 6.17f;
|
||||
constexpr float VX001_BARRAGE_ARC_STEP = static_cast<float>(M_PI / 3);
|
||||
|
||||
struct npc_ulduar_vx001 : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_vx001(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -1218,8 +1224,8 @@ struct npc_ulduar_vx001 : public ScriptedAI
|
||||
_phase = 0;
|
||||
_fighting = false;
|
||||
_leftArm = false;
|
||||
_spinningUpOrientation = 0;
|
||||
_spinningUpTimer = 0;
|
||||
_barrageOrientation = 0;
|
||||
_nextBarrageArc = VX001_BARRAGE_ARC_START;
|
||||
me->SetRegeneratingHealth(false);
|
||||
_events.Reset();
|
||||
}
|
||||
@@ -1241,6 +1247,7 @@ struct npc_ulduar_vx001 : public ScriptedAI
|
||||
case 2:
|
||||
_phase = 2;
|
||||
_fighting = true;
|
||||
_nextBarrageArc = VX001_BARRAGE_ARC_START;
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SPELL_CAST_OMNI);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
_events.Reset();
|
||||
@@ -1259,6 +1266,7 @@ struct npc_ulduar_vx001 : public ScriptedAI
|
||||
case 4:
|
||||
_phase = 4;
|
||||
_fighting = true;
|
||||
_nextBarrageArc = VX001_BARRAGE_ARC_START;
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_REINSTALL_ROCKETS, 3s);
|
||||
@@ -1275,7 +1283,7 @@ struct npc_ulduar_vx001 : public ScriptedAI
|
||||
|
||||
uint32 GetData(uint32 /*id*/) const override
|
||||
{
|
||||
return _spinningUpOrientation;
|
||||
return _barrageOrientation;
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
@@ -1339,19 +1347,6 @@ struct npc_ulduar_vx001 : public ScriptedAI
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (_spinningUpTimer) // executed about a second after starting casting to ensure players can see the correct direction
|
||||
{
|
||||
if (_spinningUpTimer <= diff)
|
||||
{
|
||||
float angle = (_spinningUpOrientation * 2 * M_PI) / 100.0f;
|
||||
me->SetFacingTo(angle);
|
||||
|
||||
_spinningUpTimer = 0;
|
||||
}
|
||||
else
|
||||
_spinningUpTimer -= diff;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -1414,15 +1409,15 @@ struct npc_ulduar_vx001 : public ScriptedAI
|
||||
_events.Repeat(1750ms);
|
||||
break;
|
||||
case EVENT_SPELL_SPINNING_UP:
|
||||
_events.Repeat(45s);
|
||||
if (Player* p = SelectTargetFromPlayerList(80.0f))
|
||||
_events.Repeat(60s);
|
||||
{
|
||||
float angle = me->GetAngle(p);
|
||||
float arc = _nextBarrageArc;
|
||||
|
||||
_spinningUpOrientation = (uint32)((angle * 100.0f) / (2 * M_PI));
|
||||
_spinningUpTimer = 1500;
|
||||
me->SetFacingTo(angle);
|
||||
me->CastSpell(p, SPELL_SPINNING_UP, true);
|
||||
_barrageOrientation = (uint32)((arc * 100.0f) / (2 * M_PI));
|
||||
_nextBarrageArc = Position::NormalizeOrientation(arc + VX001_BARRAGE_ARC_STEP);
|
||||
// The beams follow unit facing, so facing the arc start doubles as the telegraph
|
||||
me->SetFacingTo(arc);
|
||||
me->CastSpell(me, SPELL_SPINNING_UP, true);
|
||||
if (Unit* vehicle = me->GetVehicleBase())
|
||||
{
|
||||
vehicle->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_01);
|
||||
@@ -1497,8 +1492,8 @@ private:
|
||||
bool _isEvading;
|
||||
bool _fighting;
|
||||
bool _leftArm;
|
||||
uint32 _spinningUpOrientation;
|
||||
uint16 _spinningUpTimer;
|
||||
uint32 _barrageOrientation;
|
||||
float _nextBarrageArc;
|
||||
uint8 _phase;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user