Пример #1
0
        private void ResetAll()
        {
            _isDone = false;
            _currentAct = Act.Invalid;
            _currentActBountiesCoroutine = null;
            _acts = new List<Act>();
            _completedActs = new List<Act>();
            if (PluginSettings.Current.BountyAct1) _acts.Add(Act.A1);
            if (PluginSettings.Current.BountyAct2) _acts.Add(Act.A2);
            if (PluginSettings.Current.BountyAct3) _acts.Add(Act.A3);
            if (PluginSettings.Current.BountyAct4) _acts.Add(Act.A4);
            if (PluginSettings.Current.BountyAct5) _acts.Add(Act.A5);
            //_acts = new List<Act> { Act.A1, Act.A2, Act.A3, Act.A4, Act.A5 };

        }
Пример #2
0
        public override void OnStart()
        {
            if (!Adventurer.Enabled)
            {
                Logger.Error("Plugin is not enabled. Please enable Adventurer and try again.");
                return;
            }

            PluginEvents.CurrentProfileType = ProfileType.Bounty;

            ResetAll();

            _currentActBountiesCoroutine = GetNextAct();
            if (_currentActBountiesCoroutine != null)
            {
                Logger.Info("[Bounties] Picked {0} as new target. (BonusAct: {1})", _currentActBountiesCoroutine.Act, _currentActBountiesCoroutine.Act == ZetaDia.CurrentBonusAct);
            }
        }
Пример #3
0
        private async Task<bool> GetCoroutine()
        {
            if (_isDone)
            {
                return true;
            }
            PluginEvents.PulseUpdates();
            if (_currentActBountiesCoroutine == null)
            {
                _isDone = true;
                return true;
            }

            if (PluginEvents.TimeSinceWorldChange < 1000)
            {
                Logger.Debug("[Bounties] Sleeping 1 second due to world change");
                await Coroutine.Sleep(1000);
            }
            if (!await _currentActBountiesCoroutine.GetCoroutine()) return false;
            _completedActs.Add(_currentAct);
            if (PluginSettings.Current.BountyMode3.HasValue && PluginSettings.Current.BountyMode3.Value)
            {
                _acts.Remove(_currentAct);
                if (_acts.Count == 0)
                {
                    _isDone = true;
                    return true;
                }
            }
            _currentActBountiesCoroutine = GetNextAct();
            if (_currentActBountiesCoroutine != null)
            {
                Logger.Info("[Bounties] Picked {0} as new target. (BonusAct: {1})", _currentActBountiesCoroutine.Act, _currentActBountiesCoroutine.Act == ZetaDia.CurrentBonusAct);
            }
            return true;
        }