Example #1
0
        /// <summary>
        /// Checks if the specified quest is a completed daily quest.
        /// </summary>
        /// <param name="id">The id of the quest.</param>
        /// <returns>Whether or not the specified quest is a daily quest that the player has already completed.</returns>
        public bool IsDailyComplete(int id)
        {
            Bot.Wait.ForTrue(() => QuestTree.Contains(x => x.ID == id), () => Load(id), 20);
            Quest q = QuestTree.Find(x => x.ID == id);

            return(q != null && q.Field != null && Bot.CallGameFunction <int>("world.getAchievement", q.Field, q.Index) != 0);
        }
Example #2
0
 /// <summary>
 /// Tries to get the quest with the given ID if it is loaded.
 /// </summary>
 /// <param name="id">The ID of the quest to get.</param>
 /// <param name="quest">The quest object to set as the result.</param>
 /// <returns>True if the quest is loaded and quest was set succesfully.</returns>
 public bool TryGetQuest(int id, out Quest quest) => (quest = QuestTree.Find(x => x.ID == id)) != null;
Example #3
0
 private Quest EnsureLoaded(int id)
 {
     Bot.Wait.ForTrue(() => QuestTree.Contains(x => x.ID == id), () => Load(id), 20);
     return(QuestTree.Find(q => q.ID == id));
 }
Example #4
0
        /// <summary>
        /// Checks if the specified quest is a completed daily quest.
        /// </summary>
        /// <param name="id">The id of the quest.</param>
        /// <returns>Whether or not the specified quest is a daily quest that the player has already completed.</returns>
        public bool IsDailyComplete(int id)
        {
            Quest q = QuestTree.Find(x => x.ID == id);

            return(q != null && q.Field != null && Bot.CallGameFunction <int>("world.getAchievement", q.Field, q.Index) != 0);
        }