From 60e8ec057518f64380a988e58b39f050e4e6d4c8 Mon Sep 17 00:00:00 2001 From: imxari <16465944+imxari@users.noreply.github.com> Date: Tue, 1 Sep 2020 20:46:45 +0100 Subject: [PATCH] fix(Core/Quest): Death Comes From On High (#2939) Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- .../rev_1587740947996468714.sql | 5 ++++ .../ScarletEnclave/chapter1.cpp | 26 ++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1587740947996468714.sql diff --git a/data/sql/updates/pending_db_world/rev_1587740947996468714.sql b/data/sql/updates/pending_db_world/rev_1587740947996468714.sql new file mode 100644 index 000000000..a08c882ec --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1587740947996468714.sql @@ -0,0 +1,5 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1587740947996468714'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=28529 AND `id`=2; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28529, 0, 2, 0, 1, 0, 100, 0, 0, 0, 1000, 3000, 0, 49, 0, 0, 0, 0, 0, 0, 9, 28511, 1, 25, 1, 0, 0, 0, 0, 'Scarlet Crusader - Out of Combat - Start Attacking'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 1d62e1e62..4a941b241 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -29,6 +29,9 @@ enum eyeOfAcherus EYE_TEXT_LAUNCH = 0, EYE_TEXT_CONTROL = 1, + EYE_POINT_DESTINATION_1 = 0, + EYE_POINT_DESTINATION_2 = 1, + SPELL_EYE_OF_ACHERUS_VISUAL = 51892, }; @@ -51,6 +54,7 @@ public: void InitializeAI() override { events.Reset(); + events.ScheduleEvent(EVENT_REMOVE_CONTROL, 500); events.ScheduleEvent(EVENT_SPEAK_1, 4000); events.ScheduleEvent(EVENT_LAUNCH, 7000); @@ -60,8 +64,10 @@ public: void MovementInform(uint32 type, uint32 point) override { - if (type == ESCORT_MOTION_TYPE || point !=0) + if (type == POINT_MOTION_TYPE && point == EYE_POINT_DESTINATION_2) + { events.ScheduleEvent(EVENT_REGAIN_CONTROL, 1000); + } } void SetControl(Player* player, bool on) @@ -85,23 +91,31 @@ public: { case EVENT_REMOVE_CONTROL: if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); SetControl(player, false); + } break; case EVENT_SPEAK_1: Talk(EYE_TEXT_LAUNCH, me->GetCharmerOrOwnerPlayerOrPlayerItself()); break; case EVENT_LAUNCH: { - Movement::PointsArray path; - path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - path.push_back(G3D::Vector3(me->GetPositionX()-40.0f, me->GetPositionY(), me->GetPositionZ()+10.0f)); - path.push_back(G3D::Vector3(1768.0f, -5876.0f, 153.0f)); - me->GetMotionMaster()->MoveSplinePath(&path); + me->SetSpeed(MOVE_FLIGHT, 5.0f, true); + + const Position EYE_DESTINATION_1 = { me->GetPositionX()-40.0f, me->GetPositionY(), me->GetPositionZ()+10.0f, 0.0f }; + const Position EYE_DESTINATION_2 = { 1768.0f, -5876.0f, 153.0f, 0.0f }; + + me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_1, EYE_DESTINATION_1); + me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_2, EYE_DESTINATION_2); break; } case EVENT_REGAIN_CONTROL: if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself()) { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + me->SetSpeed(MOVE_FLIGHT, 3.3f, true); + SetControl(player, true); Talk(EYE_TEXT_CONTROL, player); }