Ejemplo n.º 1
0
        private static async Task <HandleMinionResult> HandleMinion(YokaiMinion minion)
        {
            if (ConditionParser.HasAtLeast(minion.MedalItemId, YokaiWatchGrindData.GetMedalsToFarm(minion)))
            {
                return(HandleMinionResult.Finished);
            }

            if (minion.Ignored)
            {
                return(HandleMinionResult.Ignored);
            }

            if (SummonMinion.CanSummonMinion() && !await SummonMinion.IsMinionSummoned(minion.EnglishName))
            {
                var summonMinionResult = await SummonMinion.Main(minion.EnglishName);

                if (summonMinionResult != SummonMinionResult.Success)
                {
                    minion.Ignored = true;
                    return(HandleMinionResult.Failed);
                }
            }

            if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == GetMinionMedalZone(minion))
            {
                return(HandleMinionResult.InProgress);
            }

            var medalsToFarm = YokaiWatchGrindData.GetMedalsToFarm(minion) - OracleInventoryManager.GetItemAmount(minion.MedalItemId);

            Logger.SendLog("We need " + medalsToFarm + " Legendary " + minion.EnglishName + " Medal(s). Teleporting to your chosen zone.");
            await ZoneChange.HandleZoneChange(GetMinionMedalZone(minion), true);

            return(HandleMinionResult.InProgress);
        }
Ejemplo n.º 2
0
        internal static async Task <bool> HandleYokaiWatchGrind()
        {
            // Summoning a chocobo dismisses your minion, meaning we can't use it here.
            if (!ChocoboManager.BlockSummon)
            {
                ChocoboManager.BlockSummon = true;
            }

            if (ChocoboManager.Summoned)
            {
                await ChocoboManager.DismissChocobo();
            }

            if (!ConditionParser.HasAtLeast(YokaiWatchGrindData.YokaiMedal, ModeSettings.Instance.YokaiMedalsToFarm))
            {
                if (OracleInventoryManager.IsItemEquipped(YokaiWatchGrindData.YokaiWatchItem, EquipmentSlot.Bracelet))
                {
                    var equipResult = await OracleInventoryManager.EquipItem(YokaiWatchGrindData.YokaiWatchItem, EquipmentSlot.Bracelet);

                    if (equipResult != EquipItemResult.Success)
                    {
                        Logger.SendErrorLog("Unable to equip the Yo-kai Watch.");
                        ignoreNormalMedals = true;
                    }
                }
            }

            foreach (var minion in YokaiWatchGrindData.Minions)
            {
                if (await HandleMinion(minion) == HandleMinionResult.InProgress)
                {
                    return(true);
                }
            }

            if (!ConditionParser.HasAtLeast(YokaiWatchGrindData.YokaiMedal, ModeSettings.Instance.YokaiMedalsToFarm) && !ignoreNormalMedals)
            {
                await TeleportIfNeeded(YokaiWatchGrindData.GetNormalMedalZone());

                return(true);
            }

            if (Core.Player.InCombat)
            {
                return(true);
            }

            Logger.SendLog("We've farmed the medals we need for all minions! Stopping Oracle.");
            await OracleTeleportManager.TeleportToClosestCity();

            OracleBot.StopOracle("We are done!");

            return(true);
        }
