示例#1
0
        private static bool IsQuestObjectiveActive(int questId, int questStepId, QuestStepObjectiveType objectiveType)
        {
            var currentQuest = QuestInfo.FromId(questId);

            if (currentQuest == null)
            {
                Logger.Debug("[Bounty] Failed to determine the step id. Reason: Quest not found.");
                return(false);
            }
            var step = currentQuest.QuestRecord.Steps.FirstOrDefault();

            if (step == null)
            {
                Logger.Debug("[Bounty] Failed to determine the step id. Reason: Step not found.");
                return(false);
            }
            var objectives = currentQuest.QuestRecord.Steps.First(qs => qs.StepId == questStepId).QuestStepObjectiveSet.QuestStepObjectives;
            int objectiveIndex;

            for (objectiveIndex = 0; objectiveIndex < objectives.Length; objectiveIndex++)
            {
                if (objectives[objectiveIndex].ObjectiveType == objectiveType)
                {
                    break;
                }
            }

            return(QuestObjectiveInfo.IsActiveObjective(questId, questStepId, objectiveIndex));
        }
示例#2
0
 public bool IsObjectiveActive(QuestStepObjectiveType objectiveType)
 {
     return Steps.SelectMany(s => s.Objectives).Any(o => o.ObjectiveType == objectiveType && o.IsActive);
 }
示例#3
0
        private static bool IsQuestObjectiveActive(int questId, int questStepId, QuestStepObjectiveType objectiveType)
        {
            var currentQuest = QuestInfo.FromId(questId);
            if (currentQuest == null)
            {
                Logger.Debug("[Bounty] Failed to determine the step id. Reason: Quest not found.");
                return false;
            }
            var step = currentQuest.QuestRecord.Steps.FirstOrDefault();
            if (step == null)
            {
                Logger.Debug("[Bounty] Failed to determine the step id. Reason: Step not found.");
                return false;
            }
            var objectives = currentQuest.QuestRecord.Steps.First(qs => qs.StepId == questStepId).QuestStepObjectiveSet.QuestStepObjectives;
            int objectiveIndex;
            for (objectiveIndex = 0; objectiveIndex < objectives.Length; objectiveIndex++)
            {
                if (objectives[objectiveIndex].ObjectiveType == objectiveType)
                {
                    break;
                }
            }

            return QuestObjectiveInfo.IsActiveObjective(questId, questStepId, objectiveIndex);
        }
示例#4
0
 public bool IsObjectiveActive(QuestStepObjectiveType objectiveType)
 {
     return(Steps.SelectMany(s => s.Objectives).Any(o => o.ObjectiveType == objectiveType && o.IsActive));
 }