Exposes Stream with the data contained in an MpqFile.
Inheritance: Stream
Exemple #1
0
        public ScriptFormula(MpqFileStream stream)
        {
            this.I0 = stream.ReadValueS32();
            this.I1 = stream.ReadValueS32();
            this.I2 = stream.ReadValueS32();
            this.I3 = stream.ReadValueS32();
            this.I4 = stream.ReadValueS32();
            this.NameSize = stream.ReadValueS32();
            this.I5 = stream.ReadValueS32();
            this.OpcodeSize = stream.ReadValueS32();
            this.OpCodeName = stream.ReadStringZ(Encoding.ASCII);

            switch (NameSize % 4)
            {
                case 0:
                    break;
                case 1:
                    stream.Position += 3;
                    break;
                case 2:
                    stream.Position += 2;
                    break;
                case 3:
                    stream.Position += 1;
                    break;

            }
            this.OpCodeArray = new byte[OpcodeSize];
            stream.Read(OpCodeArray, 0, OpcodeSize);
        }
Exemple #2
0
        public List<BuffDef> Buffs = new List<BuffDef>(); //4

        public PowerDef(MpqFileStream stream)
        {
            TagMap = stream.ReadSerializedItem<TagMap>();
            stream.Position += (2 * 4);
            GeneralTagMap = stream.ReadSerializedItem<TagMap>();
            stream.Position += (2 * 4);
            PVPGeneralTagMap = stream.ReadSerializedItem<TagMap>();
            stream.Position += (2 * 4);
            ContactTagMap0 = stream.ReadSerializedItem<TagMap>();
            ContactTagMap1 = stream.ReadSerializedItem<TagMap>();
            ContactTagMap2 = stream.ReadSerializedItem<TagMap>();
            ContactTagMap3 = stream.ReadSerializedItem<TagMap>();
            stream.Position += (8 * 4);
            PVPContactTagMap0 = stream.ReadSerializedItem<TagMap>();
            PVPContactTagMap1 = stream.ReadSerializedItem<TagMap>();
            PVPContactTagMap2 = stream.ReadSerializedItem<TagMap>();
            PVPContactTagMap3 = stream.ReadSerializedItem<TagMap>();
            stream.Position += (8 * 4);
            I0 = stream.ReadValueS32();
            ActColFlags1 = new ActorCollisionFlags(stream);
            ActColFlags2 = new ActorCollisionFlags(stream);
            stream.Position += 4;
            for (int i = 0; i < 4; i++)
            {
                Buffs.Add(new BuffDef(stream));
                stream.Position += (2 * 4);
            }
        }
Exemple #3
0
	   public Header(MpqFileStream stream)
	   {
		   DeadBeef = stream.ReadInt32();
		   SnoType  = stream.ReadInt32();
		   unknown1 = stream.ReadInt32();
		   unknown2 = stream.ReadInt32();
	   }
        /// <summary>
        /// Reads SceneSpecification from given MPQFileStream.
        /// </summary>
        /// <param name="stream">The MPQFileStream to read from.</param>
        public SceneSpecification(MpqFileStream stream)
        {
            CellZ = stream.ReadValueS32();
            Cell = new Vector2D(stream);
            SNOLevelAreas = new int[4];

            for (int i = 0; i < SNOLevelAreas.Length; i++)
            {
                SNOLevelAreas[i] = stream.ReadValueS32();
            }

            SNOPrevWorld = stream.ReadValueS32();
            Unknown1 = stream.ReadValueS32();
            SNOPrevLevelArea = stream.ReadValueS32();
            SNONextWorld = stream.ReadValueS32();
            Unknown2 = stream.ReadValueS32();
            SNONextLevelArea = stream.ReadValueS32();
            SNOMusic = stream.ReadValueS32();
            SNOCombatMusic = stream.ReadValueS32();
            SNOAmbient = stream.ReadValueS32();
            SNOReverb = stream.ReadValueS32();
            SNOWeather = stream.ReadValueS32();
            SNOPresetWorld = stream.ReadValueS32();
            Unknown3 = stream.ReadValueS32();
            Unknown4 = stream.ReadValueS32();
            Unknown5 = stream.ReadValueS32();
            stream.Position += (9 * 4);
            ClusterID = stream.ReadValueS32();
            SceneCachedValues = new SceneCachedValues(stream);
        }
Exemple #5
0
 public void Read(MpqFileStream stream)
 {
     this.I0 = stream.ReadValueS32();
     // Maybe this should stay a Char Array instead of a string. - DarkLotus
     this.Name = stream.ReadString(64, true);
     this.TriggeredEvent.Read(stream);
 }
