private async Task <bool> RunningBounties()
 {
     if (_currentBountyCoroutine == null)
     {
         if (_bountyCoroutines.Count != 0)
         {
             _currentBountyCoroutine = _bountyCoroutines[0];
         }
         else
         {
             if (BountyHelpers.IsActTurninInProgress(Act))
             {
                 State = States.TurningInTheActQuest;
                 return(false);
             }
             State = States.Failed;
             return(false);
         }
     }
     if (!await _currentBountyCoroutine.GetCoroutine())
     {
         return(false);
     }
     BountyStatistics.Report();
     ScenesStorage.Reset();
     if (_currentBountyCoroutine.State == BountyCoroutine.States.Failed)
     {
         //Logger.Info("[ActBounties] Looks like the bounty has failed, skipping the rest of the act.");
         State = States.Failed;
         return(false);
     }
     _bountyCoroutines.Remove(_currentBountyCoroutine);
     _currentBountyCoroutine = null;
     return(false);
 }
 private async Task <bool> NotStarted()
 {
     //if (!BountyHelpers.IsActEnabledOnSettings(Act))
     //{
     //    State = States.ActIsDisabled;
     //    return false;
     //}
     if (BountyHelpers.IsActTurninCompleted(Act))
     {
         State = States.Completed;
         return(false);
     }
     if (BountyHelpers.IsActTurninInProgress(Act))
     {
         State = States.TurningInTheActQuest;
         return(false);
     }
     if (!BountyHelpers.AreAllActBountiesSupported(Act))
     {
         State = States.UnsupportedBountyFound;
         return(false);
     }
     State = States.RunningBounties;
     return(false);
 }
Exemple #3
0
        private async Task <bool> NotStarted()
        {
            await Coroutine.Sleep(1000);

            if (!BountyHelpers.IsActTurninInProgress(_act))
            {
                State = States.AlreadyDone;
                return(false);
            }

            if (IsInZone)
            {
                State = States.TownRun;
                return(false);
            }
            State = States.ReturningToTown;
            Core.Logger.Log("[CompleteActBounties] Time to return to the town and claim our prize, huzzah!");
            return(false);
        }
        private async Task <bool> RunningBounties()
        {
            if (_currentBountyCoroutine == null)
            {
                if (_bountyCoroutines.Count != 0)
                {
                    //if (TrinityPluginSettings.Settings.Advanced.BetaPlayground)
                    //{
                    //    try
                    //    {
                    //        if (Core.Player.IsInParty)
                    //        {
                    //            if (BountyCoroutine.currentRandomizedBounty < 0 ||
                    //                BountyCoroutine.currentRandomizedBounty > _bountyCoroutines.Count)
                    //            {
                    //                BountyCoroutine.currentRandomizedBounty =
                    //                    Randomizer.GetRandomNumber(_bountyCoroutines.Count);
                    //                Core.Logger.Log("[ActBounties] Randomized Bounty Complete.", Act);
                    //            }
                    //        }
                    //        else
                    //            BountyCoroutine.currentRandomizedBounty = 0;

                    //        if (BountyCoroutine.currentRandomizedBounty < 0 ||
                    //            BountyCoroutine.currentRandomizedBounty > _bountyCoroutines.Count)
                    //            BountyCoroutine.currentRandomizedBounty = 0;

                    //        _currentBountyCoroutine = _bountyCoroutines[BountyCoroutine.currentRandomizedBounty];
                    //    }
                    //    catch (Exception ex)
                    //    {
                    //        Core.Logger.Log(BountyCoroutine.currentRandomizedBounty + " | " + _bountyCoroutines.Count, Act);
                    //        BountyCoroutine.currentRandomizedBounty = 0;
                    //        _currentBountyCoroutine = _bountyCoroutines[0];
                    //    }
                    //}
                    //else
                    //{
                    _currentBountyCoroutine = _bountyCoroutines[0];
                    //}
                }
                else
                {
                    if (BountyHelpers.IsActTurninInProgress(Act))
                    {
                        State = States.TurningInTheActQuest;
                        return(false);
                    }
                    State = States.Failed;
                    return(false);
                }
            }
            if (!await _currentBountyCoroutine.GetCoroutine())
            {
                return(false);
            }
            BountyStatistics.Report();
            Core.Scenes.Reset();
            if (_currentBountyCoroutine.State == BountyCoroutine.States.Failed)
            {
                //Core.Logger.Log("[ActBounties] Looks like the bounty has failed, skipping the rest of the act.");
                State = States.Failed;
                return(false);
            }
            _bountyCoroutines.Remove(_currentBountyCoroutine);
            _currentBountyCoroutine = null;
            return(false);
        }