private async Task <bool> Interacting()
        {
            //if (_interactionCoroutine.State == InteractionCoroutine.States.NotStarted)
            //{
            //    var portalGizmo = BountyHelpers.GetPortalNearMarkerPosition(_markerPosition);
            //    if (portalGizmo == null)
            //    {
            //        Logger.Debug("[Bounty] No portal nearby, keep exploring .");
            //        State = States.SearchingForDestinationWorld;
            //        return false;
            //    }
            //    _interactionCoroutine.DiaObject = portalGizmo;
            //}

            if (await _interactionCoroutine.GetCoroutine())
            {
                ActorFinder.InteractWhitelist.Remove(_actorId);
                if (_interactionCoroutine.State == InteractionCoroutine.States.TimedOut)
                {
                    Logger.Debug("[Bounty] Couldn't interact with the unit, failing.");
                    State = States.Failed;
                    return(false);
                }
                State = States.Completed;
                _interactionCoroutine = null;
                return(false);
            }
            return(false);
        }
Exemplo n.º 2
0
        private async Task <bool> InteractingWithUrshi()
        {
            DisablePulse();
            if (RiftData.VendorDialog.IsVisible)
            {
                State = States.UpgradingGems;
                return(false);
            }
            if (!await _interactWithUrshiCoroutine.GetCoroutine())
            {
                return(false);
            }
            await Coroutine.Wait(2500, () => RiftData.VendorDialog.IsVisible);

            _interactWithUrshiCoroutine.Reset();
            if (!RiftData.VendorDialog.IsVisible)
            {
                return(false);
            }

            _gemUpgradesLeft      = 3;
            _enableGemUpgradeLogs = false;
            State = States.UpgradingGems;
            return(false);
        }
Exemplo n.º 3
0
        private async Task <bool> TalkToOrek()
        {
            DisablePulse();
            if (AdvDia.RiftQuest.State == QuestState.InProgress && AdvDia.RiftQuest.Step == RiftStep.Cleared)
            {
                if (!await _talkToOrekCoroutine.GetCoroutine())
                {
                    return(false);
                }
                _talkToOrekCoroutine.Reset();
                if (AdvDia.RiftQuest.Step == RiftStep.Cleared)
                {
                    State = States.MoveToOrek;
                    return(false);
                }
                await Coroutine.Sleep(1200);

                await Coroutine.Wait(TimeSpan.FromSeconds(5), () => !ZetaDia.Me.IsParticipatingInTieredLootRun);

                if (ZetaDia.Me.IsParticipatingInTieredLootRun)
                {
                    Logger.Info("[Rift] Oh well, I seem to think that the rift is still active, that means I'll not be able to clear out my packs properly, sorry in advance.");
                }
            }

            _experienceTracker.StopAndReport("Rift");
            _experienceTracker.Start();
            State = States.TownRun;
            return(false);
        }
Exemplo n.º 4
0
        private async Task <bool> Interacting()
        {
            //if (_interactionCoroutine.State == InteractionCoroutine.States.NotStarted)
            //{
            //    var portalGizmo = BountyHelpers.GetPortalNearMarkerPosition(_markerPosition);
            //    if (portalGizmo == null)
            //    {
            //        Core.Logger.Debug("[Bounty] No portal nearby, keep exploring .");
            //        State = States.SearchingForDestinationWorld;
            //        return false;
            //    }
            //    _interactionCoroutine.DiaObject = portalGizmo;
            //}

            Core.Logger.Debug("[InteractWithGizmo] Starting interaction subroutine.");

            if (await _interactionCoroutine.GetCoroutine())
            {
                ActorFinder.InteractWhitelist.Remove(_actorId);
                if (_interactionCoroutine.State == InteractionCoroutine.States.TimedOut)
                {
                    Core.Logger.Error("[InteractWithGizmo] Interaction timed out.");
                    State = States.Failed;
                    return(false);
                }

                if (_useAll)
                {
                    var nextGizmo = ActorFinder.FindGizmo(_actorId, gizmo => gizmo.IsInteractableQuestObject());
                    if (nextGizmo != null)
                    {
                        Core.Logger.Warn("Found another actor that needs some interaction. Dist={0}", nextGizmo.Distance);
                        State = States.Searching;
                        return(false);
                    }
                }

                var actor = ActorFinder.FindGizmo(_actorId);
                if (actor == null)
                {
                    Core.Logger.Log($"No Gizmo Found.");
                    State = States.Failed;
                    return(false);
                }

                if (await(MoveToAndInteract.Execute(actor)))
                {
                    State = States.Completed;
                    _interactionCoroutine = null;
                    return(false);
                }
            }
            return(false);
        }
