diff options
author | Wyrserth <wyrserth@protonmail.com> | 2019-07-12 19:14:47 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-15 23:39:51 +0100 |
commit | 3bb61af1130acccfc8d785922181e98becf1c7e5 (patch) | |
tree | f0a3d8a169b8a3bca723293b2760db7f00358bf2 /src | |
parent | f175cd38afc2b04b1577e7d87b4d1a66ada21229 (diff) |
Script/ScarletEnclave: use spline movement for the lauch phase of the Eye of Acherus.
Closes #22802.
(cherry picked from commit 4ee84bbecbccee2adb093d4c30172edc22ef8499)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 48ecfbe34cc..c7839057c3b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -33,6 +33,7 @@ #include "SpellInfo.h" #include "TemporarySummon.h" #include "Vehicle.h" +#include <G3D/Vector3.h> /*###### ##Quest 12848 @@ -420,6 +421,15 @@ enum EyeOfAcherus Position const EyeOFAcherusFallPoint = { 2361.21f, -5660.45f, 496.7444f, 0.0f }; +Position const EyeOfAcherusPath[] = +{ + { 2361.21f, -5660.45f, 496.744f }, + { 2341.57f, -5672.8f, 538.394f }, + { 1957.4f, -5844.1f, 273.867f }, + { 1758.01f, -5876.79f, 166.867f } +}; +std::size_t const EyeOfAcherusPathSize = std::extent<decltype(EyeOfAcherusPath)>::value; + class npc_eye_of_acherus : public CreatureScript { public: @@ -467,7 +477,17 @@ class npc_eye_of_acherus : public CreatureScript me->SetSpeedRate(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i))); Talk(TALK_MOVE_START, owner); } - me->GetMotionMaster()->MovePath(me->GetEntry() * 100, false); + + Movement::PointsArray path; + path.reserve(EyeOfAcherusPathSize); + std::transform(std::begin(EyeOfAcherusPath), std::end(EyeOfAcherusPath), std::back_inserter(path), [](Position const& pos) + { + return G3D::Vector3(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); + }); + + 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: @@ -478,7 +498,7 @@ class npc_eye_of_acherus : public CreatureScript void MovementInform(uint32 movementType, uint32 pointId) override { - if (movementType == WAYPOINT_MOTION_TYPE && pointId == POINT_EYE_MOVE_END - 1) + if (movementType == POINT_MOTION_TYPE && pointId == POINT_EYE_MOVE_END) { me->RemoveAllAuras(); |