예제 #1
0
        public void ResumePath()
        {
            GetScript().ProcessEventsFor(SmartEvents.WaypointResumed, null, mCurrentWPID, GetScript().GetPathId());
            RemoveEscortState(SmartEscortState.Paused);
            mForcedPaused = false;
            mWPReached    = false;
            mWPPauseTimer = 0;
            SetRun(mRun);

            WaypointMovementGenerator move = (WaypointMovementGenerator)me.GetMotionMaster().top();

            if (move != null)
            {
                move.GetTrackerTimer().Reset(1);
            }
        }
예제 #2
0
        public void SetEscortPaused(bool on)
        {
            if (!HasEscortState(eEscortState.Escorting))
            {
                return;
            }

            if (on)
            {
                AddEscortState(eEscortState.Paused);
                me.StopMoving();
            }
            else
            {
                RemoveEscortState(eEscortState.Paused);
                WaypointMovementGenerator move = (WaypointMovementGenerator)me.GetMotionMaster().top();
                if (move != null)
                {
                    move.GetTrackerTimer().Reset(1);
                }
            }
        }
예제 #3
0
        public override void MovementInform(MovementGeneratorType moveType, uint pointId)
        {
            // no action allowed if there is no escort
            if (!HasEscortState(eEscortState.Escorting))
            {
                return;
            }

            if (moveType == MovementGeneratorType.Point)
            {
                if (m_uiWPWaitTimer == 0)
                {
                    m_uiWPWaitTimer = 1;
                }

                //Combat start position reached, continue waypoint movement
                if (pointId == EscortPointIds.LastPoint)
                {
                    Log.outDebug(LogFilter.Scripts, "EscortAI has returned to original position before combat");

                    me.SetWalk(!m_bIsRunning);
                    RemoveEscortState(eEscortState.Returning);
                }
                else if (pointId == EscortPointIds.Home)
                {
                    Log.outDebug(LogFilter.Scripts, "EscortAI has returned to original home location and will continue from beginning of waypoint list.");

                    m_bStarted = false;
                }
            }
            else if (moveType == MovementGeneratorType.Waypoint)
            {
                //Call WP function
                WaypointReached(pointId);

                //End of the line
                if (LastWP != 0 && LastWP == pointId)
                {
                    LastWP = 0;

                    m_bStarted = false;
                    m_bEnded   = true;

                    m_uiWPWaitTimer = 50;

                    return;
                }

                Log.outDebug(LogFilter.Scripts, $"EscortAI Waypoint {pointId} reached");

                WaypointMovementGenerator move = (WaypointMovementGenerator)me.GetMotionMaster().top();
                if (move != null)
                {
                    m_uiWPWaitTimer = (uint)move.GetTrackerTimer().GetExpiry();
                }

                //Call WP start function
                if (m_uiWPWaitTimer == 0 && !HasEscortState(eEscortState.Paused) && move != null)
                {
                    WaypointStart(move.GetCurrentNode());
                }

                if (m_bIsRunning)
                {
                    me.SetWalk(false);
                }
                else
                {
                    me.SetWalk(true);
                }
            }
        }