Exemplo n.º 1
0
        public async Task <bool> Run()
        {
            if (!Constants.InDeepDungeon)
            {
                return(false);
            }

            if (Target == null)
            {
                return(false);
            }

            if (AvoidanceManager.IsRunningOutOfAvoid)
            {
                return(false);
            }

            if (Navigator.InPosition(Core.Me.Location, Target.Location, 3f) &&
                Target.Type == (PoiType)PoiTypes.ExplorePOI)
            {
                Poi.Clear("We have reached our destination");
                return(true);
            }

            var status =
                $"Current Level {DeepDungeonManager.Level}. Level Status: {PortalPercent}% \"Done\": {DDTargetingProvider.Instance.LevelComplete}";

            TreeRoot.StatusText = status;

            if (ActionManager.IsSprintReady && Target.Location.Distance2D(Core.Me.Location) > 5 &&
                MovementManager.IsMoving)
            {
                ActionManager.Sprint();
                return(true);
            }

            var res = await CommonTasks.MoveAndStop(
                new MoveToParameters(Target.Location, "Moving toward POTD Objective"), 1.5f);

            if (res == false)
            {
                if (Poi.Current.Unit != null)
                {
                    DDTargetingProvider.Instance.AddToBlackList(Poi.Current.Unit, $"Move Failed: Blacklisted {Poi.Current.Unit.EnglishName}");
                }

                Poi.Clear("Clearing poi: Move Failed");
            }

            //if (Target.Unit != null)
            //{
            //    Logger.Verbose($"[PotdNavigator] Move Results: {res} Moving To: \"{Target.Unit.Name}\" LOS: {Target.Unit.InLineOfSight()}");
            //}
            //else
            //{
            //    Logger.Verbose($"[PotdNavigator] Move Results: {res} Moving To: \"{Target.Name}\" ");
            //}

            return(res);
        }
Exemplo n.º 2
0
        protected override async Task <bool> Main()
        {
            await CommonTasks.HandleLoading();

            return(HandleDeath() || HandleCondition() || await CastTruth() || await SelectGig() || HandleReset() || await MoveToHotSpot() ||
                   await FindNode() || await ResetOrDone());
        }
