Example #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));
        }
Example #2
0
        public RiftQuest()
        {
            Step  = RiftStep.NotStarted;
            State = QuestState.NotStarted;

            var quest = QuestInfo.FromId(RIFT_QUEST_ID);

            if (quest != null)
            {
                State = quest.State;
                var step = quest.QuestStep;
                switch (step)
                {
                case 1:     // Normal rift
                case 13:    // Greater rift
                    Step = RiftStep.KillingMobs;
                    break;

                case 3:     // Normal rift
                case 16:    // Greater rift
                    Step = RiftStep.BossSpawned;
                    break;

                case 34:
                    Step = RiftStep.UrshiSpawned;
                    break;

                case 46:
                case 10:
                    Step = RiftStep.Cleared;
                    break;
                }
            }

            if (State == QuestState.Completed)
            {
                Step = RiftStep.Completed;
            }
        }