fix(Core/Quest): Death Comes From On High (#2939)

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
imxari
2020-09-01 20:46:45 +01:00
committed by GitHub
parent 19a177214a
commit 60e8ec0575
2 changed files with 25 additions and 6 deletions

View File

@@ -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');

View File

@@ -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);
}