Esempio n. 1
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                StatData.Write(io);
                Script.Write(io);
                if (DelArgs == null)
                {
                    DelArgs = new ItemAsset[ArgsCount];

                    for (int xb = 0; xb < ArgsCount; xb++)
                    {
                        DelArgs[xb] = new ItemAsset();
                    }
                }
                io.WriteInt16((short)DelArgs.Length);
                foreach (ItemAsset t in DelArgs)
                {
                    t.Write(io);
                }
                io.WriteSingle(DefaultValue);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                StatsData.Write(io);
                io.WriteSingle(Value);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 3
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(Version);
                io.WriteInt32(ClassId);
                io.WriteInt32(BackgroundId);
                io.WriteInt32(GenderId);
                io.WriteInt32(RaceId);
                io.WriteInt16((short)CharacterName.Length);
                io.WriteString(CharacterName);
                io.WriteInt32(VoiceVariationID);
                io.WriteInt32(DifficultyModeID);
                if (Version > 9)
                {
                    io.WriteInt32(LowestDifficultyModeID);
                }
                io.WriteInt32(CharacterSubclassID);
                if (Version >= 8)
                {
                    if (CharacterID == null)
                    {
                        CharacterID = new byte[0x10];
                    }
                    io.Write(CharacterID, 0, 0x10);
                }
                if (Version >= 0xD)
                {
                    io.WriteSingle(AgeInRealTimeSeconds);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }