Exemplo n.º 1
0
        internal static async Task <bool> Main()
        {
            if (Poi.Current.Type != PoiType.Kill)
            {
                return(false);
            }

            OracleFateManager.ForceUpdateGameCache();
            if (!Poi.Current.BattleCharacter.IsValid || Poi.Current.BattleCharacter.IsDead)
            {
                OracleFateManager.ClearPoi("Mob is "
                                           + "no longer"
                                           + " valid.",
                                           false);
                return(false);
            }

            if (Core.Player.CurrentHealthPercent < MainSettings.Instance.RestHealthPercent)
            {
                WaitForPlayerRegeneration();
                return(true);
            }

            if (OracleClassManager.IsTankClassJob(Core.Player.CurrentJob) || OracleClassManager.IsMeleeDpsClassJob(Core.Player.CurrentJob) ||
                OracleClassManager.IsRangedDpsClassJob(Core.Player.CurrentJob))
            {
                if (Core.Player.CurrentTPPercent < MainSettings.Instance.RestTPManaPercent)
                {
                    WaitForPlayerRegeneration();
                    return(true);
                }
            }

            if (OracleClassManager.IsCasterClassJob(Core.Player.CurrentJob) || OracleClassManager.IsHealerClassJob(Core.Player.CurrentJob))
            {
                if (Core.Player.CurrentManaPercent < MainSettings.Instance.RestTPManaPercent)
                {
                    WaitForPlayerRegeneration();
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        internal static async Task <bool> HandleChocobo()
        {
            if (!MainSettings.Instance.ChocoboHandlingEnabled)
            {
                return(false);
            }

            if (ModeSettings.Instance.OracleOperationMode == OracleOperationMode.YokaiWatchGrind)
            {
                return(false);
            }

            if (ChocoboManager.BlockSummon)
            {
                return(false);
            }

            if (Core.Player.IsMounted)
            {
                return(false);
            }

            if (!ChocoboManager.Summoned && ChocoboManager.CanSummon)
            {
                // Check for whether or not the dead/dismissed/expired Chocobo is still in the party. If it is, game won't let us summon.
                if (PartyManager.IsInParty && PartyManager.AllMembers != null &&
                    PartyManager.AllMembers.Any(member => member.GameObject != null && member.GameObject.SummonerGameObject == Core.Player))
                {
                    return(false);
                }

                var summonResult = await SummonChocobo();

                if (summonResult == SummonChocoboResult.Success)
                {
                    Logger.SendLog(ChocoboName + " has been summoned successfully!");
                }

                return(true);
            }

            // Safety checks for when the Chocobo may be summoned, but can't be accessed by RebornBuddy.
            if (!ChocoboManager.Summoned || ChocoboManager.Object == null || !ChocoboManager.Object.IsValid)
            {
                OracleFateManager.ForceUpdateGameCache();
                return(false);
            }

            if (Core.Player.CurrentHealthPercent < MainSettings.Instance.ChocoboStancePlayerHealthThreshold)
            {
                await SetChocoboStance(CompanionStance.Healer);
            }
            else if (ChocoboManager.Object.CurrentHealthPercent < MainSettings.Instance.ChocoboStanceChocoboHealthThreshold)
            {
                await SetChocoboStance(CompanionStance.Healer);
            }
            else if (Core.Player.CurrentHealthPercent >= MainSettings.Instance.ChocoboStanceReturnToAttackThreshold)
            {
                await SetChocoboStance(CompanionStance.Attacker);
            }
            else if (ChocoboManager.Stance != CompanionStance.Attacker && ChocoboManager.Stance != CompanionStance.Healer)
            {
                await SetChocoboStance(CompanionStance.Attacker);
            }

            return(false);
        }
Exemplo n.º 3
0
        private static async Task <bool> Main()
        {
            OracleFateManager.ForceUpdateGameCache();

            if (OracleFateManager.FateDatabase == null)
            {
                await LoadOracleDatabase.Main();
            }

            if (Poi.Current == null)
            {
                Poi.Current = new Poi(Vector3.Zero, PoiType.None);
                return(false);
            }

            if (Poi.Current.Type == PoiType.Death || Core.Player.IsDead)
            {
                if (Poi.Current.Type == PoiType.Death || Core.Player.IsDead)
                {
                    Logger.SendLog("We died, attempting to recover.");
                }

                if (Poi.Current.Type != PoiType.Death)
                {
                    Poi.Current = new Poi(Core.Player, PoiType.Death);
                }

                return(false);
            }

            await ChocoboHandler.HandleChocobo();

            if (Poi.Current.Type == PoiType.Kill)
            {
                await CombatHandler.HandleCombat();

                return(false);
            }

            if (OracleInventoryManager.ShouldRestockGreens())
            {
                await RestockGysahlGreens.HandleRestockGyshalGreens();

                return(false);
            }

            switch (ModeSettings.Instance.OracleOperationMode)
            {
            case OracleOperationMode.FateGrind:
                await FateGrind.HandleFateGrind();

                break;

            case OracleOperationMode.LevelMode:
                await Levelling.HandleLevelling();

                break;

            case OracleOperationMode.MultiLevelMode:
                await MultiLevelling.HandleMultiLevelling();

                break;

            case OracleOperationMode.SpecificFates:
                await SpecificFates.HandleSpecificFates();

                break;

            case OracleOperationMode.AtmaGrind:
                await AtmaGrind.HandleAtmaGrind();

                break;

            case OracleOperationMode.AnimusGrind:
                await AnimusGrind.HandleAnimusGrind();

                break;

            case OracleOperationMode.AnimaGrind:
                await AnimaGrind.HandleAnimaGrind();

                break;

            case OracleOperationMode.YokaiWatchGrind:
                await YokaiWatchGrind.HandleYokaiWatchGrind();

                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            if (Poi.Current.Type == PoiType.Fate || OracleFateManager.CurrentFateId != 0)
            {
                await FateHandler.HandleFate();

                return(false);
            }

            if (Poi.Current.Type == PoiType.Wait)
            {
                await WaitHandler.HandleWait();
            }

            // Always return false to not block the tree.
            return(false);
        }