Exemplo n.º 5
0
 private async Task <bool> InteractingWithHolyCow()
 {
     EnablePulse();
     if (!await _talkToHolyCowCoroutine.GetCoroutine())
     {
         return(false);
     }
     _talkToHolyCowCoroutine.Reset();
     Logger.Info("[Rift] Mooo moooo....");
     State = States.SearchingForExitPortal;
     return(false);
 }
Exemplo n.º 6
0
        private async Task <bool> OpeningRift()
        {
            if (RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId))
            {
                State = States.OnNewRiftLevel;
                return(false);
            }
            DisablePulse();
            if (!await _interactWithRiftStoneInteractionCoroutine.GetCoroutine())
            {
                return(false);
            }
            await Coroutine.Wait(2500, () => UIElements.RiftDialog.IsVisible);

            _interactWithRiftStoneInteractionCoroutine.Reset();
            if (!UIElements.RiftDialog.IsVisible)
            {
                return(false);
            }
            _riftStartTime = DateTime.UtcNow;

            long empoweredCost;

            if (_RiftType == RiftType.Greater && _options.IsEmpowered && RiftData.EmpoweredRiftCost.TryGetValue(_level, out empoweredCost) && ZetaDia.PlayerData.Coinage >= empoweredCost)
            {
                Logger.Info("Opening Empowered Greater Rift (Cost={0})", empoweredCost);
                ZetaDia.Me.OpenRift(_level, true);
            }
            else
            {
                Logger.Info("Opening {0} Rift", _RiftType);
                ZetaDia.Me.OpenRift(_level);
            }

            if (_level == -1)
            {
                await Coroutine.Sleep(5000);

                if (IsRiftPortalOpen)
                {
                    _prePortalWorldDynamicId = AdvDia.CurrentWorldDynamicId;
                    State = States.EnteringRift;
                }
            }
            else
            {
                await Coroutine.Wait(30000, () => ZetaDia.CurrentRift.IsStarted && RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId) && !ZetaDia.IsLoadingWorld);

                DisablePulse();
                State = States.EnteringGreaterRift;
            }
            return(false);
        }
Exemplo n.º 7
0
        private async Task <bool> OpeningRift()
        {
            if (RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId))
            {
                State = States.OnNewRiftLevel;
                return(false);
            }
            DisablePulse();
            if (!await _interactWithRiftStoneInteractionCoroutine.GetCoroutine())
            {
                return(false);
            }
            await Coroutine.Wait(2500, () => UIElements.RiftDialog.IsVisible);

            _interactWithRiftStoneInteractionCoroutine.Reset();
            if (!UIElements.RiftDialog.IsVisible)
            {
                return(false);
            }
            _riftStartTime = DateTime.UtcNow;
            ZetaDia.Me.OpenRift(_level);
            if (_level == -1)
            {
                await Coroutine.Sleep(5000);

                if (IsRiftPortalOpen)
                {
                    _prePortalWorldDynamicId = AdvDia.CurrentWorldDynamicId;
                    State = States.EnteringRift;
                }
            }
            else
            {
                await Coroutine.Wait(30000, () => ZetaDia.CurrentRift.IsStarted && RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId) && !ZetaDia.IsLoadingWorld);

                DisablePulse();
                State = States.EnteringGreaterRift;
            }
            return(false);
        }