Ejemplo n.º 3
0
        public async static Task <String> GetLisbethResplendentOrder()
        {
            if (Carpenter && ConditionParser.HasAtLeast(33210, 60) == false && ConditionParser.HasAtLeast(33154, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Carpenter", 33210, 33202, 33194, 33178, 33170, 33162));
            }
            if (Blacksmith && ConditionParser.HasAtLeast(33211, 60) == false && ConditionParser.HasAtLeast(33155, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Blacksmith", 33211, 33203, 33195, 33179, 33171, 33163));
            }
            if (Armorer && ConditionParser.HasAtLeast(33212, 60) == false && ConditionParser.HasAtLeast(33156, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Armorer", 33212, 33204, 33196, 33180, 33172, 33164));
            }
            if (Goldsmith && ConditionParser.HasAtLeast(33213, 60) == false && ConditionParser.HasAtLeast(33157, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Goldsmith", 33213, 33205, 33197, 33181, 33173, 33165));
            }
            if (Leatherworker && ConditionParser.HasAtLeast(33214, 60) == false && ConditionParser.HasAtLeast(33158, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Leatherworker", 33214, 33206, 33198, 33182, 33174, 33166));
            }
            if (Weaver && ConditionParser.HasAtLeast(33215, 60) == false && ConditionParser.HasAtLeast(33159, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Weaver", 33215, 33207, 33199, 33183, 33175, 33167));
            }
            if (Alchemist && ConditionParser.HasAtLeast(33216, 60) == false && ConditionParser.HasAtLeast(33160, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Alchemist", 33216, 33208, 33200, 33184, 33176, 33168));
            }
            if (Culinarian && ConditionParser.HasAtLeast(33217, 60) == false && ConditionParser.HasAtLeast(33161, 1) == false)
            {
                return(await CalculateLisbethResplendentOrder("Culinarian", 33217, 33209, 33201, 33185, 33177, 33169));
            }

            return("");
        }
Ejemplo n.º 4
0
        public async static Task <String> CalculateLisbethResplendentOrder(String job, int finalItemId, int cMaterialId, int bMaterialId, int cComponentId, int bComponentId, int aComponentId)
        {
            List <LisbethOrder> outList = new List <LisbethOrder>();

            var item           = InventoryManager.FilledSlots.FirstOrDefault(i => i.RawItemId == finalItemId);
            int finalItemCount = (int)(item == null ? 0 : item.Count);

            LisbethOrder order;

            if (ConditionParser.HasAtLeast((uint)cMaterialId, 2))
            {
                order = new LisbethOrder(1, 1, cComponentId, NumberToCraft(finalItemCount, cMaterialId), job);
            }
            else if (ConditionParser.HasAtLeast((uint)bMaterialId, 2))
            {
                order = new LisbethOrder(1, 1, bComponentId, NumberToCraft(finalItemCount, bMaterialId), job);
            }
            else
            {
                order = new LisbethOrder(1, 1, aComponentId, 30 - finalItemCount / 2, job);
            }
            outList.Add(order);
            return(JsonConvert.SerializeObject(outList, Formatting.None));
        }
Ejemplo n.º 5
0
        protected override async Task <bool> Main()
        {
            InitializeFoodName();
            if (CleanBefore)
            {
                for (var i = 1; i <= 3; i++)
                {
                    if (ConditionParser.HasAtLeast(8168, 1))
                    {
                        foreach (var unit in GameObjectManager.GameObjects.OrderBy(r => r.Distance()))
                        {
                            if (unit.EnglishName == "Chocobo Stable")
                            {
                                unit.Interact();
                                break;
                            }
                        }
                        await Coroutine.Wait(5000, () => SelectString.IsOpen);

                        if (!SelectString.IsOpen)
                        {
                            continue;
                        }
                        SelectString.ClickSlot((uint)SelectString.LineCount - 3);
                        await Coroutine.Wait(5000, () => SelectYesno.IsOpen);

                        Log("Cleaning Stable n°{0}", i);
                        SelectYesno.ClickYes();
                        await Coroutine.Sleep(2000);
                    }
                    else
                    {
                        Log("No Magicked Stable Broom left");
                        break;
                    }
                }
            }
            if (!ChocoboManager.IsStabled)
            {
                foreach (var unit in GameObjectManager.GameObjects.OrderBy(r => r.Distance()))
                {
                    if (unit.EnglishName == "Chocobo Stable")
                    {
                        unit.Interact();
                        break;
                    }
                }
                await Coroutine.Wait(5000, () => SelectString.IsOpen);

                if (SelectString.IsOpen)
                {
                    SelectString.ClickSlot(1);
                    await Coroutine.Wait(5000, () => SelectYesno.IsOpen);

                    Log("Chocobo Stabled");
                    SelectYesno.ClickYes();
                }
                else
                {
                    Log("Failed to open menu");
                }
            }
            await Coroutine.Sleep(3000);

            foreach (var unit in GameObjectManager.GameObjects.OrderBy(r => r.Distance()))
            {
                if (unit.EnglishName == "Chocobo Stable")
                {
                    unit.Interact();
                    break;
                }
            }
            await Coroutine.Wait(5000, () => SelectString.IsOpen);

            if (SelectString.IsOpen)
            {
                SelectString.ClickSlot(0);
                await Coroutine.Wait(5000, () => HousingChocoboList.IsOpen);

                await Coroutine.Sleep(1500);

                if (HousingChocoboList.IsOpen)
                {
                    //Look for our chocobo
                    var items = HousingChocoboList.Items;
                    //512 possible chocobos, 14 items per page...
                    for (uint stableSection = 0; stableSection < AgentHousingBuddyList.Instance.TotalPages; stableSection++)
                    {
                        if (stableSection != AgentHousingBuddyList.Instance.CurrentPage)
                        {
                            Log("Switching to page {0}", stableSection);
                            HousingChocoboList.SelectSection(stableSection);
                            await Coroutine.Sleep(5000);

                            items = HousingChocoboList.Items;
                        }
                        for (uint i = 0; i < items.Length; i++)
                        {
                            if (string.IsNullOrEmpty(items[i].PlayerName))
                            {
                                continue;
                            }
                            if (i == 0)
                            {
                                if (items[i].ReadyAt < DateTime.Now)
                                {
                                    Log("Selecting my Chocobo");
                                    HousingChocoboList.SelectMyChocobo();
                                    if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen) && string.Equals("None", ThavnairianOnion, StringComparison.OrdinalIgnoreCase))
                                    {
                                        Log("{0}, {1}'s chocobo is maxed out", items[i].ChocoboName, items[i].PlayerName);
                                        SelectYesno.ClickNo();
                                        await Coroutine.Sleep(1000);

                                        continue;
                                    }
                                    if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen) && !string.Equals("None", ThavnairianOnion, StringComparison.OrdinalIgnoreCase))
                                    {
                                        if (ConditionParser.HasAtLeast(8166, 1))
                                        {
                                            Log("{0}, {1}'s chocobo is maxed out, changing food to Thavnairian Onion", items[i].ChocoboName, items[i].PlayerName);
                                            SelectYesno.ClickNo();
                                            await Coroutine.Wait(1000, () => !SelectYesno.IsOpen);

                                            await Coroutine.Sleep(500);

                                            Log("Selecting {0}, {1}'s chocobo on page {2}", items[i].ChocoboName, items[i].PlayerName, stableSection);
                                            HousingChocoboList.SelectMyChocobo();
                                            await Coroutine.Wait(5000, () => SelectYesno.IsOpen);

                                            SelectYesno.ClickYes();
                                            ChocoboFoodId = 8166;
                                        }
                                        else
                                        {
                                            Log("{0}, {1}'s chocobo is maxed out but you don't have any Thavnairian Onion", items[i].ChocoboName, items[i].PlayerName);
                                            SelectYesno.ClickNo();
                                            await Coroutine.Sleep(1000);

                                            continue;
                                        }
                                    }
                                    Log("Waiting for inventory menu to appear....");
                                    //Wait for the inventory window to open and be ready
                                    //Technically the inventory windows are always 'open' so we check if their callbackhandler has been set
                                    if (!await Coroutine.Wait(5000, () => AgentInventoryContext.Instance.CallbackHandlerSet))
                                    {
                                        Log("Inventory menu failed to appear, aborting current iteration.");
                                        continue;
                                    }
                                    Log("Feeding Chocobo : Food Name : {0}, Food ID : {1}", _chocoboFood[ChocoboFoodId], ChocoboFoodId);
                                    AgentHousingBuddyList.Instance.Feed(ChocoboFoodId);
                                    if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen))
                                    {
                                        SelectYesno.ClickYes();
                                        await Coroutine.Sleep(1000);
                                    }
                                    Log("Waiting for cutscene to start....");
                                    if (await Coroutine.Wait(5000, () => QuestLogManager.InCutscene))
                                    {
                                        Log("Waiting for cutscene to end....");
                                        await Coroutine.Wait(Timeout.Infinite, () => !QuestLogManager.InCutscene);
                                    }
                                    Log("Waiting for menu to reappear....");
                                    await Coroutine.Wait(Timeout.Infinite, () => HousingChocoboList.IsOpen);

                                    await Coroutine.Sleep(1000);
                                }
                                else
                                {
                                    Log("{0}, {1}'s chocobo can't be fed yet ...", items[i].ChocoboName, items[i].PlayerName);
                                }
                            }
                            else if (string.Equals(items[i].PlayerName, PlayerName, StringComparison.OrdinalIgnoreCase) || string.Equals("All", PlayerName, StringComparison.OrdinalIgnoreCase))
                            {
                                if (items[i].ReadyAt < DateTime.Now)
                                {
                                    Log("Selecting {0}, {1}'s chocobo on page {2}", items[i].ChocoboName, items[i].PlayerName, stableSection);
                                    HousingChocoboList.SelectChocobo(i);
                                    //Chocobo is maxed out, don't interact with it again
                                    if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen) && string.Equals("None", ThavnairianOnion, StringComparison.OrdinalIgnoreCase))
                                    {
                                        Log("{0}, {1}'s chocobo is maxed out", items[i].ChocoboName, items[i].PlayerName);
                                        SelectYesno.ClickNo();
                                        await Coroutine.Sleep(1000);

                                        continue;
                                    }
                                    //Chocobo is maxed out, don't interact with it again
                                    if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen) && string.Equals("All", ThavnairianOnion, StringComparison.OrdinalIgnoreCase))
                                    {
                                        if (ConditionParser.HasAtLeast(8166, 1))
                                        {
                                            Log("{0}, {1}'s chocobo is maxed out, changing food to Thavnairian Onion", items[i].ChocoboName, items[i].PlayerName);
                                            SelectYesno.ClickNo();
                                            await Coroutine.Wait(1000, () => !SelectYesno.IsOpen);

                                            await Coroutine.Sleep(500);

                                            Log("Selecting {0}, {1}'s chocobo on page {2}", items[i].ChocoboName, items[i].PlayerName, stableSection);
                                            HousingChocoboList.SelectChocobo(i);
                                            await Coroutine.Wait(5000, () => SelectYesno.IsOpen);

                                            SelectYesno.ClickYes();
                                            ChocoboFoodId = 8166;
                                        }
                                        else
                                        {
                                            Log("{0}, {1}'s chocobo is maxed out but you don't have any Thavnairian Onion", items[i].ChocoboName, items[i].PlayerName);
                                            SelectYesno.ClickNo();
                                            await Coroutine.Sleep(1000);

                                            continue;
                                        }
                                    }
                                    Log("Waiting for inventory menu to appear....");
                                    //Wait for the inventory window to open and be ready
                                    //Technically the inventory windows are always 'open' so we check if their callbackhandler has been set
                                    if (!await Coroutine.Wait(5000, () => AgentInventoryContext.Instance.CallbackHandlerSet))
                                    {
                                        Log("Inventory menu failed to appear, aborting current iteration.");
                                        continue;
                                    }
                                    Log("Feeding Chocobo : Food Name : {0}, Food ID : {1}", _chocoboFood[ChocoboFoodId], ChocoboFoodId);
                                    AgentHousingBuddyList.Instance.Feed(ChocoboFoodId);
                                    if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen))
                                    {
                                        SelectYesno.ClickYes();
                                        await Coroutine.Sleep(1000);
                                    }
                                    Log("Waiting for cutscene to start....");
                                    if (await Coroutine.Wait(5000, () => QuestLogManager.InCutscene))
                                    {
                                        Log("Waiting for cutscene to end....");
                                        await Coroutine.Wait(Timeout.Infinite, () => !QuestLogManager.InCutscene);
                                    }
                                    Log("Waiting for menu to reappear....");
                                    await Coroutine.Wait(Timeout.Infinite, () => HousingChocoboList.IsOpen);

                                    await Coroutine.Sleep(1000);
                                }
                                else
                                {
                                    Log("{0}, {1}'s chocobo can't be fed yet ...", items[i].ChocoboName, items[i].PlayerName);
                                }
                            }
                        }
                    }
                    await Coroutine.Sleep(500);

                    HousingChocoboList.Close();
                    await Coroutine.Wait(5000, () => !HousingChocoboList.IsOpen);
                }
                else if (HousingMyChocobo.IsOpen)
                {
                    var matches = TimeRegex.Match(HousingMyChocobo.Lines[0]);
                    if (!matches.Success)
                    {
                        //We are ready to train now
                        HousingMyChocobo.SelectLine(0);
                        //Chocobo is maxed out, don't interact with it again
                        if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen) && string.Equals("None", ThavnairianOnion, StringComparison.OrdinalIgnoreCase))
                        {
                            Log("Your chocobo is maxed out");
                            SelectYesno.ClickNo();
                            await Coroutine.Sleep(1000);
                        }
                        //Chocobo is maxed out, don't interact with it again
                        if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen) && (string.Equals("Me", ThavnairianOnion, StringComparison.OrdinalIgnoreCase) ||
                                                                                     string.Equals("All", ThavnairianOnion, StringComparison.OrdinalIgnoreCase)))
                        {
                            if (ConditionParser.HasAtLeast(8166, 1))
                            {
                                Log("Your chocobo is maxed out, changing food to Thavnairian Onion");
                                SelectYesno.ClickNo();
                                await Coroutine.Wait(1000, () => !SelectYesno.IsOpen);

                                await Coroutine.Sleep(500);

                                HousingMyChocobo.SelectLine(0);
                                await Coroutine.Wait(5000, () => SelectYesno.IsOpen);

                                SelectYesno.ClickYes();
                                ChocoboFoodId = 8166;
                            }
                            else
                            {
                                Log("Your chocobo is maxed out but you don't have any Thavnairian Onion");
                                SelectYesno.ClickNo();
                                await Coroutine.Sleep(1000);
                            }
                        }
                        Log("Waiting for inventory menu to appear....");
                        //Wait for the inventory window to open and be ready
                        //Technically the inventory windows are always 'open' so we check if their callbackhandler has been set
                        if (!await Coroutine.Wait(5000, () => AgentInventoryContext.Instance.CallbackHandlerSet))
                        {
                            Log("Inventory menu failed to appear, aborting current iteration.");
                            return(isDone = true);
                        }
                        Log("Feeding Chocobo : Food Name : {0}, Food ID : {1}", _chocoboFood[ChocoboFoodId], ChocoboFoodId);
                        AgentHousingBuddyList.Instance.Feed(ChocoboFoodId);
                        if (await Coroutine.Wait(5000, () => SelectYesno.IsOpen))
                        {
                            SelectYesno.ClickYes();
                            await Coroutine.Sleep(1000);
                        }
                        Log("Waiting for cutscene to start....");
                        if (await Coroutine.Wait(5000, () => QuestLogManager.InCutscene))
                        {
                            Log("Waiting for cutscene to end....");
                            await Coroutine.Wait(Timeout.Infinite, () => !QuestLogManager.InCutscene);
                        }
                        Log("Waiting for menu to reappear....");
                        await Coroutine.Wait(Timeout.Infinite, () => HousingMyChocobo.IsOpen);

                        await Coroutine.Sleep(1000);
                    }
                    else
                    {
                        Log("Your chocobo can't be fed yet ...");
                    }
                    await Coroutine.Sleep(500);

                    HousingMyChocobo.Close();
                    await Coroutine.Wait(5000, () => !HousingMyChocobo.IsOpen);
                }
                else
                {
                    Log("Failed to open Chocobo list");
                }
                SelectString.ClickSlot((uint)SelectString.LineCount - 1);
                await Coroutine.Wait(5000, () => !SelectString.IsOpen);
            }
            else
            {
                Log("Failed to open menu");
            }
            await Coroutine.Sleep(3000);

            if (!FetchAfter)
            {
                return(isDone = true);
            }
            {
                foreach (var unit in GameObjectManager.GameObjects.OrderBy(r => r.Distance()))
                {
                    if (unit.EnglishName == "Chocobo Stable")
                    {
                        unit.Interact();
                        break;
                    }
                }
                await Coroutine.Wait(5000, () => SelectString.IsOpen);

                if (SelectString.IsOpen)
                {
                    SelectString.ClickSlot(1);
                    await Coroutine.Wait(5000, () => HousingMyChocobo.IsOpen);

                    if (HousingMyChocobo.IsOpen)
                    {
                        HousingMyChocobo.SelectLine(3);
                        await Coroutine.Wait(5000, () => SelectYesno.IsOpen);

                        SelectYesno.ClickYes();
                        Log("Chocobo Fetch");
                    }
                    else
                    {
                        Log("Failed to acces to my chocobo");
                        SelectString.ClickSlot((uint)SelectString.LineCount - 1);
                        await Coroutine.Wait(5000, () => !SelectString.IsOpen);
                    }
                }
                else
                {
                    Log("Failed to open menu");
                }
            }
            return(isDone = true);
        }