Exemplo n.º 3
0
        public async Task <bool> Run()
        {
            if (Target.Type != PoiType.Wait)
            {
                return(false);
            }

            //let the navigator handle movement if we are far away
            if (Target.Location.Distance2D(Core.Me.Location) > 3)
            {
                return(false);
            }

            // move closer plz
            if (Target.Location.Distance2D(Core.Me.Location) >= 2)
            {
                await CommonTasks.MoveAndStop(new MoveToParameters(Target.Location, "Floor Exit"), 0.5f, true);

                return(true);
            }
            else
            {
                await CommonTasks.StopMoving();
            }

            var _level = DeepDungeonManager.Level;
            await Coroutine.Wait(-1, () => Core.Me.InCombat || _level != DeepDungeonManager.Level || CommonBehaviors.IsLoading || QuestLogManager.InCutscene);

            Poi.Clear("Floor has changed or we have entered combat");
            Navigator.Clear();
            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Uses a pomander of witching when there are 3 mobs in combat around us
        /// </summary>
        /// <returns></returns>
        private async Task <bool> UseWitching()
        {
            if (
                !DeepDungeonManager.BossFloor &&
                DeepDungeonManager.GetInventoryItem(Pomander.Witching).Count > 0 &&
                GameObjectManager.NumberOfAttackers >= 3 &&
                !GameObjectManager.Attackers.Any(i =>
                                                 i.HasAura(Auras.Frog) ||
                                                 i.HasAura(Auras.Imp) ||
                                                 i.HasAura(Auras.Chicken)) //Toad
                &&
                (!PartyManager.IsInParty || PartyManager.IsPartyLeader)
                )
            {
                Logger.Info("Witching debug: {0} {1} {2} {3} {4}",
                            !DeepDungeonManager.BossFloor,
                            DeepDungeonManager.GetInventoryItem(Pomander.Witching).Count,
                            GameObjectManager.NumberOfAttackers,
                            !GameObjectManager.Attackers.Any(i =>
                                                             i.HasAura(Auras.Frog) ||
                                                             i.HasAura(Auras.Imp) ||
                                                             i.HasAura(Auras.Chicken)),
                            (!PartyManager.IsInParty || PartyManager.IsPartyLeader)
                            );
                await CommonTasks.StopMoving("Use Pomander");

                var res = await Tasks.Coroutines.Common.UsePomander(Pomander.Witching);

                await Coroutine.Yield();

                return(res);
            }
            return(false);
        }
Exemplo n.º 5
0
        public async Task <bool> TitanHandler(BattleCharacter c)
        {
            if (!c.HasTarget && c.CurrentHealthPercent > 50f)
            {
                if (Core.Me.Location.Distance(new Vector3(1.102976f, 3.576279E-07f, -0.1875899f)) < 10f)
                {
                    // Use random point @ 19y radius instead of a specific point.
                    await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(new Vector3(-1.27678f, -0.002887249f, 19.67578f), "Geocrush"), 1f, true);

                    return(true);
                }
                await CommonTasks.StopMoving();

                return(true);
            }
            if (!c.HasTarget && c.CurrentHealthPercent < 50f)
            {
                if (Core.Me.Location.Distance(new Vector3(1.102976f, 3.576279E-07f, -0.1875899f)) < 10f)
                {
                    // Use random point @ 17y radius instead of a specific point.
                    await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(new Vector3(0.1695436f, -0.002887011f, -18.18046f), "Geocrush"), 1f, true);

                    return(true);
                }
                await CommonTasks.StopMoving();

                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
        public void CacheItemRemoved(string k, object v, CacheItemRemovedReason r)
        {
            // do stuff here if it matches our taskname, like WebRequest


            // re-add our task so it recurs
            try
            {
                DateTime moment = DateTime.Now;
                int      day    = moment.Day;
                int      hour   = moment.Hour;


                if (hour == 7)
                {
                    CommonTasks Tasking = new CommonTasks();

                    if (day == 1)
                    {
                        Tasking.AddExpenseToHorseLanders();
                    }

                    Tasking.InsertChecksToMas();

                    Tasking.InsertSchedularToken();
                }
            }
            catch (Exception ex)
            {
            }


            AddTask(k, Convert.ToInt32(v));
        }
Exemplo n.º 7
0
        public async Task <bool> Run()
        {
            if (MoveTimer.IsFinished && (Poi.Current != null && Poi.Current.Type != PoiType.None))
            {
                var path = StraightPathHelper.RealStraightPath();
                Logger.Info($"Dump path:");
                foreach (var x in path)
                {
                    Logger.Info(x.ToString());
                }

                Logger.Warn("No activity was detected for {0} seconds. Clearing POI and trying again.", MoveTimer.WaitTime.TotalSeconds);
                Poi.Clear("No activity detected");
                MoveTimer.Reset();
                return(true);
            }
            else if (MoveTimer.IsFinished)
            {
                Logger.Warn("No activity was detected for {0} seconds. Clearing Navigator?", MoveTimer.WaitTime.TotalSeconds);
                await CommonTasks.StopMoving();

                Navigator.Clear();
                MoveTimer.Reset();
                return(true);
            }

            return(false);
        }
Exemplo n.º 8
0
        protected sealed override async Task <bool> Main()
        {
            await CommonTasks.HandleLoading();

            if (Target != null && await CustomLogic())
            {
                return(true);
            }

            if (ItemTarget != 0 && await UseItem())
            {
                return(true);
            }

            if (!Position.WithinHotSpot2D(Core.Player.Location, Distance * Distance) &&
                await MoveAndStop(Position, Distance, "Moving to HotSpot", true, (ushort)MapId, MountDistance))
            {
                return(true);
            }

            if (Hotspots.Count != 0 && Position.WithinHotSpot2D(Core.Player.Location, Radius))
            {
                Hotspots.Next();
            }

            return(false);
        }
Exemplo n.º 9
0
        public override async Task <bool> MoveToSpot(ExGatherTag tag)
        {
            tag.StatusText = "Moving to " + this;

            var result =
                await
                NodeLocation.MoveTo(
                    UseMesh,
                    radius : tag.Distance,
                    name : tag.Node.EnglishName,
                    stopCallback : tag.MovementStopCallback,
                    dismountAtDestination : true);

            if (result)
            {
                var landed = MovementManager.IsDiving || await CommonTasks.Land();

                if (landed && Core.Player.IsMounted)
                {
                    ActionManager.Dismount();
                }

                Navigator.Stop();
                await Coroutine.Yield();

                await tag.CastAura(Ability.Stealth, AbilityAura.Stealth);
            }

            await Coroutine.Yield();

            return(result);
        }
Exemplo n.º 10
0
        public async Task <bool> Run()
        {
            if (WorldManager.ZoneId != 570)
            {
                return(false);
            }
            TreeRoot.StatusText = "Lobby Room";
            if (_target == null || !_target.IsValid)
            {
                Logger.Warn($"Unable to find Lobby Target");
                return(false);
            }
            if (!Navigator.InPosition(_target.Location, Core.Me.Location, 3))
            {
                if (!await CommonTasks.MoveAndStop(new MoveToParameters(_target.Location, "Moving to Lobby Exit"), 3))
                {
                    Logger.Warn("Failed to move toward the exit?");
                }
                return(true);
            }
            _target.Interact();
            await Coroutine.Wait(250, () => SelectYesno.IsOpen);

            SelectYesno.ClickYes();
            return(true);
        }
        public async Task <bool> MagitekTerminalHandler7(GameObject context)
        {
            var MagitekTerminalVIII = GameObjectManager.GetObjectByNPCId(2000483);
            var MagitekTerminalIX   = GameObjectManager.GetObjectByNPCId(2000484);

            if (ScriptHelper.InCombat())
            {
                return(false);
            }
            if (MagitekTerminalVIII.IsVisible && Core.Me.Distance2D(MagitekTerminalVIII.Location) > 1f)
            {
                await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(MagitekTerminalVIII.Location, "Magitek Terminal VIII"), 0.5f, true);

                while (MagitekTerminalVIII.IsVisible)
                {
                    await CommonTasks.StopMoving();
                }
                return(true);
            }
            if (MagitekTerminalIX.IsVisible && Core.Me.Distance2D(MagitekTerminalIX.Location) > 1f)
            {
                await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(MagitekTerminalIX.Location, "Magitek Terminal IX"), 0.5f, true);

                while (MagitekTerminalIX.IsVisible)
                {
                    await CommonTasks.StopMoving();
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 12
0
        public static async Task <bool> DesynthesizeAllItems(
            IEnumerable <BagSlot> bagSlots,
            ushort maxWait = 5000,
            bool desynthUniqueUntradeable = false)
        {
            foreach (var bagSlot in bagSlots)
            {
                if (!desynthUniqueUntradeable && bagSlot.Item != null && (bagSlot.Item.Unique || bagSlot.Item.Untradeable))
                {
                    continue;
                }

                if (bagSlot != null)
                {
                    var startingId = bagSlot.TrueItemId;

                    //Check to make sure the bagslots contents doesn't change
                    while (bagSlot.TrueItemId == startingId && bagSlot.Count > 0)
                    {
                        var result = await CommonTasks.Desynthesize(bagSlot, maxWait);

                        if (result.HasFlag(DesynthesisResult.Failure))
                        {
                            Logger.Instance.Error(Localization.Localization.SalvageDialog, result);
                            break;
                        }
                    }
                }

                await Behaviors.Sleep(500);
            }

            return(true);
        }
Exemplo n.º 13
0
        public async Task <bool> ZenosYaeGalvusHandler(BattleCharacter c)
        {
            if (c.IsCasting && _artOfTheSwell.Contains(c.CastingSpellId))
            {
                if (Core.Me.Distance2D(c) > 5f)
                {
                    await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(c.Location, "Zenos yae Galvus"), 5f, true);

                    return(true);
                }
            }

            //todo detect if we have the tether
            //if(HAVE TETHER){
            //249.99f, 122.00f, -365.01

            //var headingInRad = MoveResultExtensions.CalculateNeededFacing(CurrentBoss.Location, c.Location);
            //var pointClosestToWall = MathEx.GetPointAt(c.Location, 3, headingInRad);
            //Move toward that point
            //await CommonTasks.MoveTo(pointClosestToWall);
            //return true
            //}

            return(false);
        }
Exemplo n.º 14
0
        public async Task <bool> AulusMalAsinaHandler(BattleCharacter c)
        {
            if (c.IsCasting && (c.CastingSpellId == 8954 || c.CastingSpellId == 8270))
            {
                _mindJackPos = Core.Me.Location;

                //we can't do combat while he is casting MindJack.
                return(true);
            }

            if (Core.Me.HasAura(779))
            {
                if (_mindJackPos != Vector3.Zero)
                {
                    await CommonTasks.MoveTo(_mindJackPos);
                }
                else
                {
                    Logger.Warning("We don't know where our body is");
                    _mindJackPos = GameObjectManager.GetObjectsByNPCId(6666).OrderByDescending(i => i.Distance2D()).First().Location;
                    await CommonTasks.MoveTo(_mindJackPos);
                }
                return(true); //can't do combat here
            }

            return(false);
        }
Exemplo n.º 15
0
        protected sealed override async Task Main()
        {
            if (!IsDone)
            {
                await CommonTasks.HandleLoading();

                await GoThere();

                if (Target != null && !Blacklist.Contains(Target.ObjectId))
                {
                    await CustomLogic();
                }
                else
                {
                    if (ItemTarget != 0)
                    {
                        await UseItem();
                    }

                    if (!Position.WithinHotSpot2D(Me.Location, 5f))
                    {
                        await MoveAndStop(Position, Distance, "Searching for a Target for " + QuestName);
                    }

                    if (Hotspots.Count != 0 && Position.WithinHotSpot2D(Me.Location, 5f))
                    {
                        Hotspots.Next();
                    }
                }

                await Coroutine.Yield();
            }
        }
Exemplo n.º 16
0
        public async Task <bool> Run()
        {
            //we are inside POTD
            if (Constants.InDeepDungeon || Constants.InExitLevel)
            {
                return(false);
            }

            if (WorldManager.ZoneId != Constants.SouthShroudZoneId ||
                GameObjectManager.GetObjectByNPCId(Constants.CaptainNpcId) == null ||
                GameObjectManager.GetObjectByNPCId(Constants.CaptainNpcId).Distance2D(Core.Me.Location) > 35)
            {
                if (Core.Me.IsCasting)
                {
                    await Coroutine.Sleep(500);

                    return(true);
                }

                if (!WorldManager.TeleportById(5))
                {
                    Logger.Error("We can't get to Quarrymill. something is very wrong...");
                    TreeRoot.Stop();
                    return(false);
                }
                await Coroutine.Sleep(1000);

                return(true);
            }
            if (GameObjectManager.GetObjectByNPCId(Constants.CaptainNpcId) == null || GameObjectManager.GetObjectByNPCId(Constants.CaptainNpcId).Distance2D(Core.Me.Location) > 4f)
            {
                return(await CommonTasks.MoveAndStop(new MoveToParameters(Constants.CaptainNpcPosition, "Moving toward NPC"), 4f, true));
            }
            return(false);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Performs automatic mounting/dismounting.
        /// </summary>
        /// <param name="characterToWatch"></param>
        /// <returns></returns>
        private async Task <bool> PerformMountDismount(BattleCharacter characterToWatch)
        {
            if (characterToWatch.IsMounted != Core.Me.IsMounted || characterToWatch.IsCasting && characterToWatch.CastingSpellId == Action.Mount)
            {
                if (!Core.Me.InCombat)
                {
                    // Mount up!
                    if (characterToWatch.IsMounted || characterToWatch.CastingSpellId == Action.Mount)
                    {
                        LogHelper.Instance.Log(
                            "[{0}] Mounting...",
                            CallStackHelper.Instance.GetCaller());
                        await CommonTasks.MountUp();

                        return(await Task.FromResult(true));
                    }
                }

                // Dismount - but only when close to the leader!
                if (characterToWatch.Distance2D() <= BotBase.Instance.FollowDistance + 0.5f)
                {
                    LogHelper.Instance.Log(
                        "[{2}] Dismounting, {0} <= {1}...",
                        characterToWatch.Distance2D(), BotBase.Instance.FollowDistance + 0.5f, CallStackHelper.Instance.GetCaller());
                    await CommonTasks.StopAndDismount();

                    return(await Task.FromResult(true));
                }
            }

            return(await Task.FromResult(false));
        }
Exemplo n.º 18
0
 public override void OnEnter()
 {
     TsLog.Log("====== {0}.OnEnter", new object[]
     {
         base.GetType().FullName
     });
     if (TsPlatform.IsLowSystemMemory)
     {
         TsSceneSwitcher.Instance.DeleteScene(TsSceneSwitcher.ESceneType.WorldScene);
         TsSceneSwitcher.Instance.DeleteScene(TsSceneSwitcher.ESceneType.SoldierBatchScene);
         Holder.ClearStackItem(Option.IndependentFromStageStackName, false);
         base.StartTaskSerial(CommonTasks.LoadEmptyMainScene());
         base.StartTaskSerial(CommonTasks.MemoryCleaning(true, 8));
     }
     Scene.ChangeSceneType(this.SceneType());
     base.StartTaskSerial(CommonTasks.InitializeChangeScene());
     base.StartTaskSerial(this._StageProcess());
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/CharEffect/cameramove{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._funcDownloadedCameraTarget), null, true));
     base.StartTaskSerial(this._StageAfterBattleMapLoadProcess());
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/CharEffect/fx_battledamage{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._funcDownloadedDamage), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_result{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._funcDownloadedResultEffect), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_battlearrow{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleArrowDownload), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_skill_directing{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleSkillDirectingDownload), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_battle_fatality{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleSkillRivalDirectingDownload), null, true));
     base.StartTaskSerial(CommonTasks.DownloadAsset(string.Format("Effect/Instant/fx_angergauge{0}{1}", NrTSingleton <UIDataManager> .Instance.AddFilePath, Option.extAsset), new PostProcPerItem(this._fundBattleControlAngergaugeDownload), null, true));
     base.StartTaskSerial(this.DownLoadColosseumEffect());
     base.StartTaskSerial(CommonTasks.MemoryCleaning(true, 8));
     base.StartTaskSerial(CommonTasks.LoadEnvironment(true));
     NrLoadPageScreen.IncreaseProgress(1f);
     NrLoadPageScreen.IncreaseProgress(1f);
     base.StartTaskSerial(CommonTasks.FinalizeChangeScene(true));
     base.StartTaskSerial(this._StageStartBattle());
     base.StartTaskPararell(this._UpdateBattleTemporal());
 }