Exemplo n.º 8
0
        private async Task <bool> InteractingWithUrshi()
        {
            DisablePulse();
            if (RiftData.VendorDialog.IsVisible)
            {
                State = States.UpgradingGems;
                return(false);
            }

            var urshi = ZetaDia.Actors.GetActorsOfType <DiaUnit>().FirstOrDefault(a => a.IsFullyValid() && a.ActorSnoId == RiftData.UrshiSNO);

            if (urshi == null)
            {
                Core.Logger.Debug("[UpgradeGems] Can't find the Urshi lady :(");
                State = States.Failed;
                return(false);
            }

            if (!await _interactWithUrshiCoroutine.GetCoroutine())
            {
                return(false);
            }

            await Coroutine.Wait(2500, () => RiftData.VendorDialog.IsVisible);

            _interactWithUrshiCoroutine.Reset();

            if (!RiftData.VendorDialog.IsVisible)
            {
                return(false);
            }

            _gemUpgradesLeft      = 3;
            _enableGemUpgradeLogs = false;
            State = States.UpgradingGems;
            return(false);
        }
Exemplo n.º 9
0
 private async Task <bool> InteractingWithTyrael()
 {
     if (await _interactionCoroutine.GetCoroutine())
     {
         if (!ZetaDia.Storage.Quests.AllQuests.Any(q => q.Quest == BountyHelpers.ActBountyFinishingQuests[_act] && q.State == QuestState.InProgress))
         {
             State = States.Completed;
             return(false);
         }
         var tyrael = ActorFinder.FindUnit(TYRAEL);
         if (tyrael == null)
         {
             Core.Logger.Error("[CompleteActBounties] Couldn't detect Tyrael. Failing");
             State = States.Failed;
             return(false);
         }
         if (tyrael.IsFullyValid() && tyrael.CommonData.MarkerType == MarkerType.Exclamation)
         {
             return(false);
         }
         State = States.Completed;
     }
     return(false);
 }
        private async Task <bool> Interacting()
        {
            var startSide = DeathGates.MySide;
            var startGate = ActorFinder.FindNearestDeathGate();

            if (startGate == null)
            {
                Core.Logger.Debug("Can't find a gate nearby");
                State = States.Failed;
                return(false);
            }
            if (startGate.Distance > startGate.CollisionSphere.Radius)
            {
                Core.Logger.Debug("Gate is too far away to interact");
                State = States.MovingToGate;
                return(false);
            }

            if (_interactionCoroutine == null || _interactionCoroutine.IsDone)
            {
                Core.Logger.Debug($"Interacting with {startGate.Name} at {startGate.Position} Distance={startGate.Distance} CurrentScene={CurrentGateScene}");
                _interactionCoroutine = new InteractionCoroutine(startGate.ActorSnoId, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(1), 5);
            }

            if (!await _interactionCoroutine.GetCoroutine())
            {
                return(false);
            }

            if (_interactionCoroutine.State == InteractionCoroutine.States.Failed)
            {
                Core.Logger.Debug("InteractionCoroutine reports interaction with gate failed");
                State = States.Failed;
                return(false);
            }

            if (TargetGatePosition.Distance(AdvDia.MyPosition) <= 10f)
            {
                Core.Logger.Debug("Interaction with gate failed, we didnt move anywhere.");
                State = States.Failed;
                return(false);
            }

            _gatesUsed++;

            //var endGateInteractPos = DeathGates.NearestGateToPosition(endGate.Position);
            var endGateInteractPos = CurrentGateScene.PortalPositions.FirstOrDefault(p => p != TargetGatePosition);

            Core.Logger.Debug($"Ignoring Gate at {endGateInteractPos} within {CurrentGateScene.Name} {DeathGates.MySide}");
            _usedGatePositions.Add(endGateInteractPos);

            Core.Logger.Debug($"Ignoring Gate at {TargetGatePosition} within {CurrentGateScene.Name} {startSide}");
            _usedGatePositions.Add(TargetGatePosition);

            Core.Logger.Debug($"Gate #{_gatesUsed} at {TargetGatePosition} within {CurrentGateScene.Name} ({startSide}=>{DeathGates.MySide}) was used successfully");
            if (_gatesToUse >= 0 && _gatesUsed >= _gatesToUse)
            {
                Core.Logger.Debug($"We've used all the gates we're supposed to ({_gatesUsed})");
                State = States.Completed;
                return(false);
            }
            State = States.Searching;
            return(false);
        }