Ejemplo n.º 6
0
        internal static async Task <bool> HandleAnimaGrind()
        {
            if (!ConditionParser.HasQuest(AnimaQuest))
            {
                Logger.SendErrorLog("You do not have the quest 'Soul Without Life', which is required to run in Anima grind mode.");
                OracleBot.StopOracle("Required quest is not picked up.");
                return(true);
            }

            if (ConditionParser.GetQuestStep(AnimaQuest) != AnimaQuestStep)
            {
                OracleFateManager.PausePoiSetting = true;

                if (WorldManager.ZoneId != ZoneMorDhona)
                {
                    await ZoneChange.HandleZoneChange(ZoneMorDhona, false);
                }

                // Step 1: Talk to Rowena.
                if (ConditionParser.GetQuestStep(AnimaQuest) == 1)
                {
                    var rowenaLocation = new Vector3(25.65759f, 29f, -822.5876f);
                    if (Core.Player.Distance(rowenaLocation) > 10f)
                    {
                        await OracleMovementManager.NavigateToLocation(rowenaLocation, 2f, false);
                    }

                    const uint rowenaNpcId      = 1001304;
                    var        rowenaGameObject = GameObjectManager.GameObjects.FirstOrDefault(npc => npc.NpcId == rowenaNpcId);
                    if (rowenaGameObject != null)
                    {
                        if (Core.Player.Distance2D(rowenaGameObject.Location) > 4f)
                        {
                            await OracleMovementManager.NavigateToLocation(rowenaGameObject.Location, 4f, false);
                        }

                        rowenaGameObject.Interact();
                        await Coroutine.Sleep(MainSettings.Instance.ActionDelay);

                        await SkipDialogue.Main();
                    }
                }

                // Step 2: Talk to Syndony.
                if (ConditionParser.GetQuestStep(AnimaQuest) == 2)
                {
                    var syndonyLocation = new Vector3(56.6797f, 50f, -777.5304f);
                    if (Core.Player.Distance(syndonyLocation) > 10f)
                    {
                        await OracleMovementManager.NavigateToLocation(syndonyLocation, 2f, false);
                    }

                    const uint syndonyNpcId      = 1016289;
                    var        syndonyGameObject = GameObjectManager.GameObjects.FirstOrDefault(npc => npc.NpcId == syndonyNpcId);
                    if (syndonyGameObject != null)
                    {
                        if (Core.Player.Distance2D(syndonyGameObject.Location) > 4f)
                        {
                            await OracleMovementManager.NavigateToLocation(syndonyGameObject.Location, 4f, false);
                        }

                        syndonyGameObject.Interact();
                        await Coroutine.Sleep(MainSettings.Instance.ActionDelay);

                        await SkipDialogue.Main();
                    }
                }
            }
            else
            {
                if (OracleFateManager.PausePoiSetting)
                {
                    OracleFateManager.PausePoiSetting = false;
                }
            }

            if (!ConditionParser.HasAtLeast(LuminousIceCrystal, ModeSettings.Instance.AnimaCrystalsToFarm))
            {
                if (OracleClassManager.GetTrueLevel() < 50)
                {
                    Logger.SendErrorLog("You are too low level to run FATEs in Coerthas Western Highlands.");
                    OracleBot.StopOracle("Too low level to continue.");
                    return(true);
                }

                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == ZoneCoerthasWesternHighlands)
                {
                    return(true);
                }

                var amountNeeded = ModeSettings.Instance.AnimaCrystalsToFarm - OracleInventoryManager.GetItemAmount(LuminousIceCrystal);
                if (amountNeeded == 1)
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Ice Crystal.");
                }
                else
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Ice Crystals.");
                }

                await ZoneChange.HandleZoneChange(ZoneCoerthasWesternHighlands, true);
            }
            else if (!ConditionParser.HasAtLeast(LuminousWindCrystal, ModeSettings.Instance.AnimaCrystalsToFarm))
            {
                if (OracleClassManager.GetTrueLevel() < 50)
                {
                    Logger.SendErrorLog("You are too low level to run FATEs in The Sea of Clouds.");
                    OracleBot.StopOracle("Too low level to continue.");
                    return(true);
                }

                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == ZoneSeaOfClouds)
                {
                    return(true);
                }

                var amountNeeded = ModeSettings.Instance.AnimaCrystalsToFarm - OracleInventoryManager.GetItemAmount(LuminousWindCrystal);
                if (amountNeeded == 1)
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Wind Crystal.");
                }
                else
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Wind Crystals.");
                }

                await ZoneChange.HandleZoneChange(ZoneSeaOfClouds, true);
            }
            else if (!ConditionParser.HasAtLeast(LuminousEarthCrystal, ModeSettings.Instance.AnimaCrystalsToFarm))
            {
                if (OracleClassManager.GetTrueLevel() < 50)
                {
                    Logger.SendErrorLog("You are too low level to run FATEs in The Dravanian Forelands.");
                    OracleBot.StopOracle("Too low level to continue.");
                    return(true);
                }

                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == ZoneDravanianForelands)
                {
                    return(true);
                }

                var amountNeeded = ModeSettings.Instance.AnimaCrystalsToFarm - OracleInventoryManager.GetItemAmount(LuminousEarthCrystal);
                if (amountNeeded == 1)
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Earth Crystal.");
                }
                else
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Earth Crystals.");
                }

                await ZoneChange.HandleZoneChange(ZoneDravanianForelands, true);
            }
            else if (!ConditionParser.HasAtLeast(LuminousLightningCrystal, ModeSettings.Instance.AnimaCrystalsToFarm))
            {
                if (OracleClassManager.GetTrueLevel() < 52)
                {
                    Logger.SendErrorLog("You are too low level to run FATEs in The Churning Mists.");
                    OracleBot.StopOracle("Too low level to continue.");
                    return(true);
                }

                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == ZoneChurningMists)
                {
                    return(true);
                }

                var amountNeeded = ModeSettings.Instance.AnimaCrystalsToFarm - OracleInventoryManager.GetItemAmount(LuminousLightningCrystal);
                if (amountNeeded == 1)
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Lightning Crystal.");
                }
                else
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Lightning Crystals.");
                }

                await ZoneChange.HandleZoneChange(ZoneChurningMists, true);
            }
            else if (!ConditionParser.HasAtLeast(LuminousWaterCrystal, ModeSettings.Instance.AnimaCrystalsToFarm))
            {
                if (OracleClassManager.GetTrueLevel() < 54)
                {
                    Logger.SendErrorLog("You are too low level to run FATEs in The Dravanian Hinterlands.");
                    OracleBot.StopOracle("Too low level to continue.");
                    return(true);
                }

                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == ZoneDravanianHinterlands)
                {
                    return(true);
                }

                var amountNeeded = ModeSettings.Instance.AnimaCrystalsToFarm - OracleInventoryManager.GetItemAmount(LuminousWaterCrystal);
                if (amountNeeded == 1)
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Water Crystal.");
                }
                else
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Water Crystals.");
                }

                await ZoneChange.HandleZoneChange(ZoneDravanianHinterlands, true);
            }
            else if (!ConditionParser.HasAtLeast(LuminousFireCrystal, ModeSettings.Instance.AnimaCrystalsToFarm))
            {
                if (OracleClassManager.GetTrueLevel() < 55)
                {
                    Logger.SendErrorLog("You are too low level to run FATEs in Azys Lla.");
                    OracleBot.StopOracle("Too low level to continue.");
                    return(true);
                }

                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == ZoneAzysLla)
                {
                    return(true);
                }

                var amountNeeded = ModeSettings.Instance.AnimaCrystalsToFarm - OracleInventoryManager.GetItemAmount(LuminousFireCrystal);
                if (amountNeeded == 1)
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Fire Crystal.");
                }
                else
                {
                    Logger.SendLog("We need " + amountNeeded + " more Luminous Fire Crystals.");
                }

                await ZoneChange.HandleZoneChange(ZoneAzysLla, true);
            }
            else if (!Core.Player.InCombat)
            {
                Logger.SendLog("We have collected " + ModeSettings.Instance.AnimaCrystalsToFarm + " of every crystal! Stopping Oracle.");

                await OracleTeleportManager.TeleportToClosestCity();

                if (OracleTeleportManager.InCity())
                {
                    OracleBot.StopOracle("We are done!");
                }
            }

            return(true);
        }
