private async Task <bool> ScanForObjective()
 {
     if (PluginTime.ReadyToUse(_lastScanTime, 1000))
     {
         _lastScanTime = PluginTime.CurrentMillisecond;
         if (_actorId != 0)
         {
             //var objectiveActor = BountyHelpers.ScanForActor(_actorId, _objectiveScanRange, _actorSelector);
             var objectiveActor = ActorFinder.FindActor(_actorId, _markerId, 500, "", _actorSelector);
             if (objectiveActor != null)
             {
                 _objectiveLocation = objectiveActor.Position;
                 if (_stopDistance == -1)
                 {
                     _stopDistance = objectiveActor.Radius;
                 }
             }
             else
             {
                 _objectiveLocation = Vector3.Zero;
             }
         }
         if (_objectiveLocation != Vector3.Zero)
         {
             Core.Logger.Log($"[MoveToObject] Found the objective at distance {AdvDia.MyPosition.Distance(_objectiveLocation)}");
         }
     }
     return(true);
 }
예제 #2
0
 private DiaObject GetActor()
 {
     var trinActor = ActorFinder.FindActor(_actorId, _markerHash);
     var actor = trinActor != null
         ? ZetaDia.Actors.GetActorByACDId(trinActor.AcdId)
         : ActorFinder.FindObject(_actorId);
     return actor;
 }
        public bool FindActor()
        {
            var actor = ActorFinder.FindActor(ActorId, MarkerHash, MaxRange, ActorInternalName, CheckActorAnimation);

            if (actor == null)
            {
                return(false);
            }

            Core.Logger.Debug($"[{TagClassName}] Actor Found: {actor}");
            ActorId = actor.ActorSnoId;

            if (IsDefault(nameof(StopDistance), StopDistance))
            {
                StopDistance = actor.Radius;
                Core.Logger.Debug($"[{TagClassName}] Using Actor Radius as StopDistance: {StopDistance}");
            }

            return(true);
        }