Beispiel #1
0
 public void UpdateGemList()
 {
     if (_gems != null)
     {
         var greaterRiftLevel = RiftData.GetGreaterRiftLevel();
         _gems.UpdateGems(greaterRiftLevel, GreaterRiftPrioritizeEquipedGems);
     }
 }
Beispiel #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);
 }
Beispiel #3
0
 public RiftCoroutine(RiftType RiftType)
 {
     _RiftType = RiftType;
     if (RiftType == RiftType.Nephalem)
     {
         _level = -1;
     }
     else
     {
         _level = RiftData.GetGreaterRiftLevel();
     }
 }
Beispiel #4
0
        public override async Task <bool> StartTask()
        {
            if (Level == 0)
            {
                Level = SelectedRiftType == RiftType.Greater ?
                        RiftData.GetGreaterRiftLevel() :
                        -1;
            }

            _remainingRuns = Math.Max(RiftCount, PluginSettings.Current.RiftCount);
            _remainingRuns = _remainingRuns == 0 ? -1 : _remainingRuns;
            return(false);
        }
Beispiel #5
0
        public RiftCoroutine(RiftType RiftType, RiftOptions options = null)
        {
            _RiftType = RiftType;
            if (RiftType == RiftType.Nephalem)
            {
                _level = -1;
            }
            else
            {
                _level = RiftData.GetGreaterRiftLevel();
            }

            _id = Guid.NewGuid();

            _options = options ?? new RiftOptions();
        }
Beispiel #6
0
        public void UpdateGemList()
        {
            var greaterRiftLevel = RiftData.GetGreaterRiftLevel();

            Gems.UpdateGems(greaterRiftLevel);
        }
Beispiel #7
0
        public static async Task <bool> OpenRift(RiftType riftType,
                                                 int maxLevel,
                                                 int maxEmpowerLevel,
                                                 bool shouldEmpower,
                                                 bool runNormalUntilXP)
        {
            if (IsRiftPortalOpen)
            {
                return(IsRiftPortalOpen);
            }

            var riftKeys = CurrentRiftKeyCount;

            if (riftType == RiftType.Greater &&
                riftKeys <= PluginSettings.Current.MinimumKeys &&
                !PluginSettings.Current.GreaterRiftRunNephalem)
            {
                s_logger.Error($"[{nameof(OpenRift)}] You have no Greater Rift Keys. Stopping the bot.");
                BotMain.Stop();
                return(false);
            }

            s_logger.Debug($"[{nameof(OpenRift)}] I have {riftKeys} rift keys.");

            if (await EnsureIsInTown() == CoroutineResult.Running)
            {
                return(false);
            }

            if (riftKeys <= PluginSettings.Current.MinimumKeys)
            {
                riftType = RiftType.Nephalem;
            }

            // TODO: Figure out why there is that check against that magic.
            var maximizeXp = runNormalUntilXP &&
                             riftType == RiftType.Greater &&
                             ZetaDia.Me.RestExperience <5000000000 &&
                                                        ZetaDia.Me.RestExperience> -1;

            if (maximizeXp)
            {
                riftType = RiftType.Nephalem;
            }

            var level       = Math.Min(riftType == RiftType.Greater ? RiftData.GetGreaterRiftLevel() : -1, maxLevel);
            var isEmpowered = riftType == RiftType.Greater &&
                              shouldEmpower &&
                              level <= maxEmpowerLevel &&
                              RiftData.EmpoweredRiftCost.TryGetValue(level, out var empoweredCost) &&
                              ZetaDia.Storage.PlayerDataManager.ActivePlayerData.Coinage >=
                              (empoweredCost + PluginSettings.Current.MinimumGold);

            DiaGizmo lrs = LootRunSwitch;

            if (lrs == null)
            {
                await CommonCoroutines.MoveTo(ZetaDia.Actors.GetActorsOfType <DiaGizmo>()
                                              .Where(g => g.Distance > 10f)
                                              .OrderByDescending(g => g.Distance)
                                              .FirstOrDefault());

                return(false);
            }

            if (!s_experienceTracker.IsStarted)
            {
                s_experienceTracker.Start();
            }

            if (await CommonCoroutines.MoveAndInteract(
                    lrs,
                    () => UIElements.RiftDialog.IsVisible) == CoroutineResult.Running)
            {
                return(false);
            }

            ZetaDia.Me.OpenRift(level, isEmpowered);
            return(await Coroutine.Wait(TimeSpan.FromSeconds(2), () => IsRiftPortalOpen));
        }