Exemple #6
0
 public GizmoLocSpawnType(MpqFileStream stream)
 {
     stream.Position += 8;
     this.SpawnEntry = stream.ReadSerializedData<GizmoLocSpawnEntry>();
     this.S0 = stream.ReadString(80, true);
     this.S1 = stream.ReadString(256, true);
 }
Exemple #7
0
 public void Read(MpqFileStream stream)
 {
     this.SNOSpawn = stream.ReadValueS32();
     this.Probability = stream.ReadValueS32();
     this.I1 = stream.ReadValueS32();
     this.I2 = stream.ReadValueS32();
 }
Exemple #8
0
 public ConvLocalDisplayTimes(CrystalMpq.MpqFileStream stream)
 {
     for (int i = 0; i < Languages.Length; i++)
     {
         Languages[i] = stream.ReadValueS32();
     }
 }
Exemple #9
0
        public void Read(MpqFileStream stream)
        {
            this.SNOPower = stream.ReadValueS32();
            this.Category = (ActiveSkillCategory)stream.ReadValueS32();
            this.ReqLevel = stream.ReadValueS32();
            this.I2 = stream.ReadValueS32();

        }
Exemple #10
0
 /// <summary>
 /// Reads RGBAColor from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public RGBAColor(MpqFileStream stream)
 {
     var buf = new byte[4];
     stream.Read(buf, 0, 4);
     Red = buf[0];
     Green = buf[1];
     Blue = buf[2];
     Alpha = buf[3];
 }
Exemple #11
0
		   public TagMap(MpqFileStream stream)
		   {
			   tagmapsize = stream.ReadInt32();
			   TagMapEntry = new TagMapEntry[tagmapsize];
			   for (int i = 0; i < tagmapsize; i++)
			   {
				   TagMapEntry[i] = new TagMapEntry(stream);
			   }
		   }
 public void FileRead(MpqFileStream stream, long offset)
 {
     stream.Position = offset + 0;
     Min = new Vector3D();
     Min.FileRead(stream, stream.Position);
     stream.Position = offset + 12;
     Max = new Vector3D();
     Max.FileRead(stream, stream.Position);
 }
Exemple #13
0
 public Header(MpqFileStream stream)
 {
     this.DeadBeef = stream.ReadValueS32();
     this.SnoType = stream.ReadValueS32();
     this.Unknown1 = stream.ReadValueS32();
     this.Unknown2 = stream.ReadValueS32();
     this.SNOId = stream.ReadValueS32();
     this.Unknown3 = stream.ReadValueS32();
     this.Unknown4 = stream.ReadValueS32();
 }
Exemple #14
0
        public QuestUnassignedStep(MpqFileStream stream)
        {
            I0 = stream.ReadValueS32();
            stream.Position += 4;       // unaccounted in xml
            stream.Position += (2 * 4);
            StepObjectiveSets = stream.ReadSerializedData<QuestStepObjectiveSet>();

            stream.Position += (2 * 4);
            StepFailureConditionsSets = stream.ReadSerializedData<QuestStepFailureConditionSet>();
        }
Exemple #15
0
        public void Read(MpqFileStream stream)
        {
            TagMapSize = stream.ReadValueS32();
            TagMapEntries = new TagMapEntry[TagMapSize];

            for (int i = 0; i < TagMapSize; i++)
            {
                TagMapEntries[i] = new TagMapEntry(stream);
            }
        }
Exemple #16
0
 public ItemSpecifierData(MpqFileStream stream)
 {
     ItemGBId = stream.ReadValueS32();
     I0 = stream.ReadValueS32();
     for (int i = 0; i > 3; i++)
     {
         GBIdAffixes[i] = stream.ReadValueS32();
     }
     I1 = stream.ReadValueS32();
 }
Exemple #17
0
 public WaypointInfo(MpqFileStream stream)
 {
     SNOWorld = stream.ReadValueS32();
     SNOLevelArea = stream.ReadValueS32();
     I0 = stream.ReadValueS32();
     I1 = stream.ReadValueS32();
     I2 = stream.ReadValueS32();
     SNOQuestRange = stream.ReadValueS32();
     I3 = stream.ReadValueS32();
 }
Exemple #18
0
            public NavMeshDef(MpqFileStream stream)
            {
                this.SquaresCountX = stream.ReadValueS32();
                this.SquaresCountY = stream.ReadValueS32();
                this.Int0 = stream.ReadValueS32();
                this.NavMeshSquareCount = stream.ReadValueS32();
                this.Float0 = stream.ReadValueF32();
                this.Squares = stream.ReadSerializedData<NavMeshSquare>(this.NavMeshSquareCount);

                stream.Position += (3 * 4);
                this.Filename = stream.ReadString(256, true);
            }
