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}"; } var childQuest = parentQuest._NextQuestA; int stage = 1; while (childQuest != null) { var child = ReadChildQuest(childQuest); child.Parent = quest; child.Stage = stage++; quest.Children.Add(child); childQuest = childQuest._NextQuestA; } return(quest); }
private static IEnumerable <Achievement> GetAchievementSet(CHR_Bl blade, FLD_AchievementSet set, string skillName, string type, int column) { var achievements = new List <Achievement>(); int level = 1; for (int i = 0; i < set._AchievementID.Length; i++) { FLD_AchievementList achieve = set._AchievementID[i]; var output = new Achievement(); achievements.Add(output); output.BladeId = blade.Id; output.BladeName = blade._Name.name; output.Skill = skillName; output.Type = type; output.Col = column; output.Row = i + 1; if (achieve == null) { continue; } output.Level = level++.ToString(); FLD_QuestList quest = achieve._Task; if (quest == null) { continue; } FLD_QuestTask task = quest._NextQuestA._PurposeID; int ideaPoints = quest._RewardSetA?.IdeaValue ?? 0; var ideaCategory = (IdeaCategory)(quest._RewardSetA?.IdeaCategory ?? 0); output.IdeaCategory = ideaPoints > 0 ? ideaCategory.ToString() : ""; output.IdeaPoints = ideaPoints > 0 ? ideaPoints.ToString() : ""; output.Condition = task._TaskLog1.name; output.Count = GetTaskCount(task) > 0 ? GetTaskCount(task).ToString() : ""; output.Result = achieve._Task._ResultA.name; } return(achievements); }