Example #1
0
        public static ScriptInstruction[] Read(Saint.IXivRow row, int count)
        {
            //var extraStartIndex = 142;
            //var extraEndIndex = 653;

            //var extraStartIndex2 = 654;
            //var extraEndIndex2 = 1405;

            var instructions = new ScriptInstruction[count];

            for (var i = 0; i < count; i++)
            {
                var instruction = new ScriptInstruction();
                instruction.Index    = i;
                instruction.Label    = (SaintCoinach.Text.XivString)row.GetRaw("Script{Instruction}[" + i + "]");
                instruction.Argument = (UInt32)row.GetRaw("Script{Arg}[" + i + "]");
                instructions[i]      = instruction;

                //if (instruction.Instruction == "")
                //    continue;

                //instruction.RawValues = new List<object>();
                //for (var ii = extraStartIndex + i; ii < extraEndIndex; ii += count)
                //    instruction.RawValues.Add(quest[ii]);

                //for (var ii = extraStartIndex2 + i; ii < extraEndIndex2; ii += count)
                //    instruction.RawValues.Add(quest[ii]);
            }

            return(instructions
                   .Where(i => i.Label != "")
                   .ToArray());
        }
Example #2
0
        private JObject Option(dynamic book, Game.IXivRow row, int index)
        {
            var quantity   = (UInt16)row["Reward{Quantity}[" + index + "]"];
            var rewardItem = (Game.Item)row["Reward{Item}[" + index + "]"];
            var isHQ       = (bool)row["Reward{HQ}[" + index + "]"];

            var item = _builder.Db.ItemsById[rewardItem.Key];

            item.bingoReward = 1;
            _builder.Db.AddReference(item, "item", "wondroustails", false);
            _builder.Db.AddReference(book, "item", rewardItem.Key, false);

            dynamic option = new JObject();

            option.item   = rewardItem.Key;
            option.amount = quantity;

            if (isHQ)
            {
                option.hq = 1;
            }

            return(option);
        }