Exemple #1
0
        private void ScanForObjective()
        {
            if (_previouslyFoundLocation != Vector3.Zero && PluginTime.ReadyToUse(_returnTimeForPreviousLocation, 60000))
            {
                _objectiveLocation       = _previouslyFoundLocation;
                _previouslyFoundLocation = Vector3.Zero;
                Core.Logger.Debug("[KillUniqueMonster] Returning previous objective location.");
                return;
            }

            if (PluginTime.ReadyToUse(_lastScanTime, 1000))
            {
                _lastScanTime = PluginTime.CurrentMillisecond;
                if (_marker != 0)
                {
                    _objectiveLocation = BountyHelpers.ScanForMarkerLocation(_marker, _objectiveScanRange);
                }
                if (_objectiveLocation == Vector3.Zero && _actorId != 0)
                {
                    _objectiveLocation = BountyHelpers.ScanForActorLocation(_actorId, _objectiveScanRange);
                }
                if (_objectiveLocation != Vector3.Zero)
                {
                    using (new PerformanceLogger("[KillUniqueMonster] Path to Objective Check", true))
                    {
                        Core.Logger.Log("[KillUniqueMonster] Found the objective at distance {0}",
                                        AdvDia.MyPosition.Distance(_objectiveLocation));

                        ExplorationHelpers.SetExplorationPriority(_objectiveLocation);
                    }
                }
            }
        }
        private void ScanForObjective()
        {
            if (_previouslyFoundLocation != Vector3.Zero && PluginTime.ReadyToUse(_returnTimeForPreviousLocation, 60000))
            {
                _objectiveLocation             = _previouslyFoundLocation;
                _previouslyFoundLocation       = Vector3.Zero;
                _returnTimeForPreviousLocation = PluginTime.CurrentMillisecond;
                Logger.Debug("[EnterLevelArea] Returning previous objective location.");

                return;
            }
            if (PluginTime.ReadyToUse(_lastScanTime, 250))
            {
                _lastScanTime = PluginTime.CurrentMillisecond;
                if (_portalMarker != 0)
                {
                    _objectiveLocation = BountyHelpers.ScanForMarkerLocation(_portalMarker, _objectiveScanRange);
                }
                // Belial
                if (_objectiveLocation == Vector3.Zero && _portalActorId == 159574)
                {
                    _objectiveLocation = BountyHelpers.ScanForActorLocation(_portalActorId, _objectiveScanRange);
                }
                //if (_objectiveLocation == Vector3.Zero && _portalActorId != 0)
                //{
                //    _objectiveLocation = BountyHelpers.ScanForActorLocation(_portalActorId, _objectiveScanRange);
                //}
                if (_objectiveLocation != Vector3.Zero)
                {
                    Logger.Info("[EnterLevelArea] Found the objective at distance {0}", AdvDia.MyPosition.Distance2D(_objectiveLocation));
                }
            }
        }
Exemple #3
0
        private void ScanForObjective()
        {
            if (_previouslyFoundLocation != Vector3.Zero && PluginTime.ReadyToUse(_returnTimeForPreviousLocation, 60000))
            {
                _objectiveLocation             = _previouslyFoundLocation;
                _previouslyFoundLocation       = Vector3.Zero;
                _returnTimeForPreviousLocation = PluginTime.CurrentMillisecond;
                Logger.Debug("[MoveToMapMarker] Returning previous objective location.");

                return;
            }
            if (PluginTime.ReadyToUse(_lastScanTime, 1000))
            {
                _lastScanTime = PluginTime.CurrentMillisecond;
                if (_marker != 0)
                {
                    if (_marker == -1)
                    {
                        _objectiveLocation = BountyHelpers.ScanForMarkerLocation(0, _objectiveScanRange);
                    }
                    else
                    {
                        _objectiveLocation = BountyHelpers.ScanForMarkerLocation(_marker, _objectiveScanRange);
                    }
                }
                //if (_objectiveLocation == Vector3.Zero && _actorId != 0)
                //{
                //    _objectiveLocation = BountyHelpers.ScanForActorLocation(_actorId, _objectiveScanRange);
                //}
                if (_objectiveLocation != Vector3.Zero)
                {
                    using (new PerformanceLogger("[MoveToMapMarker] Path to Objective Check", true))
                    {
                        //if ((Navigator.GetNavigationProviderAs<DefaultNavigationProvider>().CanFullyClientPathTo(_objectiveLocation)))
                        //{
                        Logger.Info("[MoveToMapMarker] Found the objective at distance {0}",
                                    AdvDia.MyPosition.Distance2D(_objectiveLocation));
                        //}
                        //else
                        //{
                        //    Logger.Debug("[MoveToMapMarker] Found the objective at distance {0}, but cannot get a path to it.",
                        //        AdvDia.MyPosition.Distance2D(_objectiveLocation));
                        //    _objectiveLocation = Vector3.Zero;
                        //}
                    }
                }
            }
        }
