public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(Index, 0x8);
                if (FaceVerticesBytes == null)
                {
                    FaceVerticesBytes = new byte[FaceVerticesSize];
                }
                FaceVerticesSize = FaceVerticesBytes.Length;
                io.WriteBits(FaceVerticesSize, 0x20);
                io.Write(FaceVerticesBytes, 0, FaceVerticesSize);
                ////for (int j = 0; j < FaceVerticesSize; j++)
                ////    io.WriteBits(FaceVerticesBytes[j], 0x8);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #2
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(LevelId, 0x20);
                if (Buffer == null)
                {
                    Buffer = new byte[BufferSize];
                }
                io.WriteBits(Buffer.Length, 0x20);
                foreach (byte t in Buffer)
                {
                    io.WriteBits(t, 0x8);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(NextUid, 0x20);
                if (LootOwners == null)
                {
                    LootOwners = new LootOwner[LootOwnersCount];
                    for (int xb = 0; xb < LootOwnersCount; xb++)
                    {
                        LootOwners[xb] = new LootOwner();
                    }
                }
                io.WriteInt16((short)LootOwners.Length);
                for (int i = 0; i < LootOwnersCount; i++)
                {
                    LootOwners[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                Offset = io.Position;
                io.WriteInt16(Version);
                if (StatsData == null)
                {
                    StatsData = new ItemAsset();
                }
                StatsData.Write(io);
                if (Version < 8)
                {
                    io.WriteInt32(Uid);
                }
                io.WriteBoolean(IsForSale);
                io.WriteBoolean(IsNew);
                io.WriteBoolean(IsCrafted);
                io.WriteInt32(StringId);
                if (StatsInstance != null)
                {
                    StatsInstance.Write(io);
                    if (Upgrades != null)
                    {
                        Upgrades.Write(io);
                        io.WriteBoolean(SuppressClassRestriction);
                        if (Version > 6)
                        {
                            io.WriteBoolean(IsPlaceHolder);
                        }
                        if (Version > 0xA)
                        {
                            io.WriteBoolean(HasSoundActionsReference);
                            if (HasSoundActionsReference)
                            {
                                SoundActionsReference.Write(io);
                            }
                        }
                    }
                }
                if (StackSize != 0xff)
                {
                    io.WriteBits(StackSize, 0x8);
                }
                if (MaxStackSize != 0xff)
                {
                    io.WriteBits(MaxStackSize, 0x8);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #5
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (Variations == null)
                {
                    Variations = new HeadVariation[VariationCount];
                    for (int xb = 0; xb < VariationCount; xb++)
                    {
                        Variations[xb] = new HeadVariation();
                    }
                }
                io.WriteBits(Variations.Length, 0x10);
                for (int i = 0; i < VariationCount; i++)
                {
                    Variations[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(ID, 0x20);
                if (Controllables == null)
                {
                    Controllables = new ControllableCreate[ControllablesCount];

                    for (int xb = 0; xb < ControllablesCount; xb++)
                    {
                        Controllables[xb] = new ControllableCreate();
                    }
                }
                ControllablesCount = (short)Controllables.Length;
                io.WriteInt16(ControllablesCount);
                for (int i = 0; i < ControllablesCount; i++)
                {
                    Controllables[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #7
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                //if(6 (<-????) > 5)
                //{
                io.WriteInt32(UserWaypoint_MapId);
                if (UserWaypoint_WorldPos == null)
                {
                    UserWaypoint_WorldPos = new byte[8];
                }
                for (int i = 0; i < 8; i++)
                {
                    io.WriteBits(UserWaypoint_WorldPos[i], 0x8);
                }
                FogArchive.Write(io);
                DynamicPinsMaps.Write(io);
                DiscoveredPins.Write(io);
                ExploredPins.Write(io);
                //}

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #8
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (Handles == null)
                {
                    Handles = new int[HandleCount];
                }
                io.WriteBits(Handles.Length, 0x10);
                foreach (int t in Handles)
                {
                    io.WriteBits(t, 0x20);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(ParamCount, 0x10);
                if (TextureShaderParams == null)
                {
                    TextureShaderParams = new TextureShaderParam[ParamCount];

                    for (int xb = 0; xb < ParamCount; xb++)
                    {
                        TextureShaderParams[xb] = new TextureShaderParam();
                    }
                }
                for (int i = 0; i < ParamCount; i++)
                {
                    TextureShaderParams[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(Version, 0x10);
                if (Version == 1)
                {
                    if (Agents == null)
                    {
                        Agents = new AgentEntryData[AgentCount];

                        for (int xb = 0; xb < AgentCount; xb++)
                        {
                            Agents[xb] = new AgentEntryData();
                        }
                    }
                    io.WriteInt16((short)Agents.Length);
                    for (int i = 0; i < Agents.Length; i++)
                    {
                        Agents[i].Write(io);
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #11
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(MapID);
                io.WriteBoolean(IsPersistent);
                io.WriteInt32(UncompressedSize);
                io.WriteBoolean(IsCompressed);
                if (Blob == null)
                {
                    Blob = new byte[Size];
                }
                io.WriteInt32(Blob.Length);
                foreach (byte t in Blob)
                {
                    io.WriteBits(t, 0x8);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #12
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }

                if (BoneOffsetEntries == null)
                {
                    BoneOffsetEntries = new BoneOffsetEntryV1[BoneOffsetsCount];

                    for (int xb = 0; xb < BoneOffsetsCount; xb++)
                    {
                        BoneOffsetEntries[xb] = new BoneOffsetEntryV1();
                    }
                }
                io.WriteBits(BoneOffsetEntries.Length, 0x10);
                foreach (BoneOffsetEntryV1 t in BoneOffsetEntries)
                {
                    t.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                BluePrint.Write(io);
                io.WriteInt32(IndexUsedByUniqueId);
                if (TransForm == null)
                {
                    TransForm = new byte[4][];
                }
                for (int i = 0; i < 4; i++)
                {
                    if (TransForm[i] == null)
                    {
                        TransForm[i] = new byte[0xc];
                    }
                    for (int j = 0; j < 0xc; j++)
                    {
                        io.WriteBits(TransForm[i][j], 0x8);
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #14
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(ID);
                if (Controllables == null)
                {
                    Controllables = new SpawnerControllable[ControllableCount];

                    for (int xb = 0; xb < ControllableCount; xb++)
                    {
                        Controllables[xb] = new SpawnerControllable();
                    }
                }
                io.WriteBits(Controllables.Length, 0xA);
                foreach (SpawnerControllable t in Controllables)
                {
                    t.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(BoneNameHash, 0x20);
                if (Value == null)
                {
                    Value = new byte[0xC];
                }
                for (int j = 0; j < 0xC; j++)
                {
                    io.WriteBits(Value[j], 0x8);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
 public bool Write(DAIIO io, bool skiplength = false)
 {
     try
     {
         if (!skiplength)
         {
             io.WriteBits(Length, LengthBits);
         }
         io.WriteBits(Name.Length, 0x10);
         io.WriteString(Name);
         io.WriteBits(BundleHash, 0x20);
         io.WriteBits(ParentBundleHash, 0x20);
         io.WriteBits(HeapType, 0x8);
         io.WriteBits(InitSize, 0x20);
         io.WriteBoolean(AllowGrow);
         io.WriteBits(Status, 0x8);
         io.WriteBits(BundleType, 0x8);
         io.WriteBits(GroupID, 0x20);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #17
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(storeEntitySaveUid);

                if (Items == null)
                {
                    Items = new StoreItemEntry[ItemCount];

                    for (int xb = 0; xb < ItemCount; xb++)
                    {
                        Items[xb] = new StoreItemEntry();
                    }
                }
                io.WriteInt16((short)Items.Length);
                foreach (StoreItemEntry t in Items)
                {
                    t.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #18
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);
         }
         io.WriteInt32(Id);
         io.WriteInt32(DestroyedPartsCount);
         io.WriteBoolean(KeepInfoOnUnregister);
         if (PartIds == null)
         {
             PartIds = new int[PartIdsCount];
         }
         io.WriteInt16((short)PartIds.Length);
         foreach (int t in PartIds)
         {
             io.WriteInt32(t);
         }
         io.WriteInt32(BitCount);
         if (BitArray == null)
         {
             BitArray = new byte[BitCount.NumberOfSetBits() << 2];
         }
         io.Write(BitArray, 0, BitArray.Length);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (Guids == null)
                {
                    Guids = new byte[Count][];
                }
                Count = (short)Guids.Length;
                io.WriteInt16(Count);
                for (int i = 0; i < Count; i++)
                {
                    if (Guids[i] == null)
                    {
                        Guids[i] = new byte[0x10];
                    }
                    for (int j = 0; j < 0x10; j++)
                    {
                        io.WriteBits(Guids[i][j], 0x8);
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt16(SpawnerCreateCount);
                if (SpawnerCreates == null)
                {
                    SpawnerCreates = new SpawnerCreate[SpawnerCreateCount];

                    for (int xb = 0; xb < SpawnerCreateCount; xb++)
                    {
                        SpawnerCreates[xb] = new SpawnerCreate();
                    }
                }
                for (int i = 0; i < SpawnerCreateCount; i++)
                {
                    SpawnerCreates[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #22
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                AgentEntityData.Write(io);
                if (AgentLookups == null)
                {
                    AgentLookups = new AgentLookup[AgentsLookupCount];

                    for (int xb = 0; xb < AgentsLookupCount; xb++)
                    {
                        AgentLookups[xb] = new AgentLookup();
                    }
                }
                AgentsLookupCount = AgentLookups.Length;
                io.WriteBits(AgentsLookupCount, 0x4);
                for (int i = 0; i < AgentsLookupCount; i++)
                {
                    AgentLookups[i].Write(io);
                }
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #23
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (MapGuid == null)
                {
                    MapGuid = new byte[0x10];
                }
                io.Write(MapGuid, 0, 0X10);
                if (Pins == null)
                {
                    Pins = new DynamicMapPinInfo[PinsCount];

                    for (int xb = 0; xb < PinsCount; xb++)
                    {
                        Pins[xb] = new DynamicMapPinInfo();
                    }
                }
                io.WriteInt16((short)Pins.Length);
                foreach (DynamicMapPinInfo t in Pins)
                {
                    t.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #24
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (Maps == null)
                {
                    Maps = new Map[MapCount];

                    for (int xb = 0; xb < MapCount; xb++)
                    {
                        Maps[xb] = new Map();
                    }
                }
                io.WriteInt16((short)Maps.Length);
                for (int i = 0; i < MapCount; i++)
                {
                    Maps[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (Caches == null)
                {
                    Caches = new PartyMemberDataCache[Count];

                    for (int xb = 0; xb < Count; xb++)
                    {
                        Caches[xb] = new PartyMemberDataCache();
                    }
                }
                io.WriteInt16((short)Caches.Length);
                for (int i = 0; i < Count; i++)
                {
                    Caches[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(Version);
                if (Inventories == null)
                {
                    Inventories = new StoreInventory[InventoryCount];

                    for (int xb = 0; xb < InventoryCount; xb++)
                    {
                        Inventories[xb] = new StoreInventory(SStructure);
                    }
                }
                io.WriteInt16((short)Inventories.Length);
                for (int i = 0; i < Inventories.Length; i++)
                {
                    Inventories[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                io.WriteBoolean(IsNull);
                if (!IsNull)
                {
                    io.WriteInt32(Value1);
                    io.WriteInt32(Value2);
                    io.WriteBoolean(DataIsNull);
                    if (!DataIsNull)
                    {
                        if (DataBytes == null)
                        {
                            DataBytes = new byte[0x10];
                        }
                        for (int i = 0; i < 0x10; i++)
                        {
                            io.WriteBits(DataBytes[i], 0x8);
                        }
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #28
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (Stats == null)
                {
                    Stats = new CraftedItemStats[StatsCount];

                    for (int xb = 0; xb < StatsCount; xb++)
                    {
                        Stats[xb] = new CraftedItemStats();
                    }
                }
                io.WriteInt16((short)Stats.Length);
                for (int i = 0; i < StatsCount; i++)
                {
                    Stats[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt16(OwnerInfoCount);
                if (OwnerInfos == null)
                {
                    OwnerInfos = new OwnerInfo[OwnerInfoCount];

                    for (int xb = 0; xb < OwnerInfoCount; xb++)
                    {
                        OwnerInfos[xb] = new OwnerInfo(SStructure);
                    }
                }
                for (int i = 0; i < OwnerInfoCount; i++)
                {
                    OwnerInfos[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteInt32(Id);
                io.WriteInt16(CallbackCount);
                if (Callbacks == null)
                {
                    Callbacks = new CallBackData[CallbackCount];

                    for (int xb = 0; xb < CallbackCount; xb++)
                    {
                        Callbacks[xb] = new CallBackData();
                    }
                }
                for (int i = 0; i < CallbackCount; i++)
                {
                    Callbacks[i].Write(io);
                }

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