private List <QuestRewardItemGroup> BuildClassQuestJobRewardItemGroups(string itemPrefix, int count)
        {
            List <QuestRewardItemGroup> groups = new List <QuestRewardItemGroup>();

            for (int i = 0; i < count; ++i)
            {
                XivRow row = (XivRow)Quest[$"{itemPrefix}[{i}]"];
                if (row == null)
                {
                    continue;
                }

                Ex.Variant2.DataRow parentRow = (SaintCoinach.Ex.Variant2.DataRow)row.SourceRow;
                foreach (Ex.Variant2.SubRow subRow in parentRow.SubRows)
                {
                    ClassJobCategory       category = (ClassJobCategory)subRow["ClassJobCategory"];
                    List <QuestRewardItem> items    = new List <QuestRewardItem>();
                    for (int ii = 0; ii < 3; ++ii)
                    {
                        Item itm = (Item)subRow["Reward{Item}[" + ii + "]"];
                        byte c   = (byte)subRow["Reward{Amount}[" + ii + "]"];
                        if (itm.Key == 0 || c == 0 || category.Key == 0)
                        {
                            continue;
                        }

                        items.Add(new QuestRewardItem(itm, c, null, false));
                    }
                    groups.Add(new QuestRewardItemGroup(items, QuestRewardGroupType.ClassJob, category));
                }
            }

            return(groups);
        }
Ejemplo n.º 2
0
        void IndexClassJobCategorySubsets(Saint.ClassJobCategory primary)
        {
            foreach (var sClassJobCategory in _builder.Sheet <Saint.ClassJobCategory>())
            {
                if (sClassJobCategory.Key <= 1)
                {
                    continue;
                }

                // No duplicates.
                if (_classJobCategorySubsets.ContainsKey(sClassJobCategory))
                {
                    continue;
                }

                var isSubset = true;
                foreach (var sClassJob in sClassJobCategory.ClassJobs)
                {
                    if (!primary.ClassJobs.Contains(sClassJob))
                    {
                        isSubset = false;
                        break;
                    }
                }

                if (isSubset)
                {
                    _classJobCategorySubsets[sClassJobCategory] = primary;
                }
            }
        }
        private ClassJobRequirement[] BuildClassJobs()
        {
            const int Count = 2;

            List <ClassJobRequirement> cjr = new List <ClassJobRequirement>();

            for (int i = 0; i < Count; ++i)
            {
                ClassJobCategory cjc = Quest.As <ClassJobCategory>(i);
                int lv = Quest.AsInt32("ClassJobLevel", i);

                if (cjc.Key != 0 && lv > 0)
                {
                    cjr.Add(new ClassJobRequirement(cjc, lv));
                }
            }

            return(cjr.ToArray());
        }
 internal ClassJobRequirement(ClassJobCategory category, int level)
 {
     this.ClassJobCategory = category;
     this.Level            = level;
 }
Ejemplo n.º 5
0
 public QuestRewardItemGroup(IEnumerable <QuestRewardItem> items, QuestRewardGroupType type, ClassJobCategory category)
 {
     this.Items            = items;
     this.Type             = type;
     this.ClassJobCategory = category;
 }
 internal ClassJobRequirement(ClassJobCategory category, int level) {
     this.ClassJobCategory = category;
     this.Level = level;
 }