Ejemplo n.º 1
0
        private async Task <bool> HandleCordial()
        {
            if (CordialType == CordialType.None)
            {
                // Not using cordials, skip method.
                return(false);
            }

            if (FishingManager.State >= FishingState.Bite)
            {
                // Need to wait till we are in the correct state
                return(false);
            }

            CordialSpellData = CordialSpellData ?? Cordial.GetSpellData();

            if (CordialSpellData == null)
            {
                CordialType = CordialType.None;
                return(false);
            }

            if (!CanUseCordial(8))
            {
                // has a buff or cordial cooldown not ready or we have no cordials.
                return(false);
            }

            var missingGp = ExProfileBehavior.Me.MaxGP - ExProfileBehavior.Me.CurrentGP;

            if (missingGp < 300 && !ForceCordial)
            {
                // Not forcing cordial and less than 300gp missing from max.
                return(false);
            }

            await Coroutine.Wait(10000, () => CanDoAbility(Abilities.Quit));

            DoAbility(Abilities.Quit);
            isSitting = false;

            await Coroutine.Wait(5000, () => FishingManager.State == FishingState.None);

            if (missingGp >= 380 && CordialType >= CordialType.HiCordial)
            {
                if (await UseCordial(CordialType.HiCordial))
                {
                    return(true);
                }
            }

            if (await UseCordial(CordialType.Cordial))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        private async Task <bool> HandleCordial()
        {
            if (CordialType == CordialType.None)
            {
                return(false);
            }

            CordialSpellData = CordialSpellData ?? Cordial.GetSpellData();

            if (CordialSpellData == null)
            {
                CordialType = CordialType.None;
                return(false);
            }

            if (!CanUseCordial(8))
            {
                return(false);
            }

            var missingGp = ExProfileBehavior.Me.MaxGP - ExProfileBehavior.Me.CurrentGP;

            if (missingGp < 300)
            {
                return(false);
            }

            if (missingGp >= 450 && (CordialType == CordialType.HiCordial || CordialType == CordialType.Auto))
            {
                if (await UseCordial(CordialType.HiCordial))
                {
                    return(true);
                }
            }

            if (missingGp < 400 || CordialType != CordialType.Cordial && CordialType != CordialType.Auto)
            {
                return(await UseCordial(CordialType.WateredCordial));
            }

            if (await UseCordial(CordialType.Cordial))
            {
                return(true);
            }

            return(await UseCordial(CordialType.WateredCordial));
        }