Exemplo n.º 1
0
        private async Task <bool> Searching()
        {
            if (!_keywardenData.IsAlive)
            {
                State = States.Waiting;
                return(false);
            }
            EnablePulse();

            if (_keywardenLocation != Vector3.Zero)
            {
                State = States.Moving;
                Logger.Info("[Keywarden] It's clobberin time!");
                return(false);
            }

            if (!await MoveToMarker())
            {
                return(false);
            }

            if (!await ExplorationCoroutine.Explore(_levelAreaIds))
            {
                return(false);
            }

            Logger.Error("[Keywarden] Oh shit, that guy is nowhere to be found.");
            ScenesStorage.ResetVisited();
            State = States.Searching;
            return(false);
        }
Exemplo n.º 2
0
 private bool NotStarted()
 {
     if (!_experienceTracker.IsStarted)
     {
         _experienceTracker.Start();
     }
     SafeZerg.Instance.DisableZerg();
     if (_RiftType == RiftType.Greater)
     {
         _level = RiftData.GetGreaterRiftLevel();
     }
     if (_runningNephalemInsteadOfGreaterRift && AdvDia.StashAndBackpackItems.Any(i => i.IsValid && i.ActorSNO == RiftData.GreaterRiftKeySNO))
     {
         _level    = RiftData.GetGreaterRiftLevel();
         _RiftType = RiftType.Greater;
         _runningNephalemInsteadOfGreaterRift = false;
         return(false);
     }
     if (AdvDia.RiftQuest.State == QuestState.NotStarted && _RiftType == RiftType.Greater && !AdvDia.StashAndBackpackItems.Any(i => i.IsValid && i.ActorSNO == RiftData.GreaterRiftKeySNO))
     {
         if (PluginSettings.Current.GreaterRiftRunNephalem)
         {
             _level    = -1;
             _RiftType = RiftType.Nephalem;
             _runningNephalemInsteadOfGreaterRift = true;
             return(false);
         }
         else
         {
             Logger.Error("You have no Greater Rift Keys. Stopping the bot.");
             BotMain.Stop();
             return(true);
         }
     }
     _currentWorldDynamicId = AdvDia.CurrentWorldDynamicId;
     if (AdvDia.RiftQuest.State == QuestState.InProgress && RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId))
     {
         State = States.SearchingForExitPortal;
         return(false);
     }
     State = AdvDia.CurrentWorldId == ExplorationData.ActHubWorldIds[Act.A1] ? States.InTown : States.GoingToAct1Hub;
     if (AdvDia.RiftQuest.State == QuestState.NotStarted)
     {
         ScenesStorage.Reset();
         RiftData.EntryPortals.Clear();
         _currentWorldDynamicId   = 0;
         _previusWorldDynamicId   = 0;
         _bossLocation            = Vector3.Zero;
         _nextLevelPortalLocation = Vector3.Zero;
         _holyCowLocation         = Vector3.Zero;
         _holyCowEventCompleted   = false;
         _possiblyCowLevel        = false;
     }
     return(false);
 }
Exemplo n.º 3
0
 public WorldScene(Scene scene, float boxSize, float boxTolerance)
 {
     using (new PerformanceLogger("[WorldScene] ctor", false))
     {
         //                Logger.Debug("[WorldScene] Scene GridSquare Size: {0} X:{1} Y:{2}", scene.Mesh.Zone.NavZoneDef.GridSquareSize,scene.Mesh.Zone.NavZoneDef.NavGridSquareCountX, scene.Mesh.Zone.NavZoneDef.NavGridSquareCountY);
         _boxSize      = boxSize;
         _boxTolerance = boxTolerance;
         Scene         = scene;
         Name          = scene.Name;
         HashName      = scene.GetSceneNameString();
         LevelAreaId   = Scene.Mesh.LevelAreaSNO;
         Min           = Scene.Mesh.Zone.ZoneMin;
         Max           = Scene.Mesh.Zone.ZoneMax;
         Center        = (Max + Min) / 2;
         //Rect = new Rect(new Point(Center.X, Center.Y), new Size(_boxSize, _boxSize));
         HasChild       = Scene.Mesh.SubSceneId > 0;
         HasParent      = Scene.Mesh.ParentSceneId > 0;
         IsIgnored      = ExplorationData.IgnoreScenes.Contains(Scene.Name);
         DynamicWorldId = Scene.Mesh.DynamicWorldId;
         SceneId        = scene.Mesh.SceneId;
         if (HasChild)
         {
             SubScene = new WorldScene(Scene.Mesh.SubScene, boxSize, boxTolerance);
             if (SubScene.HasChild)
             {
                 Logger.Error("[ScenesStorage] Found sub sub scene!!!");
                 SubScene.SubScene = new WorldScene(SubScene.Scene.Mesh.SubScene, boxSize, boxTolerance);
             }
         }
         Logger.Verbose("[WorldScene] Created a new world scene. Name: {0} LevelArea: {1} ({2})", Name, (SNOLevelArea)LevelAreaId, LevelAreaId);
         if (LevelAreaId != AdvDia.CurrentLevelAreaId && !ExplorationData.OpenWorldIds.Contains(AdvDia.CurrentWorldId))
         {
             Logger.Verbose("[WorldScene] The scene LevelAreaID is different than the CurrentLevelAreaID");
             Logger.Verbose("[WorldScene] Scene Name: {0}", Name);
             Logger.Verbose("[WorldScene] Scene: {0} ({1})", (SNOLevelArea)LevelAreaId, LevelAreaId);
             Logger.Verbose("[WorldScene] Current: {0} ({1})", (SNOLevelArea)AdvDia.CurrentLevelAreaId, AdvDia.CurrentLevelAreaId);
         }
         CreateGrid();
     }
 }
Exemplo n.º 4
0
 private bool Failed()
 {
     Logger.Error("[Rift] Failed to complete the rift.");
     return(true);
 }