Exemple #4
0
 private void ScanForObjective()
 {
     if (_marker != 0)
     {
         _center = BountyHelpers.ScanForMarkerLocation(_marker, OBJECTIVE_SCAN_RANGE);
     }
     if (_center == Vector3.Zero && _actorId != 0)
     {
         _center = BountyHelpers.ScanForActorLocation(_actorId, OBJECTIVE_SCAN_RANGE);
     }
     if (_center == Vector3.Zero)
     {
         _center = AdvDia.MyPosition;
     }
     if (_center != Vector3.Zero)
     {
         Logger.Info("[ClearAreaForNSeconds] Found the objective at distance {0}", AdvDia.MyPosition.Distance2D(_center));
     }
 }
 private void ScanForObjective()
 {
     if (PluginTime.ReadyToUse(_lastScanTime, 1000))
     {
         _lastScanTime = PluginTime.CurrentMillisecond;
         if (_marker != 0)
         {
             _objectiveLocation = BountyHelpers.ScanForMarkerLocation(_marker, _objectiveScanRange);
         }
         if (_objectiveLocation == Vector3.Zero && _actorId != 0)
         {
             _objectiveLocation = BountyHelpers.ScanForActorLocation(_actorId, _objectiveScanRange);
         }
         if (_objectiveLocation != Vector3.Zero)
         {
             Logger.Info("[InteractWithUnit] Found the objective at distance {0}", AdvDia.MyPosition.Distance2D(_objectiveLocation));
         }
     }
 }
 private void ScanForObjective()
 {
     if (PluginTime.ReadyToUse(_lastScanTime, 1000))
     {
         _lastScanTime = PluginTime.CurrentMillisecond;
         if (_marker != 0)
         {
             _objectiveLocation = BountyHelpers.ScanForMarkerLocation(_marker, _objectiveScanRange);
         }
         if (_objectiveLocation == Vector3.Zero && _actorId != 0)
         {
             var actor = ActorFinder.FindGizmo(_actorId);
             if (actor != null && !actor.HasBeenOperated)
             {
                 _objectiveLocation = BountyHelpers.ScanForActorLocation(_actorId, _objectiveScanRange);
             }
         }
         if (_objectiveLocation != Vector3.Zero)
         {
             Core.Logger.Log("[InteractWithGizmo] Found the objective at distance {0}", AdvDia.MyPosition.Distance(_objectiveLocation));
         }
     }
 }
        private void ScanForObjective()
        {
            if (_previouslyFoundLocation != Vector3.Zero && PluginTime.ReadyToUse(_returnTimeForPreviousLocation, 60000))
            {
                _objectiveLocation             = _previouslyFoundLocation;
                _previouslyFoundLocation       = Vector3.Zero;
                _returnTimeForPreviousLocation = PluginTime.CurrentMillisecond;
                Core.Logger.Debug("[EnterLevelArea] Returning previous objective location.");

                return;
            }
            if (PluginTime.ReadyToUse(_lastScanTime, 250))
            {
                _lastScanTime = PluginTime.CurrentMillisecond;
                if (_portalMarker != 0)
                {
                    if (_objectiveLocation == Vector3.Zero)
                    {
                        // Help with weighting exploration nodes even if its unreachable/unpathable.
                        var markerlocation = BountyHelpers.ScanForMarkerLocation(_portalMarker, 5000);
                        ExplorationHelpers.SetExplorationPriority(markerlocation);
                    }

                    _objectiveLocation = BountyHelpers.ScanForMarkerLocation(_portalMarker, _objectiveScanRange);

                    if (ExplorationData.FortressLevelAreaIds.Contains(AdvDia.CurrentLevelAreaId))
                    {
                        _deathGateLocation = DeathGates.GetBestGatePosition(_objectiveLocation);
                        if (_deathGateLocation != Vector3.Zero)
                        {
                            if (Navigator.StuckHandler.IsStuck && _deathGateLocation.Distance(AdvDia.MyPosition) < 125f)
                            {
                                var nearestGate = ActorFinder.FindNearestDeathGate();
                                if (nearestGate != null)
                                {
                                    Core.Logger.Warn("Found death gate location");
                                    _objectiveLocation = nearestGate.Position;
                                }
                            }
                        }
                    }
                }
                if (_objectives != null && _objectives.Any())
                {
                    BountyHelpers.ObjectiveActor objective;
                    _objectiveLocation = BountyHelpers.TryFindObjectivePosition(_objectives, _objectiveScanRange, out objective);
                    if (objective != null)
                    {
                        _objective          = objective;
                        _portalActorId      = objective.ActorId;
                        _destinationWorldId = objective.DestWorldId;
                    }
                }
                // Belial
                if (_objectiveLocation == Vector3.Zero && _portalActorId == 159574)
                {
                    _objectiveLocation = BountyHelpers.ScanForActorLocation(_portalActorId, _objectiveScanRange);
                }
                //if (_objectiveLocation == Vector3.Zero && _portalActorId != 0)
                //{
                //    _objectiveLocation = BountyHelpers.ScanForActorLocation(_portalActorId, _objectiveScanRange);
                //}
                if (_objectiveLocation != Vector3.Zero)
                {
                    Core.Logger.Log("[EnterLevelArea] Found the objective at distance {0}", AdvDia.MyPosition.Distance(_objectiveLocation));
                    ExplorationHelpers.SetExplorationPriority(_objectiveLocation);
                }
            }
        }