Beispiel #1
0
 public WaitCoroutine(SNOQuest questId, SNOWorld worldSnoId, int milliSeconds)
 {
     _worldId  = worldSnoId;
     _questId  = questId;
     _waitTime = TimeSpan.FromMilliseconds(milliSeconds);
     Id        = Guid.NewGuid();
 }
Beispiel #2
0
        private static bool IsQuestObjectiveActive(SNOQuest questId, int questStepId, QuestStepObjectiveType objectiveType)
        {
            var currentQuest = QuestInfo.FromId(questId);

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

            if (step == null)
            {
                Core.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 MoveThroughDeathGates(SNOQuest questId, SNOWorld worldId, int numberOfGatesToUse = -1)
 {
     _questId    = questId;
     _worldId    = worldId;
     _gatesToUse = numberOfGatesToUse;
     Id          = Guid.NewGuid();
 }
 public MoveToSceneCoroutine(SNOQuest questId, SNOWorld worldId, string sceneName, bool zergSafe = false, bool explore = true)
 {
     _questId     = questId;
     _worldId     = worldId;
     SceneName    = sceneName;
     _zergEnabled = zergSafe;
     _explore     = explore;
     Id           = Guid.NewGuid();
 }
 public MoveToSceneCoroutine(SNOQuest questId, SNOWorld worldId, int sceneSnoId, bool zergSafe = false, bool explore = true)
 {
     _questId     = questId;
     _worldId     = worldId;
     SceneName    = ZetaDia.SNO.LookupSNOName(SNOGroup.Scene, sceneSnoId);
     _zergEnabled = zergSafe;
     _explore     = explore;
     Id           = Guid.NewGuid();
 }
Beispiel #6
0
        public static QuestData GetQuestData(SNOQuest questId)
        {
            var bountyInfo = GetBountyInfo(questId);
            var questData  = new QuestData();

            questData.QuestId = questId; //(int)bountyInfo.Quest;

            questData.Steps = new List <QuestStepData>();

            if (bountyInfo == null)
            {
                return(questData);
            }

            questData.Name         = bountyInfo.Info.DisplayName.Replace("Bounty: ", string.Empty);
            questData.InternalName = bountyInfo.Quest.ToString();
            questData.Act          = bountyInfo.Act;
            questData.ActName      = bountyInfo.Act.ToString();

            questData.LevelAreaIds = new HashSet <SNOLevelArea>(bountyInfo.LevelAreas);

            questData.Waypoint = WaypointFactory.GetWaypointByLevelAreaId(bountyInfo.StartingLevelArea);

            foreach (var step in bountyInfo.Info.QuestRecord.Steps)
            {
                var questStep = new QuestStepData(questData, step);
                questData.Steps.Add(questStep);
            }

            //if (questData.QuestType == BountyQuestType.Unknown)
            //{
            //    questData.QuestType = BountyQuestTypeFactory.GetQuestType(bountyInfo);
            //}

            //var bountyScripts = new BountyScripts();
            //if (bountyScripts.ContainsKey(questId))
            //{
            //    questData.BountyScript = bountyScripts[questId];
            //    questData.BountyScript.Reset();
            //}

            //Core.Logger.Debug("[QuestData] Saving Quest {0} ({1})", questData.Name, questData.QuestId);
            //questData.Save();
            return(questData);
        }
Beispiel #7
0
 private static BountyInfo GetBountyInfo(SNOQuest questId)
 {
     return(ZetaDia.Storage.Quests.Bounties.FirstOrDefault(b => b.Quest == questId));
 }