Ejemplo n.º 7
0
        internal static async Task <bool> HandleAtmaGrind()
        {
            if (!OracleClassManager.ClassJobCanFarmAtma(Core.Player.CurrentJob))
            {
                Logger.SendErrorLog("Your current class (" + OracleClassManager.GetClassJobName(Core.Player.CurrentJob) + ") cannot farm Atma.");
                OracleBot.StopOracle("Current class cannot farm Atma.");
                return(true);
            }

            var weaponId = GetClassJobZenithWeapon(Core.Player.CurrentJob);

            if (!OracleInventoryManager.IsItemEquipped(weaponId, EquipmentSlot.MainHand))
            {
                await EquipMainHand();
            }

            // Special case for Gladiator/Paladin shield.
            if ((Core.Player.CurrentJob == ClassJobType.Gladiator || Core.Player.CurrentJob == ClassJobType.Paladin) &&
                !OracleInventoryManager.IsItemEquipped(ShieldPaladinItemId, EquipmentSlot.OffHand))
            {
                await EquipOffHand();
            }

            if (!ConditionParser.HasAtLeast(AtmaLionItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaLionZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaLionItemId)) + " Atma of the Lion.");
                await ZoneChange.HandleZoneChange(AtmaLionZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaWaterBearerItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaWaterBearerZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaWaterBearerItemId))
                               + " Atma of the Water-bearer.");
                await ZoneChange.HandleZoneChange(AtmaWaterBearerZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaRamItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaRamZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaRamItemId)) + " Atma of the Ram.");
                await ZoneChange.HandleZoneChange(AtmaRamZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaCrabItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaCrabZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaCrabItemId)) + " Atma of the Crab.");
                await ZoneChange.HandleZoneChange(AtmaCrabZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaFishItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaFishZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaFishItemId)) + " Atma of the Fish.");
                await ZoneChange.HandleZoneChange(AtmaFishZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaBullItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaBullZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaBullItemId)) + " Atma of the Bull.");
                await ZoneChange.HandleZoneChange(AtmaBullZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaScalesItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaScalesZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaScalesItemId))
                               + " Atma of the Scales.");
                await ZoneChange.HandleZoneChange(AtmaScalesZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaTwinsItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaTwinsZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaTwinsItemId)) + " Atma of the Twins.");
                await ZoneChange.HandleZoneChange(AtmaTwinsZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaScorpionItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaScorpionZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaScorpionItemId))
                               + " Atma of the Scorpion.");
                await ZoneChange.HandleZoneChange(AtmaScorpionZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaArcherItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaArcherZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaArcherItemId))
                               + " Atma of the Archer.");
                await ZoneChange.HandleZoneChange(AtmaArcherZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaGoatItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaGoatZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaGoatItemId)) + " Atma of the Goat.");
                await ZoneChange.HandleZoneChange(AtmaGoatZoneId, true);
            }
            else if (!ConditionParser.HasAtLeast(AtmaMaidenItemId, ModeSettings.Instance.AtmaToFarm))
            {
                if (Core.Player.InCombat || !WorldManager.CanTeleport() || WorldManager.ZoneId == AtmaMaidenZoneId)
                {
                    return(true);
                }

                Logger.SendLog("We need " + (ModeSettings.Instance.AtmaToFarm - OracleInventoryManager.GetItemAmount(AtmaMaidenItemId))
                               + " Atma of the Maiden.");
                await ZoneChange.HandleZoneChange(AtmaMaidenZoneId, true);
            }
            else if (!Core.Player.InCombat)
            {
                Logger.SendLog("We have collected " + ModeSettings.Instance.AtmaToFarm + " of every Atma! Stopping Oracle.");
                await OracleTeleportManager.TeleportToClosestCity();

                OracleBot.StopOracle("We are done!");
            }

            return(true);
        }