Exemple #19
0
 public void Read(MpqFileStream stream)
 {
     this.Name = stream.ReadString(128, true);
     this.Type = (MarkerType)stream.ReadValueS32();
     this.PRTransform = new PRTransform(stream);
     this.SNOHandle = new SNOHandle(stream);
     this.TagMap = stream.ReadSerializedItem<TagMap>();
     stream.Position += 8;
     this.MarkerLinksCount = stream.ReadValueS32();
     this.MarkerLinks = stream.ReadSerializedData<MarkerLink>();
     stream.Position += (3 * 4);
 }
Exemple #20
0
 public void Read(MpqFileStream stream)
 {
     this.SNOPower = stream.ReadValueS32();
     this.Category = (ActiveSkillCategory)stream.ReadValueS32();
     this.SkillGroup = stream.ReadValueS32();
     this.ReqLevel = stream.ReadValueS32();
     this.RuneNone_ReqLevel = stream.ReadValueS32();
     this.RuneA_ReqLevel = stream.ReadValueS32();
     this.RuneB_ReqLevel = stream.ReadValueS32();
     this.RuneC_ReqLevel = stream.ReadValueS32();
     this.RuneD_ReqLevel = stream.ReadValueS32();
     this.RuneE_ReqLevel = stream.ReadValueS32();
 }
Exemple #21
0
 /// <summary>
 /// Reads SceneCachedValues from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public SceneCachedValues(MpqFileStream stream)
 {
     Unknown1 = stream.ReadValueS32();
     Unknown2 = stream.ReadValueS32();
     Unknown3 = stream.ReadValueS32();
     AABB1 = new AABB(stream);
     AABB2 = new AABB(stream);
     Unknown4 = new int[4];
     for (int i = 0; i < Unknown4.Length; i++)
     {
         Unknown4[i] = stream.ReadValueS32();
     }
     Unknown5 = stream.ReadValueS32();
 }
Exemple #22
0
 public void Read(MpqFileStream stream)
 {
     this.I0 = stream.ReadValueS32();
     this.SNOSubTreasureClass = stream.ReadValueS32();
     this.Percentage = stream.ReadValueF32();
     this.I1 = stream.ReadValueS32();
     this.GBIdQualityClass = stream.ReadValueS32();
     this.I2 = stream.ReadValueS32();
     this.I3 = stream.ReadValueS32();
     this.SNOCondition = stream.ReadValueS32();
     this.ItemSpecifier = new ItemSpecifierData(stream);
     this.I5 = stream.ReadValueS32();
     this.I4 = new int[4];
     for (int i = 0; i < 4; i++)
         this.I4[i] = stream.ReadValueS32();
 }
Exemple #23
0
        public void Read(MpqFileStream stream)
        {
            this.Name = stream.ReadString(128, true);
            this.Int0 = stream.ReadValueS32();
            this.PRTransform = new PRTransform(stream);
            this.SNOName = new SNOName(stream);

            this.TagMap = stream.ReadSerializedItem<TagMap>();

            // Un sure about these 3 ints, 010template isnt the same as snodata.xml - DarkLotus
            this.IntTagMap = stream.ReadValueS32();
            Int1 = stream.ReadValueS32();
            Int2 = stream.ReadValueS32();

            var pointerMarkerLinks = stream.GetSerializedDataPointer();
            stream.Position += (3 * 4);
        }
Exemple #24
0
 public void Read(MpqFileStream stream)
 {
     SNOConv = stream.ReadValueS32();
     I0 = stream.ReadValueS32();
     I1 = stream.ReadValueS32();
     I2 = stream.ReadValueS32();
     GbidItem = stream.ReadValueS32();
     Noname1 = stream.ReadString(128, true);
     Noname2 = stream.ReadString(128, true);
     SNOQuestCurrent = stream.ReadValueS32();
     I3 = stream.ReadValueS32();
     SNOQuestAssigned = stream.ReadValueS32();
     SNOQuestActive = stream.ReadValueS32();
     SNOQuestComplete = stream.ReadValueS32();
     SNOQuestRange = stream.ReadValueS32();
     SNOLevelArea = stream.ReadValueS32();
 }
Exemple #25
0
        public void Read(MpqFileStream stream)
        {
            this.Name = stream.ReadString(128, true);
            this.Type = (MarkerType)stream.ReadValueS32();
            this.PRTransform = new PRTransform(stream);
            this.SNOHandle = new SNOHandle(stream);

            this.TagMap = stream.ReadSerializedItem<TagMap>();

            // Un sure about these 3 ints, 010template isnt the same as snodata.xml - DarkLotus
            // IntTagMap && Int2 are always 0 for beta. leave it here only because xml does not match either -farmy
            this.IntTagMap = stream.ReadValueS32();
            Int1 = stream.ReadValueS32();
            var int2 = stream.ReadValueS32();
            this.MarkerLinks = stream.ReadSerializedData<MarkerLink>();
            stream.Position += (3 * 4);
        }
