mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Scripts/ScarletEnclave: reworked Eye of Acherus script (#23953)
* updated script model to new standard * corrected spell usage and timers based on sniff data * removed hacks
This commit is contained in:
@@ -396,131 +396,123 @@ class spell_death_knight_initiate_visual : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
/*######
|
||||
## npc_eye_of_acherus
|
||||
######*/
|
||||
|
||||
enum EyeOfAcherusMisc
|
||||
{
|
||||
SPELL_THE_EYE_OF_ACHERUS = 51852,
|
||||
SPELL_EYE_VISUAL = 51892,
|
||||
SPELL_EYE_FLIGHT_BOOST = 51923,
|
||||
SPELL_EYE_FLIGHT = 51890,
|
||||
SPELL_THE_EYE_OF_ACHERUS = 51852,
|
||||
SPELL_EYE_OF_ACHERUS_VISUAL = 51892,
|
||||
SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST = 51923,
|
||||
SPELL_EYE_OF_ACHERUS_FLIGHT = 51890,
|
||||
SPELL_ROOT_SELF = 51860,
|
||||
|
||||
EVENT_MOVE_START = 1,
|
||||
EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION = 1,
|
||||
EVENT_UNROOT = 2,
|
||||
EVENT_LAUNCH_TOWARDS_DESTINATION = 3,
|
||||
EVENT_GRANT_CONTROL = 4,
|
||||
|
||||
TALK_MOVE_START = 0,
|
||||
TALK_CONTROL = 1,
|
||||
SAY_LAUNCH_TOWARDS_DESTINATION = 0,
|
||||
SAY_EYE_UNDER_CONTROL = 1,
|
||||
|
||||
POINT_EYE_FALL = 1,
|
||||
POINT_EYE_MOVE_END = 3
|
||||
POINT_NEW_AVALON = 1
|
||||
};
|
||||
|
||||
Position const EyeOFAcherusFallPoint = { 2361.21f, -5660.45f, 496.7444f, 0.0f };
|
||||
|
||||
G3D::Vector3 const EyeOfAcherusPath[] =
|
||||
static constexpr uint8 const EyeOfAcherusPathSize = 4;
|
||||
G3D::Vector3 const EyeOfAcherusPath[EyeOfAcherusPathSize] =
|
||||
{
|
||||
{ 2361.21f, -5660.45f, 496.744f },
|
||||
{ 2341.57f, -5672.8f, 538.394f },
|
||||
{ 1957.4f, -5844.1f, 273.867f },
|
||||
{ 1758.01f, -5876.79f, 166.867f }
|
||||
{ 2361.21f, -5660.45f, 496.744f },
|
||||
{ 2341.571f, -5672.797f, 538.3942f },
|
||||
{ 1957.4f, -5844.1f, 273.867f },
|
||||
{ 1758.01f, -5876.79f, 166.867f }
|
||||
};
|
||||
std::size_t constexpr EyeOfAcherusPathSize = std::extent<decltype(EyeOfAcherusPath)>::value;
|
||||
|
||||
class npc_eye_of_acherus : public CreatureScript
|
||||
struct npc_eye_of_acherus : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_eye_of_acherus() : CreatureScript("npc_eye_of_acherus") { }
|
||||
npc_eye_of_acherus(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
creature->SetDisplayId(creature->GetCreatureTemplate()->Modelid1);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
struct npc_eye_of_acherusAI : public ScriptedAI
|
||||
void JustAppeared() override
|
||||
{
|
||||
DoCastSelf(SPELL_ROOT_SELF);
|
||||
DoCastSelf(SPELL_EYE_OF_ACHERUS_VISUAL);
|
||||
_events.ScheduleEvent(EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION, 7s);
|
||||
}
|
||||
|
||||
void OnCharmed(bool apply) override
|
||||
{
|
||||
if (!apply)
|
||||
{
|
||||
npc_eye_of_acherusAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
creature->SetDisplayId(creature->GetCreatureTemplate()->Modelid1);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
creature->SetDisableGravity(true);
|
||||
creature->SetControlled(true, UNIT_STATE_ROOT);
|
||||
}
|
||||
|
||||
void JustAppeared() override
|
||||
{
|
||||
ScriptedAI::JustAppeared();
|
||||
|
||||
DoCastSelf(SPELL_EYE_VISUAL);
|
||||
DoCastSelf(SPELL_EYE_FLIGHT);
|
||||
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.MoveTo(PositionToVector3(EyeOFAcherusFallPoint), false);
|
||||
init.SetFall();
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_EYE_FALL, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
}
|
||||
|
||||
void OnCharmed(bool /*isNew*/) override
|
||||
{
|
||||
if (!me->IsCharmed())
|
||||
{
|
||||
me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_THE_EYE_OF_ACHERUS);
|
||||
me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_EYE_FLIGHT_BOOST);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MOVE_START:
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
|
||||
DoCastSelf(SPELL_EYE_FLIGHT_BOOST);
|
||||
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
Talk(TALK_MOVE_START, owner);
|
||||
|
||||
Movement::PointsArray path(EyeOfAcherusPath, EyeOfAcherusPath + EyeOfAcherusPathSize);
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.MovebyPath(path);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_EYE_MOVE_END, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 movementType, uint32 pointId) override
|
||||
{
|
||||
if (movementType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
switch (pointId)
|
||||
{
|
||||
case POINT_EYE_FALL:
|
||||
_events.ScheduleEvent(EVENT_MOVE_START, 2s);
|
||||
break;
|
||||
case POINT_EYE_MOVE_END:
|
||||
me->RemoveAurasDueToSpell(SPELL_EYE_FLIGHT_BOOST);
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
Talk(TALK_CONTROL, owner);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_eye_of_acherusAI(creature);
|
||||
me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_THE_EYE_OF_ACHERUS);
|
||||
me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION:
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
Talk(SAY_LAUNCH_TOWARDS_DESTINATION, owner);
|
||||
_events.ScheduleEvent(EVENT_UNROOT, 1s + 200ms);
|
||||
break;
|
||||
case EVENT_UNROOT:
|
||||
me->RemoveAurasDueToSpell(SPELL_ROOT_SELF);
|
||||
DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST);
|
||||
_events.ScheduleEvent(EVENT_LAUNCH_TOWARDS_DESTINATION, 1s + 200ms);
|
||||
break;
|
||||
case EVENT_LAUNCH_TOWARDS_DESTINATION:
|
||||
{
|
||||
Movement::PointsArray path(EyeOfAcherusPath, EyeOfAcherusPath + EyeOfAcherusPathSize);
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.MovebyPath(path);
|
||||
init.SetFly();
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
init.SetVelocity(owner->GetSpeed(MOVE_RUN));
|
||||
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_NEW_AVALON, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
break;
|
||||
}
|
||||
case EVENT_GRANT_CONTROL:
|
||||
me->RemoveAurasDueToSpell(SPELL_ROOT_SELF);
|
||||
DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT);
|
||||
me->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST);
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
Talk(SAY_EYE_UNDER_CONTROL, owner);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 movementType, uint32 pointId) override
|
||||
{
|
||||
if (movementType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
switch (pointId)
|
||||
{
|
||||
case POINT_NEW_AVALON:
|
||||
DoCastSelf(SPELL_ROOT_SELF);
|
||||
_events.ScheduleEvent(EVENT_GRANT_CONTROL, 2s + 500ms);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -1316,7 +1308,7 @@ void AddSC_the_scarlet_enclave_c1()
|
||||
new npc_unworthy_initiate_anchor();
|
||||
new go_acherus_soul_prison();
|
||||
RegisterSpellScript(spell_death_knight_initiate_visual);
|
||||
new npc_eye_of_acherus();
|
||||
RegisterCreatureAI(npc_eye_of_acherus);
|
||||
new npc_death_knight_initiate();
|
||||
RegisterCreatureAI(npc_dark_rider_of_acherus);
|
||||
new npc_salanar_the_horseman();
|
||||
|
||||
Reference in New Issue
Block a user