Пример #1
0
        private RunStatus GilesMoveToLocation(object ret)
        {
            // First check if we can skip ahead because we recently moved here
            if (NoSkip == null || NoSkip.ToLower() != "true")
            {
                if (SkipAheadCache.CheckPositionForSkipping(Position))
                {
                    Logger.DBLog.DebugFormat("Finished Path {0} earlier due to SkipAreaCache find!", Position.ToString());
                    skippingAhead = true;
                }

                if (skippingAhead)
                {
                    m_IsDone = true;
                    return(RunStatus.Success);
                }
            }

            // Now use Trinity movement to try a direct movement towards that location
            var NavTarget = Position;
            var MyPos     = Bot.Character.Data.Position;

            if (!ZetaDia.WorldInfo.IsGenerated && Vector3.Distance(MyPos, NavTarget) > 250)
            {
                NavTarget = MathEx.CalculatePointFrom(MyPos, NavTarget, Vector3.Distance(MyPos, NavTarget) - 250);
            }

            if (useNavigator != null && useNavigator.ToLower() == "false")
            {
                Navigator.PlayerMover.MoveTowards(NavTarget);
            }
            else
            {
                //Special cache for skipping locations visited.
                if (Bot.Settings.Debug.SkipAhead)
                {
                    SkipAheadCache.RecordSkipAheadCachePoint(PathPrecision);
                }

                Navigator.MoveTo(NavTarget);
            }

            return(RunStatus.Success);
        }
Пример #2
0
        private RunStatus GilesMoveToLocation(object ret)
        {
            // First check if we can skip ahead because we recently moved here
            if (!GilesTrinity.Settings.Combat.Misc.AllowBacktracking && (NoSkip == null || NoSkip.ToLower() != "true"))
            {
                if (GilesTrinity.hashSkipAheadAreaCache.Any())
                {
                    // Loop through all the skip ahead zones and see if one of them is within radius of our intended destination to skip ahead
                    foreach (GilesObstacle thisObject in GilesTrinity.hashSkipAheadAreaCache)
                    {
                        if (thisObject.Location.Distance(Position) <= thisObject.Radius)
                        {
                            DbHelper.Log(TrinityLogLevel.Verbose, LogCategory.ProfileTag, "Skipping ahead from moveto {0} to next moveto.", Position);
                            GilesTrinity.bSkipAheadAGo = true;
                            return(RunStatus.Success);
                        }
                    }
                    GilesTrinity.hashSkipAheadAreaCache = new HashSet <GilesObstacle>();
                }
            }
            else
            {
                GilesTrinity.hashSkipAheadAreaCache = new HashSet <GilesObstacle>();
            }

            // Now use Trinity movement to try a direct movement towards that location
            Vector3 NavTarget = Position;
            Vector3 MyPos     = GilesTrinity.PlayerStatus.CurrentPosition;

            if (!ZetaDia.WorldInfo.IsGenerated && Vector3.Distance(MyPos, NavTarget) > 250)
            {
                NavTarget = MathEx.CalculatePointFrom(MyPos, NavTarget, Vector3.Distance(MyPos, NavTarget) - 250);
            }

            if (useNavigator != null && useNavigator.ToLower() == "false")
            {
                Navigator.PlayerMover.MoveTowards(NavTarget);
            }
            else
            {
                var positionName = this.getPosition() + " (" + this.Name + ")";
                Navigator.MoveTo(NavTarget, positionName, true);
            }

            return(RunStatus.Success);
        }