Exemple #26
0
 public void Read(MpqFileStream stream)
 {
     this.F0 = new Float3(stream);
     this.F1 = new Float3(stream);
     this.F2 = new Float3(stream);
     stream.Position += 36;
     this.DominoNodeCount = stream.ReadValueS32();
     this.VerticeCount = stream.ReadValueS32();
     this.DominoTriangleCount = stream.ReadValueS32();
     this.DominoEdgeCount = stream.ReadValueS32();
     this.I4 = stream.ReadValueS32();
     this.I5 = stream.ReadValueS32();
     this.Vertices = stream.ReadSerializedData<Float3>();
     this.DominoTriangles = stream.ReadSerializedData<MeshTriangle>();
     this.DominoNodes = stream.ReadSerializedData<MeshNode>();
     this.DominoEdges = stream.ReadSerializedData<MeshEdge>();
     this.I6 = stream.ReadValueS32();
     this.I7 = stream.ReadValueS32();
 }
Exemple #27
0
		   public Marker(MpqFileStream stream)
		   {
			   byte[] buf = new byte[128];
			   stream.Read(buf, 0, 128); Name = Encoding.ASCII.GetString(buf);
			   i0 = stream.ReadInt32();
			   PRTransform = new PRTransform(stream);
			   SNOName = new SNOName(stream);
			   serTagMap = new SerializeData(stream);
			   TagMap = stream.ReadInt32();
			   i1 = stream.ReadInt32();
			   i2 = stream.ReadInt32();
			   serMarkerLinks = new SerializeData(stream);
			   stream.Position += (3 * 4);
			   long x = stream.Position;
			   
			   if (serTagMap.Size > 0)
			   {
				   stream.Position = serTagMap.Offset + 16;
				   TM = new TagMap(stream);

			   }
			   stream.Position = x;
		   }
Exemple #28
0
        public TagMapEntry(MpqFileStream stream)
        {
            this.Type = stream.ReadValueS32();
            this.TagID = stream.ReadValueS32();

            switch (this.Type)
            {
                case 0:
                    this.Int2 = stream.ReadValueS32();
                    break;
                case 1:
                    Float0 = stream.ReadValueF32();
                    break;
                case 2: // SNO
                    this.Int2 = stream.ReadValueS32();
                    break;
                case 4:
                    this.ScriptFormula = new ScriptFormula(stream);
                    break;
                default:
                    this.Int2 = stream.ReadValueS32();
                    break;
            }
        }
Exemple #29
0
 public void Read(MpqFileStream stream)
 {
     this.DRLGParams = stream.ReadSerializedData<DRLGParams>();
     stream.Position += 8;
     this.SceneParams = stream.ReadSerializedItem<SceneParams>();
     stream.Position += 8;
     LabelRuleSet = new LabelRuleSet(stream);
     this.Int1 = stream.ReadValueS32();
     this.SceneClusterSet = new SceneClusterSet(stream);
     for (int i = 0; i < SNONavMeshFunctions.Length; i++)
     {
         SNONavMeshFunctions[i] = stream.ReadValueS32();
     }
     SNOScript = stream.ReadValueS32();
     Int2 = stream.ReadValueS32();
 }
Exemple #30
0
        public Environment(MpqFileStream stream)
        {
            Unknown = new int[38];
            for (int i = 0; i < 38; i++)
            {
                Unknown[i] = stream.ReadValueS32();
            }

            /* RGBAColor0 = new RGBAColor(stream);
             PostFXParams1 = new PostFXParams(stream);
             int2 = stream.ReadInt32();
             int3 = stream.ReadInt32();
             UberMaterial4 = new UberMaterial(stream);
             * */
            snoMusic = stream.ReadValueS32();
            snoCombatMusic = stream.ReadValueS32();
            snoAmbient = stream.ReadValueS32();
            snoReverb = stream.ReadValueS32();
            snoWeather = stream.ReadValueS32();
            snoIrradianceTex = stream.ReadValueS32();
            snoIrradianceTexDead = stream.ReadValueS32();
        }
Exemple #31
0
        public LabelCondition(MpqFileStream stream)
        {
            Enum0 = (DT_ENUM0)stream.ReadValueS32();
            Int0 = stream.ReadValueS32();
            Int1 = new int[4];

            for (int i = 0; i < Int1.Length; i++)
            {
                Int1[i] = stream.ReadValueS32();
            }
        }