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)); }
public bool IsObjectiveActive(QuestStepObjectiveType objectiveType) { return Steps.SelectMany(s => s.Objectives).Any(o => o.ObjectiveType == objectiveType && o.IsActive); }
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); }
public bool IsObjectiveActive(QuestStepObjectiveType objectiveType) { return(Steps.SelectMany(s => s.Objectives).Any(o => o.ObjectiveType == objectiveType && o.IsActive)); }