Exemplo n.º 19
0
        private static void SetTimer(string key, object value, CacheItemRemovedReason reason)
        {
            try
            {
                DateTime moment = DateTime.Now;
                int      day    = moment.Day;

                int hour = moment.Hour;


                if (hour == 9)
                {
                    CommonTasks Tasking = new CommonTasks();

                    if (day == 1)
                    {
                        Tasking.AddExpenseToHorseLanders();
                    }
                    Tasking.InsertChecksToMas();
                }
            }
            catch
            {
            }
            finally
            {
                //  StartMailChecker();
            }
        }
Exemplo n.º 20
0
        public async Task <bool> AetherialFlowHandler(GameObject context)
        {
            if (ScriptHelper.InCombat())
            {
                return(false);
            }
            if (SelectYesno.IsOpen)
            {
                SelectYesno.ClickYes();
                return(true);
            }
            while (!Navigator.InPosition(context.Location, Core.Me.Location, 3f) && ScriptHelper.IsTodoChecked(0))
            {
                Navigator.PlayerMover.MoveTowards(context.Location);
                MovementManager.Jump();
                return(true);
            }
            if (ScriptHelper.IsTodoChecked(0))
            {
                if (MovementManager.IsMoving)
                {
                    await CommonTasks.StopMoving();

                    return(true);
                }
            }
            return(await ScriptHelper.ObjectInteraction(context));

            return(false);
        }
