private async Task <bool> MovingToScene()
        {
            if (CurrentGateScene == null)
            {
                Core.Logger.Debug("Can't move to unspecified scene");
                State = States.Failed;
                return(false);
            }

            Core.Logger.Debug($"Not in the nearest gate scene ({CurrentGateScene.Name}), moving...");
            if (_moveToSceneCoroutine == null || _moveToSceneCoroutine.SceneName != CurrentGateScene.Name)
            {
                _moveToSceneCoroutine = new MoveToSceneCoroutine(_questId, _worldId, CurrentGateScene.Name);
            }

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

            if (CurrentGateScene.SnoId != ZetaDia.Me.CurrentScene.SceneInfo.SNOId)
            {
                Core.Logger.Debug("Failed to move to gate scene, finished.");
                State = States.Failed;
                return(false);
            }

            Core.Logger.Debug($"Successfully moved to gate scene {CurrentGateScene.Name}.");
            State = States.Searching;
            return(false);
        }
예제 #2
0
        private async Task <bool> MovingToNearestScene()
        {
            _moveToSceneCoroutine = new MoveToSceneCoroutine(_questId, _sourceWorldId, _nearestScene.Name);

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

            if (AdvDia.MyPosition.Distance(_nearestScene.Center.ToVector3()) > 75 || _moveToSceneCoroutine.State == MoveToSceneCoroutine.States.Failed)
            {
                Core.Logger.Debug("[EnterLevelArea] Nearest scene is unreachable, going back to the normal routine");
                _nearestSceneCooldown = DateTime.UtcNow + TimeSpan.FromSeconds(60);
                _moveToSceneCoroutine = null;
                _nearestScene         = null;
            }

            State = States.Searching;
            return(false);
        }