public static QuestChild ReadChildQuest(FLD_QuestList childQuest) { var quest = new QuestChild(); quest.Id = childQuest.Id; quest.Flag = childQuest.FlagCLD; var purpose = childQuest._PurposeID; if (purpose?.TaskType1 > 0) { var task = new QuestTask(); task.Type = purpose._TaskType1; task.Id = purpose.TaskID1; task.Log = purpose._TaskLog1?.name; task.Condition = purpose._TaskCondition1; task.Task = purpose._TaskID1; quest.Tasks.Add(task); } if (purpose?.TaskType2 > 0) { var task = new QuestTask(); task.Type = purpose._TaskType2; task.Id = purpose.TaskID2; task.Log = purpose._TaskLog2?.name; task.Condition = purpose._TaskCondition2; task.Task = purpose._TaskID2; quest.Tasks.Add(task); } return(quest); }
public static QuestParent ReadParentQuest(FLD_QuestList parentQuest) { var quest = new QuestParent(); quest.Id = parentQuest.Id; quest.Flag = parentQuest.FlagPRT; quest.Summary = parentQuest._Summary?.name; quest.Title = parentQuest._QuestTitle?.name; if (string.IsNullOrWhiteSpace(quest.Title)) { quest.Title = $"Quest #{quest.Id}"; } FLD_QuestList childQuest = parentQuest._NextQuestA; int stage = 1; while (childQuest != null) { QuestChild child = ReadChildQuest(childQuest); child.Parent = quest; child.Stage = stage++; quest.Children.Add(child); childQuest = childQuest._NextQuestA; } return(quest); }