Exemplo n.º 21
0
        protected override async Task <bool> Main()
        {
            if (!ScriptManager.GetCondition(Condition)())
            {
                Logger.Info(Localization.Localization.ExSalvage_GetCondition, Condition);
                return(isDone = true);
            }

            if (MovementManager.IsFlying
#if !RB_CN
                || MovementManager.IsDiving
#endif
                )
            {
                Logger.Error(Localization.Localization.ExSalvage_Land);
                return(isDone = true);
            }

            await CommonTasks.StopAndDismount();

            if (RepairClass > ClassJobType.Thaumaturge && RepairClass < ClassJobType.Miner)
            {
                await SalvageDialog.DesynthesizeByRepairClass(RepairClass, (ushort)MaxWait, IncludeArmory, NqOnly);
            }

            if (ItemIds != null && ItemIds.Length > 0)
            {
                foreach (var id in ItemIds)
                {
                    await SalvageDialog.DesynthesizeByItemId((uint)id, (ushort)MaxWait, IncludeArmory, NqOnly);
                }
            }

            return(isDone = true);
        }
Exemplo n.º 22
0
        public async Task <bool> ThunderclapGuivreHandler(BattleCharacter c)
        {
            var electrifiedWaterId = GameObjectManager.GetObjectByNPCId(2001648);

            if (!electrifiedWaterId.IsVisible)
            {
                var lightningSpriteId = GameObjectManager.GetObjectByNPCId(117);

                if (Core.Me.HasAura(288))
                {
                    var safeSpotLeft  = new Vector3(-161.57f, -7.15f, -102.57f);
                    var safeSpotRight = new Vector3(-149.98f, -9.59f, -152.10f);

                    // Find both points, but go to the closest one, or the one the group is going to/at currently.
                    await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(safeSpotLeft, "Left Safe Spot"), 1f, true);

                    // await CommonTasks.MoveAndStop(new ff14bot.Pathing.MoveToParameters(new Vector3(safeSpotRight), "Right Safe Spot"), 1f, true);
                    return(true);
                }
                if (lightningSpriteId.IsVisible)
                {
                    return(false);
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 23
0
        protected async override Task <bool> Main()
        {
            await CommonTasks.HandleLoading();

            if (UseMesh)
            {
                if (await MoveAndStop(Destination, Distance, "Moving to Destination", true, (ushort)MapId, MountDistance))
                {
                    return(true);
                }
                _done = true;
            }
            else
            {
                Core.Player.Face(Destination);
                MovementManager.MoveForwardStart();

                if (!Navigator.InPosition(Core.Player.Location, Destination, Distance))
                {
                    return(true);
                }
                else
                {
                    _done = true;
                }
            }

            return(false);
        }
Exemplo n.º 24
0
        protected async Task <bool> ConvertAllItems(
            IEnumerable <BagSlot> bagSlots,
            ushort maxWait)
        {
            foreach (var bagSlot in bagSlots)
            {
                var name = bagSlot.Name;
                Log("Attempting to convert {0}.", name);
                if (bagSlot.Item != null && (bagSlot.Item.Unique || bagSlot.Item.Untradeable))
                {
                    continue;
                }
                var startingId = bagSlot.TrueItemId;
                //Check to make sure the bagslots contents doesn't change
                while (bagSlot.TrueItemId == startingId && bagSlot.Count > 0)
                {
                    var result = await CommonTasks.ConvertToMateria(bagSlot, maxWait);

                    if (result.HasFlag(SpiritbondResult.Success))
                    {
                        continue;
                    }
                    Log("Unable to convert \"{0}\" due to {1}.", name, result);
                    break;
                }
                await Coroutine.Sleep(500);
            }
            return(true);
        }
Exemplo n.º 25
0
        /*
         * public static async Task GoGarden(uint AE, Vector3 gardenLoc)
         * {
         *  Navigator.PlayerMover = new SlideMover();
         *  Navigator.NavigationProvider = new ServiceNavigationProvider();
         *  var house = WorldManager.AvailableLocations.FirstOrDefault(i => i.AetheryteId == AE);
         *
         *  Log($"Teleporting to housing: (ZID: {DataManager.ZoneNameResults[house.ZoneId]}, AID: {house.AetheryteId}) {house.Name}");
         *  await CommonTasks.Teleport(house.AetheryteId);
         *
         *  Log("Waiting for zone to change.");
         *  await Coroutine.Wait(20000, () => WorldManager.ZoneId == house.ZoneId);
         *
         *  Log("Moving to selected garden plot.");
         *
         *  if (gardenLoc != null)
         *  {
         *      await Navigation.FlightorMove(gardenLoc);
         *      await GardenHelper.Main(gardenLoc);
         *  }
         * }
         */

        public static async Task GoGarden(uint AE, Vector3 gardenLoc, List <Tuple <uint, uint> > plantPlan)
        {
            if (gardenLoc != default(Vector3))
            {
                Navigator.PlayerMover        = new SlideMover();
                Navigator.NavigationProvider = new ServiceNavigationProvider();
                var house = WorldManager.AvailableLocations.FirstOrDefault(i => i.AetheryteId == AE);

                Log($"Teleporting to housing: {house.Name} (Zone: {DataManager.ZoneNameResults[house.ZoneId]}, Aetheryte: {house.AetheryteId})");
                await GeneralFunctions.StopBusy(dismount : false);

                await CommonTasks.Teleport(house.AetheryteId);

                Log("Waiting for zone to change.");
                await Coroutine.Wait(20000, () => WorldManager.ZoneId == house.ZoneId);

                Log("Moving to selected garden plot.");
                await Navigation.FlightorMove(gardenLoc);
                await Main(gardenLoc);
            }
            else
            {
                Log("No Garden Location set. Exiting Task.");
            }
        }
Exemplo n.º 26
0
        protected async override Task Main()
        {
            await CommonTasks.HandleLoading();

            await GoThere();

            if (UseMesh)
            {
                await MoveAndStop(Destination, Distance, "Moving to Location", true);

                if (InPosition(Destination, Distance))
                {
                    _done = true;
                }
            }
            else
            {
                Me.Face(Destination);
                MovementManager.MoveForwardStart();
                if (InPosition(Destination, Distance))
                {
                    _done = true;
                }
            }
        }
Exemplo n.º 27
0
        private static async Task <Vector3> GetFateLandingLocation()
        {
            var oracleFate  = OracleFateManager.GetCurrentOracleFate();
            var currentFate = OracleFateManager.GetCurrentFateData();

            Logger.SendDebugLog("Generating a landing spot.");

            var landingLocation = await GenerateRandomSpot(currentFate.Location, currentFate.Radius *oracleFate.LandingRadius);

            if (await CommonTasks.CanLand(landingLocation) == CanLandResult.No)
            {
                Logger.SendDebugLog("Landing spot generation failed: we can't land at " + landingLocation + ".");
                return(Core.Player.Location);
            }

            // Add a random height to the landing location so we fly above it, then land using the landing task.
            landingLocation.Y = landingLocation.Y + Convert.ToSingle(MathEx.Random(7, 13));

            // Raycast to generated location from current location to check we can move there.
            Vector3 collision;

            if (WorldManager.Raycast(Core.Player.Location, landingLocation, out collision) &&
                WorldManager.Raycast(landingLocation, Core.Player.Location, out collision))
            {
                Logger.SendDebugLog("Landing spot generation failed: there's a collision at " + collision + ".");
                return(Core.Player.Location);
            }

            Logger.SendDebugLog("Landing spot generation succeeded.");
            return(landingLocation);
        }
Exemplo n.º 28
0
        protected override async Task <bool> Main()
        {
            await CommonTasks.HandleLoading();

            if (FateActive)
            {
                if (NeoProfileManager.CurrentGrindArea == null && ThisFate.Within2D(Core.Player.Location) && await CreateGrindArea())
                {
                    return(true);
                }

                if (NeoProfileManager.CurrentGrindArea != null)
                {
                    if (await MoveAndStop(ThisFate.Location, ThisFate.Radius / 5f, $"Moving to {ThisFate.Name}.", true))
                    {
                        return(true);
                    }

                    if (ThisFate.Within2D(Core.Player.Location) && !Core.Player.IsLevelSynced && ThisFate.MaxLevel < Core.Player.ClassLevel)
                    {
                        RemoteWindows.ToDoList.LevelSync();
                        await Coroutine.Wait(1000, () => Core.Player.IsLevelSynced);
                    }

                    return(await CommonTasks.ExecuteCoroutine(new HookExecutor("HotspotPoi")));
                }
            }
            else if (await MoveAndStop(Destination, Distance * Distance, "Moving to Hotspot", true, (ushort)MapId, MountDistance))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 29
0
        protected async Task <bool> Convert()
        {
            if (GatheringManager.WindowOpen)
            {
                Log("Waiting for gathering window to close");
                Thread.Sleep(2000);
            }

            if (FishingManager.State != FishingState.None)
            {
                Log("Stop fishing");
                Actionmanager.DoAction("Quit", Core.Me);
                await Coroutine.Wait(5000, () => FishingManager.State == FishingState.None);
            }

            await CommonTasks.StopAndDismount();

            if (ItemIds != null && ItemIds.Length > 0)
            {
                foreach (var id in ItemIds)
                {
                    await ConvertByItemId((uint)id, (ushort)MaxWait, NqOnly);
                }
            }

            return(_done = true);
        }
Exemplo n.º 30
0
        protected override async Task <bool> RunAsync()
        {
            IOrderedEnumerable <Treasure> nearbyChests = GameObjectManager.GetObjectsOfType <Treasure>()
                                                         .Where(c => !c.IsOpen && c.Distance() < MaxDistance && _chestNames.Contains(c.Name, StringComparer.OrdinalIgnoreCase))
                                                         .OrderBy(c => c.Distance());

            foreach (Treasure chest in nearbyChests)
            {
                while (Core.Me.Distance(chest.Location) > 1f)
                {
                    await CommonTasks.MoveTo(chest.Location);

                    await Coroutine.Yield();
                }

                Navigator.PlayerMover.MoveStop();

                while (!chest.IsOpen)
                {
                    chest.Interact();
                    await Coroutine.Sleep(1000);
                }
            }

            return(false);
        }