Exemplo n.º 1
0
        public MarkerSet(MpqFile file)
        {
            var stream = file.Open();
            Header = new Header(stream);
            SNO = stream.ReadInt32();
            unknown0 = stream.ReadInt32();
            unknown1 = stream.ReadInt32();
            serMarkers = new SerializeData(stream);
            long x = stream.Position;
            Markers = new Marker[serMarkers.Size / 208];
            stream.Position = serMarkers.Offset + 16;
            for (int i = 0; i < serMarkers.Size / 208; i++)
            {
                Markers[i] = new Marker(stream);
            }
            stream.Position = x;
            stream.Position += (15 * 4); // pad 15
            serNoSpawns = new SerializeData(stream);
            stream.Position += (14 * 4);
            aabb = new AABB_(stream);
            i0 = stream.ReadInt32();
            byte[] buf = new byte[256];
            stream.Read(buf, 0, 256); filename = Encoding.ASCII.GetString(buf);
            nLabel = stream.ReadInt32();
            nSpecialIndexCount = stream.ReadInt32();
            serSpecialIndexList = new SerializeData(stream);

                stream.Close();
        }
Exemplo n.º 2
0
        // Updated based on BoyC's 010editoer template, looks like some data at the end still isnt parsed - Darklotus
        public Actor(MpqFile file)
        {
            var stream = file.Open();
            Header = new Header(stream);
            this.ActorSNO = stream.ReadInt32();
            stream.Position += 8; // pad 2;
            this.i0 = stream.ReadInt32();
            this.type = stream.ReadInt32();
            this.ApperanceSNO = stream.ReadInt32();
            this.snoPhysMesh = stream.ReadInt32();
            this.Cyl = new AxialCylinder(stream);
            this.s = new Sphere(stream);
            this.aabbBounds = new AABB_(stream);
            this.serTagMap = new SerializeData(stream);
            stream.Position += 8; // pad 2
            this.AnimSetSNO = stream.ReadInt32();
            this.MonsterSNO = stream.ReadInt32();
            this.serMsgTriggeredEvents = new SerializeData(stream);

            this.i1 = stream.ReadInt32();
            stream.Position += 12; // pad 3 int - DarkLotus
            this.v0 = new Vector3D(stream.ReadFloat(), stream.ReadFloat(), stream.ReadFloat());
            this.Looks = new WeightedLook[8];
            for (int i = 0; i < 8; i++)
            {
                this.Looks[i] = new WeightedLook(stream);
            }
            this.PhysicsSNO = stream.ReadInt32();
            this.i2 = stream.ReadInt32(); this.i3 = stream.ReadInt32();
            this.f0 = stream.ReadFloat(); this.f1 = stream.ReadFloat(); this.f2 = stream.ReadFloat();
            this.padActorCollisionData = new int[17]; // Was 68/4 - Darklotus 
            for (int i = 0; i < 17; i++)
            {
                this.padActorCollisionData[i] = stream.ReadInt32();
            }
            this.padInventoryImages = new int[10]; //Was 5*8/4 - Darklotus
            for (int i = 0; i < 10; i++)
            {
                this.padInventoryImages[i] = stream.ReadInt32();
            }
            stream.Close();
        }
Exemplo n.º 3
0
        public World(MpqFile file)
        {
            var stream = file.Open();
            Header = new Header(stream);
            SNO = stream.ReadInt32();
            serDRLGParams = new SerializeData(stream);
            long x = stream.Position;
            if (serDRLGParams.Size > 0)
            {
                Param = new DRLGParams[serDRLGParams.Size / 120];
                stream.Position = serDRLGParams.Offset + 16;
                for (int i = 0; i < serDRLGParams.Size/120; i++)
                {
                    Param[i] = new DRLGParams(stream);
                }
            }
            stream.Position = x;
            stream.Position += (5 * 4); // This was 3 ints padding in the struct, was 8 bytes behind though so i changed it - DarkLotus

            serSceneParams = new SerializeData(stream);
            x = stream.Position;
            if (serSceneParams.Size > 0)
            {
                stream.Position = serSceneParams.Offset + 16;
                Scene = new SceneParams(stream); ;
                

            }
            stream.Position = x;
            stream.Position += (2 * 4);
            serMarkerSets = new SerializeData(stream);
            x = stream.Position;
            if (serMarkerSets.Size > 0)
            {
                MarkerSets = new int[serMarkerSets.Size / 4];
                stream.Position = serMarkerSets.Offset + 16;
                for (int i = 0; i < serMarkerSets.Size / 4; i++)
                {
                    MarkerSets[i] = stream.ReadInt32();
                }
            }
            stream.Position = x;

            stream.Position += (14 * 4);

            Environment = new DataTypes.Environment(stream);

            stream.Position += 4;
            LabelRuleSet = new DataTypes.LabelRuleSet(stream);
            i0 = stream.ReadInt32();
            stream.Position += 4;
            SceneClusterSet5 = new SceneClusterSet(stream);
            arNavMeshFuncs = new int[4];
            for (int i = 0; i < arNavMeshFuncs.Length; i++)
            {
                arNavMeshFuncs[i] = stream.ReadInt32();
            }
            stream.Position += 4;
            f0 = stream.ReadFloat();
            i1 = stream.ReadInt32();
            snoScript = stream.ReadInt32();
            i2 = stream.ReadInt32();
         
            stream.Close();
        }