Ejemplo n.º 1
0
        public bool CollectDataFromBinary(BinaryTable table, int index)
        {
            SkillConfigRecord record = GetRecord(table, index);

            Id          = DBCUtil.ExtractInt(table, record.Id, 0);
            Description = DBCUtil.ExtractString(table, record.Description, "");
            Script      = DBCUtil.ExtractString(table, record.Script, "");
            BreakType   = DBCUtil.ExtractInt(table, record.BreakType, 0);
            NextId      = DBCUtil.ExtractInt(table, record.NextId, 0);
            return(true);
        }
Ejemplo n.º 2
0
        public void AddToBinary(BinaryTable table)
        {
            SkillConfigRecord record = new SkillConfigRecord();

            record.Id          = DBCUtil.SetValue(table, Id, 0);
            record.Description = DBCUtil.SetValue(table, Description, "");
            record.Script      = DBCUtil.SetValue(table, Script, "");
            record.BreakType   = DBCUtil.SetValue(table, BreakType, 0);
            record.NextId      = DBCUtil.SetValue(table, NextId, 0);
            byte[] bytes = GetRecordBytes(record);
            table.Records.Add(bytes);
        }
Ejemplo n.º 3
0
        private static unsafe byte[] GetRecordBytes(SkillConfigRecord record)
        {
            byte[] bytes = new byte[sizeof(SkillConfigRecord)];
            fixed(byte *p = bytes)
            {
                SkillConfigRecord *temp = (SkillConfigRecord *)p;

                *temp = record;
            }

            return(bytes);
        }