Exemple #1
0
        internal static bool FateProgressionMet(FateData fate)
        {
            if (FateDatabase.GetFateFromFateData(fate).Type != FateType.Boss && FateDatabase.GetFateFromFateData(fate).Type != FateType.MegaBoss)
            {
                return(true);
            }

            if (FateDatabase.GetFateFromFateData(fate).Type == FateType.Boss && fate.Progress >= FateSettings.Instance.BossEngagePercentage)
            {
                return(true);
            }

            if (FateDatabase.GetFateFromFateData(fate).Type == FateType.Boss && FateSettings.Instance.WaitAtBossForProgress)
            {
                return(true);
            }

            if (FateDatabase.GetFateFromFateData(fate).Type == FateType.MegaBoss && fate.Progress >= FateSettings.Instance.MegaBossEngagePercentage)
            {
                return(true);
            }

            if (FateDatabase.GetFateFromFateData(fate).Type == FateType.MegaBoss && FateSettings.Instance.WaitAtMegaBossForProgress)
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        private static async Task <float> GetDistanceFromPlayer(FateData fate)
        {
            float distanceFromPlayer = 0;

            if (!WorldManager.CanFly)
            {
                var navRequest = new List <CanFullyNavigateTarget>
                {
                    new CanFullyNavigateTarget
                    {
                        Id       = fate.ObjectId,
                        Position = fate.Location
                    }
                };
                var navTask    = Navigator.NavigationProvider.CanFullyNavigateTo(navRequest, Core.Player.Location, WorldManager.ZoneId);
                var navResults = await Coroutine.ExternalTask(navTask);

                var navResult = navResults.FirstOrDefault();

                if (navResult != null)
                {
                    distanceFromPlayer = navResult.PathLength;
                }
            }
            else
            {
                distanceFromPlayer = fate.Location.Distance(Core.Player.Location);
            }

            return(distanceFromPlayer);
        }
        private static Node GetClosestNodeToFate(FateData fate)
        {
            var potentialNodes =
                ZoneFlightMesh.Graph.Nodes.OrderBy(kvp => kvp.Value.Position.Distance(fate.Location)).Where(kvp => kvp.Value.Position.Y > fate.Location.Y + 10);

            return(potentialNodes.FirstOrDefault().Value);
        }
Exemple #4
0
        public Fate GetFateFromFateData(FateData fateData)
        {
            Fate fate;

            try
            {
                if (FateDictionary.TryGetValue(fateData.Id, out fate))
                {
                    return(fate);
                }
            }
            catch (ArgumentNullException exception)
            {
                Logger.SendErrorLog("Error looking up FATE in the database.");
                Logger.SendDebugLog("ArgumentNullException thrown:\n\n" + exception + "\n");
            }

            // Create a null fate with Unsupported flag if we can't find it.
            fate = new Fate
            {
                SupportLevel = FateSupportLevel.Unsupported
            };
            Logger.SendDebugLog("Fate with id: '" + fateData.Id + "' not found, flagging as unsupported.");

            return(fate);
        }
Exemple #5
0
        private static async Task <Aetheryte[]> GetNavigableAetherytes(FateData fate)
        {
            Aetheryte[] viableAetherytes;

            var allAetherytes       = AllTuplesToAetherytes(OracleFateManager.GetAetheryteIdsForZone(WorldManager.ZoneId), fate.Location);
            var viableAetheryteList = new List <Aetheryte>();

            if (!WorldManager.CanFly)
            {
                var navRequest = allAetherytes.Select(target => new CanFullyNavigateTarget
                {
                    Id       = target.Id,
                    Position = target.Location
                }).ToList();
                var navTask    = Navigator.NavigationProvider.CanFullyNavigateTo(navRequest, fate.Location, WorldManager.ZoneId);
                var navResults = await Coroutine.ExternalTask(navTask);

                foreach (var navResult in navResults.Where(result => result.CanNavigate != 0))
                {
                    var aetheryte = allAetherytes.FirstOrDefault(result => result.Id == navResult.Id);
                    aetheryte.Distance = navResult.PathLength;
                    viableAetheryteList.Add(aetheryte);
                    await Coroutine.Yield();
                }

                viableAetherytes = viableAetheryteList.ToArray();
            }
            else
            {
                viableAetherytes = allAetherytes;
            }

            return(viableAetherytes);
        }
Exemple #6
0
 private void IsFateStillActive()
 {
     if (currentstep > 0)
     {
         int found = 0;
         foreach (FateData item in FateManager.ActiveFates)
         {
             if (item.Id == fateid)
             {
                 found = 1;
             }
         }
         if (found == 0)
         {
             if (currentfate != null)
             {
                 SetLastFate();
             }
             currentstep = 0;
             fateid      = 0;
             currentfate = null;
             Logging.Write("Fate no longer active.");
         }
     }
 }
Exemple #7
0
        public async Task <bool> getFates()
        {
            if (FateIds.Length > 0)
            {
                //Logging.Write("Looking for Fate: {0}.", FateID);
                currentfate = IsFateActive(FateIds);
                if (currentfate == null)
                {
                    return(false);
                }
                else
                {
                    Logging.Write("Adding Focused Fate: {0}. Distance is {1}.", currentfate.Name, Core.Me.Distance(currentfate.Location));
                    return(true);
                }
            }
            List <FateData> FateCandidates = FateManager.ActiveFates.ToList();
            var             FateList       = MyFilter(FateCandidates);

            currentfate = FateList.OrderBy(fate => Core.Me.Distance(fate.Location)).FirstOrDefault(fate => fate.Level <_max && fate.Level> _min);
            if (currentfate == null)
            {
                return(false);
            }

            return(true);
        }
Exemple #8
0
        internal static async Task <Aetheryte> GetClosestAetheryte(FateData fate)
        {
            var aetherytes = await GetNavigableAetherytes(fate);

            var closestAetheryte = aetherytes.OrderBy(node => node.Distance).FirstOrDefault();

            return(closestAetheryte);
        }
Exemple #9
0
        internal static bool IsLevelSyncNeeded(FateData fate)
        {
            if (!fate.IsValid || fate.Status == FateStatus.NOTACTIVE || fate.Status == FateStatus.COMPLETE)
            {
                return(false);
            }

            return(fate.MaxLevel < OracleClassManager.GetTrueLevel() && !Core.Player.IsLevelSynced && fate.Within2D(Core.Player.Location));
        }
Exemple #10
0
    /// <summary>
    /// Gets the fate data from Id.
    /// </summary>
    /// <returns>The fate data from I.</returns>
    /// <param name="Id">Identifier.</param>
    public FateData getFateDataFromID(int Id)
    {
        FateData fd = null;

        if (!fateConfig.TryGetValue(Id, out fd))
        {
            fd = null;
        }
        return(fd);
    }
Exemple #11
0
        public async Task <bool> getFates()
        {
            List <FateData> FateCandidates = FateManager.ActiveFates.ToList();
            var             FateList       = MyFilter(FateCandidates);

            currentfate = FateList.OrderBy(fate => Core.Me.Distance(fate.Location)).FirstOrDefault(fate => fate.Level <_max && fate.Level> _min);
            if (currentfate == null)
            {
                return(false);
            }

            return(true);
        }
Exemple #12
0
 public void InitUI(FateData data)
 {
     m_data = data;
     if (m_data != null)
     {
         m_txtFate.text = data.name;
     }
     else
     {
         m_txtFate.text = "";
     }
     RED.SetActive(true, this.gameObject);
 }
Exemple #13
0
    public void InitUI(MonsterData monData)
    {
        m_data = monData;

        AtlasMgr.mInstance.SetHeadSprite(m_spHead, m_data.ID.ToString());
        m_txtName.text = string.Format(Core.Data.stringManager.getString(5259), m_data.name);
        m_star.SetStar(m_data.star);
        m_subStar.SetStar(6);

        Monster        mon    = new Monster();
        RuntimeMonster rtData = new RuntimeMonster();

        rtData.Attribute = MonsterAttribute.FIRE;
        rtData.curLevel  = 30;
        mon.RTData       = rtData;
        mon.config       = m_data;
        mon.num          = m_data.ID;

        for (int i = 0; i < m_skills.Length; i++)
        {
            RED.SetActive(false, m_skills [i].gameObject);
        }

        for (int i = 0; i < mon.getSkill.Count; i++)
        {
            m_skills [i].InitSkill(mon.getSkill[i]);
        }

        m_txtAtk.text = ((int)(m_data.atk)).ToString();
        m_txtDef.text = ((int)m_data.def).ToString();

        int maxAtk = (int)(m_data.atk + 59 * m_data.atkGrowth);
        int maxDef = (int)(m_data.def + 59 * m_data.defGrowth);

        m_txtMaxAtk.text = string.Format(Core.Data.stringManager.getString(5262), maxAtk);
        m_txtMaxDef.text = string.Format(Core.Data.stringManager.getString(5262), maxDef);

        for (int i = 0; i < m_fates.Length; i++)
        {
            RED.SetActive(false, m_fates [i].gameObject);
        }

        FateData[] fd = new FateData[4];
        for (int i = 0; i < m_data.fateID.Length; i++)
        {
            fd[i] = Core.Data.fateManager.getFateDataFromID(m_data.fateID[i]);
            m_fates[i].InitUI(fd[i]);
        }

        m_txtDesp.text = m_data.description;
    }
        private static double GetWeight(FateData fateData)
        {
            float baseScore;
            if (!BaseFateScores.TryGetValue(fateData.Icon, out baseScore))
            {
                baseScore = 1.0f;
            }

            var power = WorldManager.CanFly ? 2 : 3;
            var score = 100000
                        - baseScore * (Math.Pow(fateData.Progress, power) + fateData.Location.Distance(Core.Me.Location) * 150);

            return score;
        }
        private static async Task <IEnumerable <Vector3> > GenerateFlightPathToFate(FateData currentFate)
        {
            Logger.SendLog("Generating new flight path to FATE.");
            var flightPathTimer = Stopwatch.StartNew();

            var aStar        = new AStarNavigator(ZoneFlightMesh.Graph);
            var startingNode = GetClosestNodeToLocation(Core.Player.Location);
            var endingNode   = GetClosestNodeToFate(currentFate);

            if (startingNode == null || endingNode == null)
            {
                Logger.SendErrorLog("Couldn't generate a flight path to the FATE, blacklisting it and selecting another.");
                Blacklist.Add(currentFate.Id, BlacklistFlags.Node, currentFate.TimeLeft, "Could not generate flight path.");
                await OracleFateManager.ClearCurrentFate("Couldn't generate a flight path to the FATE", false);

                return(null);
            }

            var path = aStar.GeneratePath(startingNode.Position, endingNode.Position).ToList();

            if (!path.Any())
            {
                Logger.SendErrorLog("Couldn't generate a flight path to the FATE, blacklisting it and selecting another.");
                Blacklist.Add(currentFate.Id, BlacklistFlags.Node, currentFate.TimeLeft, "Could not generate flight path.");
                await OracleFateManager.ClearCurrentFate("Couldn't generate a flight path to the FATE", false);

                return(null);
            }

            // Skip first node if we can to prevent bot-like mid-air direction change.
            if (path.Count > 1)
            {
                Vector3 collision;
                if (!WorldManager.Raycast(Core.Player.Location, path[1], out collision))
                {
                    Logger.SendDebugLog("Skipping first node, no collision detected.");
                    path.Remove(path.First());
                }
                else
                {
                    Logger.SendDebugLog("Not skipping first node, collision detected at: " + collision);
                }
            }

            flightPathTimer.Stop();
            Logger.SendDebugLog("Flight path generated in " + flightPathTimer.ElapsedMilliseconds + " ms.");

            return(path);
        }
        private static double GetWeight(FateData fateData)
        {
            float baseScore;

            if (!BaseFateScores.TryGetValue(fateData.Icon, out baseScore))
            {
                baseScore = 1.0f;
            }

            var power = WorldManager.CanFly ? 2 : 3;
            var score = 100000
                        - baseScore * (Math.Pow(fateData.Progress, power) + fateData.Location.Distance(Core.Me.Location) * 150);

            return(score);
        }
Exemple #17
0
 protected override void OnStart()
 {
     _min        = Convert.ToInt32(MinLevel);
     _max        = Convert.ToInt32(MaxLevel);
     _timeout    = Convert.ToInt32(timeout);
     currentstep = 0;
     Logging.Write("Doing fates and hunt in between.");
     Logging.Write("Stats: MinFate level={0} MaxFatelvl={1}", _min, _max);
     // MaxLevel = "34";
     // MinLevel = "25";
     CachedProvider = CombatTargeting.Instance.Provider;
     CombatTargeting.Instance.Provider = new MySuperAwesomeTargetingProvider();
     currentfate = null;
     Poi.Clear("Clearing POI");
     saveNow = DateTime.Now;
 }
Exemple #18
0
        internal static async Task <bool> SyncLevel(FateData fate)
        {
            if (!IsLevelSyncNeeded(fate))
            {
                return(false);
            }

            ToDoList.LevelSync();
            await Coroutine.Wait(TimeSpan.FromMilliseconds(MainSettings.Instance.ActionDelay), () => Core.Player.IsLevelSynced);

            if (Core.Player.IsLevelSynced)
            {
                Logger.SendLog("Synced to level " + fate.MaxLevel + " to participate in FATE.");
            }

            return(true);
        }
Exemple #19
0
        public override void Start()
        {
            Navigator.PlayerMover                  = new SlideMover();
            Navigator.NavigationProvider           = new ServiceNavigationProvider();
            GameSettingsManager.FaceTargetOnAction = true;
            GameSettingsManager.FlightMode         = true;
            TreeHooks.Instance.ClearAll();
            this.composite = BrainBehavior.CreateBrain();
            CharacterSettings.Instance.AutoEquip = FatebotSettings.Instance.UseAutoEquip;
            TreeHooks.Instance.ReplaceHook("SelectPoiType", this.SelectPoiType());
            TreeHooks.Instance.AddHook("PoiAction", this.SetFatePoi());
            TreeHooks.Instance.AddHook("PoiAction2", this.SetRestPoi());
            TreeHooks.Instance.AddHook("TreeStart", this.BotLogic);

            CombatTargeting.Instance.Provider = new ExFateCombatTargetingProvider();             // TODO Make new targeting
            FateData = null;
        }
Exemple #20
0
    public List <EquipData> GetEquipByFateNum(int fateId)
    {
        List <EquipData> equipData = new List <EquipData> ();
        FateData         tempData  = null;

        if (fateConfig.TryGetValue(fateId, out tempData))
        {
            for (int i = 0; i < tempData.itemID.Count - 1; i++)
            {
                if (tempData.itemID[1 + i][0] == 4) // 1是宠物  4是装备
                {
                    EquipData ed = Core.Data.EquipManager.getEquipConfig(tempData.itemID [i + 1][1]);
                    equipData.Add(ed);
                }
            }
        }
        return(equipData);
    }
Exemple #21
0
    /// <summary>
    /// Checks my fate. 只有在队伍里面的才有缘分的价值,同时还有奥义数据
    /// </summary>
    /// <returns><c>true</c>, if my fate was checked, <c>false</c> otherwise.</returns>
    /// <param name="faDa">Fa da.</param>
    /// <param name="team">Team.</param>
    public bool checkMyFate(FateData faDa, MonsterTeam mTeam, List <AoYi> usedTeam)
    {
        bool check = true;

        if (faDa != null && mTeam != null && usedTeam != null)
        {
            int count = faDa.CountOfCondition;
            for (int i = 0; i < count; ++i)
            {
                int[] condition = faDa.MyFate(i);
                if (condition != null)
                {
                    ConfigDataType conData = (ConfigDataType)condition[FateData.Type_Pos];
                    int            ID      = condition[FateData.Item_ID_Pos];
                    int            amount  = condition[FateData.Item_Count_Pos];

                    switch (conData)
                    {
                    case ConfigDataType.HugeBeast:
                        check = checkAoYi(ID, amount, usedTeam) && check;
                        break;

                    case ConfigDataType.Gender:
                        check = checkGender((short)ID, amount, mTeam) && check;
                        break;

                    case ConfigDataType.Monster:
                        check = checkMonster(ID, amount, mTeam) && check;
                        break;

                    case ConfigDataType.Star:
                        check = checkStar(ID, amount, mTeam) && check;
                        break;

                    case ConfigDataType.Equip:
                        check = checkEquip(ID, amount, mTeam) && check;
                        break;
                    }
                }
            }
        }

        return(check);
    }
Exemple #22
0
        private async Task <bool> ResolveFate()
        {
            if (!FateTimer.IsRunning)
            {
                FateTimer.Restart();
            }

            if (FateTimer.ElapsedMilliseconds < 3000)
            {
                return(await Task.FromResult(false));
            }

            FateTimer.Restart();

            FateData fate;
            var      singleFate = FatebotSettings.Instance.ThisFateOnly;

            if (!string.IsNullOrWhiteSpace(singleFate))
            {
                var listThisFateOnly = singleFate.Split(';')
                                       .Select(f => f.Trim()).ToList();

                fate =
                    FateManager.ActiveFates.FirstOrDefault(
                        f => listThisFateOnly.Any(tfo => tfo.ToLower().Contains(f.Name.ToLower())));

                if (fate == null)
                {
                    return(await Task.FromResult(false));
                }

                FateData = fate;
                return(await Task.FromResult(true));
            }

            fate = FateScoreProvider.GetObjectsByWeight(FateManager.ActiveFates).FirstOrDefault(ShouldSelectFate);
            if (fate == null)
            {
                return(await Task.FromResult(false));
            }

            FateData = fate;
            return(await Task.FromResult(true));
        }
    bool checkMyFate(FateData faDa, MonsterTeamInfo mTeam, int capacity)
    {
        bool check = true;

        if (faDa != null && mTeam != null)
        {
            int count = faDa.CountOfCondition;
            for (int i = 0; i < count; ++i)
            {
                int[] condition = faDa.MyFate(i);
                if (condition != null)
                {
                    ConfigDataType conData = (ConfigDataType)condition[FateData.Type_Pos];
                    int            ID      = condition[FateData.Item_ID_Pos];
                    int            amount  = condition[FateData.Item_Count_Pos];

                    switch (conData)
                    {
                    case ConfigDataType.HugeBeast:
                        check = false;
                        break;

                    case ConfigDataType.Gender:
                        check = false;
                        break;

                    case ConfigDataType.Monster:
                        check = checkMonster(ID, amount, mTeam, capacity) && check;
                        break;

                    case ConfigDataType.Star:
                        check = false;
                        break;

                    case ConfigDataType.Equip:
                        check = checkEquip(ID, amount, capacity) && check;
                        break;
                    }
                }
            }
        }

        return(check);
    }
Exemple #24
0
        internal static async Task <bool> TeleportToClosestAetheryte(FateData fate)
        {
            var aetheryte = await GetClosestAetheryte(fate);

            if (aetheryte.Id == 0)
            {
                Logger.SendDebugLog("No viable aetheryte crystals in this zone.");
                return(false);
            }

            await TeleportToAetheryte(aetheryte.Id);

            if (Core.Player.InCombat)
            {
                OracleFateManager.ClearPoi("We're in combat and need to teleport.");
            }

            return(true);
        }
Exemple #25
0
        private async Task <bool> ResolveFate()
        {
            if (!FateTimer.IsRunning)
            {
                FateTimer.Restart();
            }

            if (FateTimer.ElapsedMilliseconds < 3000)
            {
                return(false);
            }

            FateTimer.Restart();

            FateData fate;
            var      singleFate = FatebotSettings.Instance.ThisFateOnly;

            if (!string.IsNullOrWhiteSpace(singleFate))
            {
                fate =
                    FateManager.ActiveFates.FirstOrDefault(
                        f => string.Equals(f.Name, singleFate, StringComparison.InvariantCultureIgnoreCase));

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

                FateData = fate;
                return(true);
            }

            fate = FateScoreProvider.GetObjectsByWeight(FateManager.ActiveFates).FirstOrDefault(ShouldSelectFate);
            if (fate == null)
            {
                return(false);
            }

            FateData = fate;
            return(true);
        }
Exemple #26
0
        internal static async Task <bool> FlightorMove(FateData fate)
        {
            if (fate == null)
            {
                return(false);
            }
            var moving = MoveResult.GeneratingPath;
            var target = new FlyToParameters(fate.Location);

            while ((!(moving == MoveResult.Done ||
                      moving == MoveResult.ReachedDestination ||
                      moving == MoveResult.Failed ||
                      moving == MoveResult.Failure ||
                      moving == MoveResult.PathGenerationFailed)) && FateManager.ActiveFates.Any(i => i.Id == fate.Id && i.IsValid))
            {
                moving = Flightor.MoveTo(target);

                await Coroutine.Yield();
            }
            Navigator.PlayerMover.MoveStop();
            return(moving == MoveResult.ReachedDestination);
        }
Exemple #27
0
        internal static async Task <bool> FasterToTeleport(FateData fate)
        {
            if (WorldManager.CanFly)
            {
                return(false);
            }

            var aetheryte = await GetClosestAetheryte(fate);

            if (aetheryte.Id == 0)
            {
                Logger.SendDebugLog("No viable aetheryte crystals in this zone.");
                return(false);
            }

            var distanceFromPlayer = await GetDistanceFromPlayer(fate);

            Logger.SendDebugLog("Distance to navigate to FATE from player location is " + Math.Round(distanceFromPlayer, 2) + " yalms.");
            Logger.SendDebugLog("Distance to navigate to FATE from closest aetheryte location is " + Math.Round(aetheryte.Distance, 2) + " yalms.");
            Logger.SendDebugLog("Minimum reduction in distance to use teleport is " + MovementSettings.Instance.MinDistanceToTeleport + " yalms.");

            if (distanceFromPlayer - aetheryte.Distance <= 0)
            {
                Logger.SendDebugLog("No reduction in distance by teleporting.");
            }
            else
            {
                Logger.SendDebugLog("The distance reduction from teleporting is " + Math.Round(distanceFromPlayer - aetheryte.Distance, 2) + " yalms.");
            }

            if (distanceFromPlayer - aetheryte.Distance > MovementSettings.Instance.MinDistanceToTeleport)
            {
                return(true);
            }

            return(false);
        }
Exemple #28
0
    public List <MonsterData> GetMonsterByFateNum(int fateId)
    {
        List <MonsterData> monData  = new List <MonsterData> ();
        FateData           tempData = null;

        ConsoleEx.DebugLog("fate id = " + fateId);
        if (fateId != 0)
        {
            if (fateConfig.TryGetValue(fateId, out tempData))
            {
                for (int i = 0; i < tempData.itemID.Count - 1; i++)
                {
                    //		ConsoleEx.DebugLog(" temp date "+ tempData.itemID[1][1] +" temp  count =" + tempData.itemID.Count);
                    if (tempData.itemID [1 + i][0] == 1)            // 1是宠物  4是装备

                    {
                        MonsterData md = Core.Data.monManager.getMonsterByNum(tempData.itemID [1 + i][1]);
                        monData.Add(md);
                    }
                }
            }
        }
        return(monData);
    }
Exemple #29
0
		private async Task<bool> ResolveFate()
		{
			if (!FateTimer.IsRunning)
			{
				FateTimer.Restart();
			}

			if (FateTimer.ElapsedMilliseconds < 3000)
			{
				return false;
			}

			FateTimer.Restart();

			FateData fate;
			var singleFate = FatebotSettings.Instance.ThisFateOnly;
			if (!string.IsNullOrWhiteSpace(singleFate))
			{
				fate =
					FateManager.ActiveFates.FirstOrDefault(
						f => string.Equals(f.Name, singleFate, StringComparison.InvariantCultureIgnoreCase));

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

				FateData = fate;
				return true;
			}

			fate = FateScoreProvider.GetObjectsByWeight(FateManager.ActiveFates).FirstOrDefault(ShouldSelectFate);
			if (fate == null)
			{
				return false;
			}

			FateData = fate;
			return true;
		}
Exemple #30
0
 void FateBtnMethord(FateData fd)
 {
     ShowFatePanelController.CreatShowFatePanel(fd.ID, ShowFatePanelController.FateInPanelType.isInSkillInfoPanel, this);
 }
Exemple #31
0
		public static void SetFate(FateData fate)
		{
			FateData = fate;
			Poi.Current = new Poi(fate, PoiType.Fate);
		}
Exemple #32
0
		public override void Start()
		{
			Navigator.PlayerMover = new SlideMover();
			Navigator.NavigationProvider = new GaiaNavigator();
			GameSettingsManager.FaceTargetOnAction = true;
			GameSettingsManager.FlightMode = true;
			TreeHooks.Instance.ClearAll();
			this.composite = BrainBehavior.CreateBrain();
			CharacterSettings.Instance.AutoEquip = FatebotSettings.Instance.UseAutoEquip;
			TreeHooks.Instance.ReplaceHook("SelectPoiType", this.SelectPoiType());
			TreeHooks.Instance.AddHook("PoiAction", this.SetFatePoi());
			TreeHooks.Instance.AddHook("PoiAction2", this.SetRestPoi());
			TreeHooks.Instance.AddHook("TreeStart", this.BotLogic);

			CombatTargeting.Instance.Provider = new ExFateCombatTargetingProvider(); // TODO Make new targeting
			FateData = null;
		}
Exemple #33
0
        internal static FateData GetChainFate(FateData fate)
        {
            var oracleFate = FateDatabase.GetFateFromFateData(fate);

            return(oracleFate.ChainId != 0 ? FateManager.GetFateById(oracleFate.ChainId) : null);
        }
Exemple #34
0
		private bool ShouldSelectFate(FateData fatedata)
		{
			if (Blacklist.Contains(fatedata.Id, BlacklistFlags.Node))
			{
				if (FatebotSettings.Instance.VerboseLogging)
				{
					Logging.WriteVerbose(
						"{0} - Blacklist.Contains(fate.Id, BlacklistFlags.Node) - We couldn't find a path most likely",
						fatedata.Name);
				}

				return false;
			}

			var instance = FatebotSettings.Instance;
			if (instance.LevelCheck
				&& (fatedata.Level < instance.MinLevel || Core.Player.ClassLevel + instance.MaxLevel < fatedata.Level))
			{
				if (FatebotSettings.Instance.VerboseLogging)
				{
					object[] name = { fatedata.Name, null };
					name[1] = (fatedata.Level < instance.MinLevel
									? "fate.Level < settings.MinLevel"
									: "(Core.Player.ClassLevel + settings.MaxLevel) < fate.Level");
					Logging.WriteVerbose("{0} {1}", name);
				}

				return false;
			}

			var icon = fatedata.Icon;
			if (!this.fateIconType.Contains(icon))
			{
				if (FatebotSettings.Instance.VerboseLogging)
				{
					object[] objArray = { fatedata.Name, fatedata.Icon };
					Logging.WriteVerbose("{0} - {1} - !_goodFates.Contains(fateIconType)", objArray);
				}

				return false;
			}

			if (instance.BlackListedFates.Contains(fatedata.Name))
			{
				if (FatebotSettings.Instance.VerboseLogging)
				{
					Logging.WriteVerbose("{0} - settings.BlackListedFates.Contains(fate.Name)", fatedata.Name);
				}

				return false;
			}

			if (icon == FateIconType.Boss)
			{
				if (!instance.BossEnabled)
				{
					return false;
				}

				if (FatebotSettings.Instance.IgnorePercentageFates.Contains(fatedata.Id))
				{
					return true;
				}

				if (fatedata.Progress < instance.BossPercentRequired)
				{
					if (FatebotSettings.Instance.VerboseLogging)
					{
						Logging.WriteVerbose("{0} - fate.Progress < settings.BossPercentRequired", fatedata.Name);
					}

					return false;
				}
			}

			if (icon != FateIconType.Battle || instance.MonsterSlayingEnabled)
			{
				if (icon == FateIconType.ProtectNPC2 && !instance.EscortEnabled)
				{
					return false;
				}

				return true;
			}

			if (FatebotSettings.Instance.VerboseLogging)
			{
				Logging.WriteVerbose("{0} - fateIconType == FateIconType.Battle && !settings.MonsterSlayingEnabled", fatedata.Name);
			}

			return false;
		}
Exemple #35
0
        internal static bool FateFilter(FateData fate)
        {
            var oracleFateData = FateDatabase.GetFateFromFateData(fate);

            if (oracleFateData.Type == FateType.Boss && !FateSettings.Instance.BossFatesEnabled)
            {
                return(false);
            }

            if (oracleFateData.Type == FateType.Collect && !FateSettings.Instance.CollectFatesEnabled)
            {
                return(false);
            }

            if (oracleFateData.Type == FateType.Defence && !FateSettings.Instance.DefenceFatesEnabled)
            {
                return(false);
            }

            if (oracleFateData.Type == FateType.Escort && !FateSettings.Instance.EscortFatesEnabled)
            {
                return(false);
            }

            if (oracleFateData.Type == FateType.Kill && !FateSettings.Instance.KillFatesEnabled)
            {
                return(false);
            }

            if (oracleFateData.Type == FateType.MegaBoss && !FateSettings.Instance.MegaBossFatesEnabled)
            {
                return(false);
            }

            if (WaitingForChainFate() && GetChainFate(PreviousFateId).Id != fate.Id)
            {
                return(false);
            }

            if (ModeSettings.Instance.OracleOperationMode == OracleOperationMode.SpecificFates && !FateSettings.Instance.SpecificFateList.Contains(fate.Id))
            {
                return(false);
            }

            if (Blacklist.Contains(fate.Id, BlacklistFlags.Node))
            {
                return(false);
            }

            if (BlacklistSettings.Instance.BlacklistedFates.Contains(fate.Id))
            {
                return(false);
            }

            if (FateSettings.Instance.IgnoreLowDuration)
            {
                if (Math.Abs(fate.Progress) < 0.5f && fate.TimeLeft < TimeSpan.FromSeconds(FateSettings.Instance.LowFateDuration))
                {
                    return(false);
                }
            }

            // Always ignore FATEs under 60 seconds if they're collection FATEs (stops reselecting FATE after final turn in).
            if (oracleFateData.Type == FateType.Collect && fate.TimeLeft < TimeSpan.FromSeconds(60))
            {
                return(false);
            }

            if (oracleFateData.SupportLevel == FateSupportLevel.Unsupported)
            {
                return(false);
            }

            if (oracleFateData.SupportLevel == FateSupportLevel.Problematic && !FateSettings.Instance.RunProblematicFates)
            {
                return(false);
            }

            if (oracleFateData.SupportLevel == FateSupportLevel.NotInGame)
            {
                return(false);
            }

            if (!FateProgressionMet(fate))
            {
                return(false);
            }

            if (fate.Level > OracleClassManager.GetTrueLevel() + FateSettings.Instance.FateMaxLevelAbove)
            {
                return(false);
            }

            if (fate.Level < OracleClassManager.GetTrueLevel() - FateSettings.Instance.FateMinLevelBelow &&
                (ModeSettings.Instance.OracleOperationMode == OracleOperationMode.FateGrind ||
                 ModeSettings.Instance.OracleOperationMode == OracleOperationMode.LevelMode ||
                 ModeSettings.Instance.OracleOperationMode == OracleOperationMode.MultiLevelMode))
            {
                return(false);
            }

            return(true);
        }