Exemple #1
0
 public MonsterSkillDeclaration(MpqFileStream stream)
 {
     F0 = stream.ReadValueF32();
     F1 = stream.ReadValueF32();
     I0 = stream.ReadValueS32();
     F2 = stream.ReadValueF32();
 }
Exemple #2
0
        }                                    // DT_TIME

        public TriggerEvent(MpqFileStream stream)
        {
            I0 = stream.ReadValueS32();
            TriggerConditions = new TriggerConditions(stream);
            I1                  = stream.ReadValueS32();
            SNOHandle           = new SNOHandle(stream);
            I2                  = stream.ReadValueS32();
            I3                  = stream.ReadValueS32();
            RuneType            = stream.ReadValueS32();
            UseRuneType         = stream.ReadValueS32();
            HardPointLinks      = new HardPointLink[2];
            HardPointLinks[0]   = new HardPointLink(stream);
            HardPointLinks[1]   = new HardPointLink(stream);
            this.LookLink       = stream.ReadString(64, true);
            this.ConstraintLink = stream.ReadString(64, true);
            I4                  = stream.ReadValueS32();
            F0                  = stream.ReadValueF32();
            I5                  = stream.ReadValueS32();
            I6                  = stream.ReadValueS32();
            I7                  = stream.ReadValueS32();
            I8                  = stream.ReadValueS32();
            I9                  = stream.ReadValueS32();
            F1                  = stream.ReadValueF32();
            F2                  = stream.ReadValueF32();
            I10                 = stream.ReadValueS32();
            F3                  = stream.ReadValueF32();
            I11                 = stream.ReadValueS32();
            Velocity            = stream.ReadValueF32();
            I12                 = stream.ReadValueS32();
            Ticks1              = stream.ReadValueS32();
            Color1              = new RGBAColor(stream);
            I14                 = stream.ReadValueS32();
            Color2              = new RGBAColor(stream);
            I15                 = stream.ReadValueS32();
        }
Exemple #3
0
            public NavZoneDef(MpqFileStream stream)
            {
                this.NavCellCount = stream.ReadValueS32();
                stream.Position  += (3 * 4);
                this.NavCells     = stream.ReadSerializedData <NavCell>();

                this.NeighbourCount    = stream.ReadValueS32();
                stream.Position       += (3 * 4);
                this.NavCellNeighbours = stream.ReadSerializedData <NavCellLookup>();

                this.Float0 = stream.ReadValueF32();
                this.Float1 = stream.ReadValueF32();
                this.Int2   = stream.ReadValueS32();
                this.V0     = new Vector2D(stream);

                stream.Position += (3 * 4);
                this.GridSquares = stream.ReadSerializedData <NavGridSquare>();

                this.Int3        = stream.ReadValueS32();
                stream.Position += (3 * 4);
                this.CellLookups = stream.ReadSerializedData <NavCellLookup>();

                this.BorderDataCount = stream.ReadValueS32();
                stream.Position     += (3 * 4);
                this.BorderData      = stream.ReadSerializedData <NavCellBorderData>();
            }
Exemple #4
0
            public NavZoneDef(MpqFileStream stream)
            {
                this.NavCellCount = stream.ReadValueS32();

                stream.Position += (3 * 4);
                this.NavCells    = stream.ReadSerializedData <NavCell>(this.NavCellCount);

                this.NeightbourCount   = stream.ReadValueS32();
                stream.Position       += (3 * 4);
                this.NavCellNeighbours = stream.ReadSerializedData <NavCellLookup>(this.NeightbourCount);

                this.Float0 = stream.ReadValueF32();
                this.Float1 = stream.ReadValueF32();
                this.Int2   = stream.ReadValueS32();
                this.V0     = new Vector2D(stream);

                stream.Position += (3 * 4);
                var pointerGridSquares = stream.GetSerializedDataPointer();

                this.GridSquares = stream.ReadSerializedData <NavGridSquare>(pointerGridSquares, pointerGridSquares.Size / 6);

                this.Int3        = stream.ReadValueS32();
                stream.Position += (3 * 4);
                var pointerCellLookups = stream.GetSerializedDataPointer();

                this.CellLookups = stream.ReadSerializedData <NavCellLookup>(pointerCellLookups, pointerCellLookups.Size / 4);

                this.Int4        = stream.ReadValueS32();
                stream.Position += (3 * 4);
                var pointerBorderData = stream.GetSerializedDataPointer();

                this.BorderData = stream.ReadSerializedData <NavCellBorderData>(pointerBorderData, pointerBorderData.Size / 4);
            }
Exemple #5
0
 public MonsterDef(MpqFileStream stream)
 {
     F0 = stream.ReadValueF32();
     F1 = stream.ReadValueF32();
     F2 = stream.ReadValueF32();
     F3 = stream.ReadValueF32();
     I0 = stream.ReadValueS32();
 }
Exemple #6
0
 public void Read(MpqFileStream stream)
 {
     this.Min            = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
     this.Max            = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
     this.Flags          = (NavCellFlags)stream.ReadValueS16();
     this.NeighbourCount = stream.ReadValueS16();
     this.NeighborsIndex = stream.ReadValueS32();
 }
Exemple #7
0
 public void Read(MpqFileStream stream)
 {
     this.GroupType       = (SpawnGroupType)stream.ReadValueS32();
     this.F0              = stream.ReadValueF32();
     this.F1              = stream.ReadValueF32();
     this.I0              = stream.ReadValueS32();
     this.SpawnItemsCount = stream.ReadValueS32();
     stream.Position     += 12;
     this.SpawnItems      = stream.ReadSerializedData <LevelAreaSpawnItem>();
     this.I2              = stream.ReadValueS32();
     this.I3              = stream.ReadValueS32();
 }
Exemple #8
0
 public DifficultyTuningParams(MpqFileStream stream)
 {
     this.F0 = stream.ReadValueF32();
     this.F1 = stream.ReadValueF32();
     this.F2 = stream.ReadValueF32();
     this.F3 = stream.ReadValueF32();
     this.F4 = stream.ReadValueF32();
     this.F5 = stream.ReadValueF32();
     this.F6 = stream.ReadValueF32();
     this.F7 = stream.ReadValueF32();
     this.F8 = stream.ReadValueF32();
     this.F9 = stream.ReadValueF32();
 }
Exemple #9
0
 public void Read(MpqFileStream stream)
 {
     this.F0          = stream.ReadValueF32();
     this.I1          = stream.ReadValueS32();
     stream.Position += 8;
     SpawnItems       = stream.ReadSerializedData <MonsterMinionSpawnItem>();
 }
Exemple #10
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>();

                if (SquaresCountX < 64 && SquaresCountY < 64)
                {
                    WalkGrid = new byte[64, 64];
                }
                else if (SquaresCountX < 128 && SquaresCountY < 128)
                {
                    WalkGrid = new byte[128, 128]; //96*96
                }
                else if (SquaresCountX > 128 || SquaresCountY > 128)
                {
                    WalkGrid = new byte[256, 256];
                }


                // Loop thru each NavmeshSquare in the array, and fills the grid
                for (int i = 0; i < NavMeshSquareCount; i++)
                {
                    WalkGrid[i % SquaresCountY, i / SquaresCountY] = (byte)(Squares[i].Flags & Scene.NavCellFlags.AllowWalk);
                    // Set the grid to 0x1 if its walkable, left as 0 if not. - DarkLotus
                }

                stream.Position += (3 * 4);
                this.Filename    = stream.ReadString(256, true);
            }
Exemple #11
0
 public void Read(MpqFileStream stream)
 {
     this.GBIdLabel = stream.ReadValueS32();
     Int0           = stream.ReadValueS32();
     Float0         = stream.ReadValueF32();
     Int1           = stream.ReadValueS32();
     Int2           = stream.ReadValueS32();
 }
Exemple #12
0
 public ActorCollisionData(MpqFileStream stream)
 {
     ColFlags = new ActorCollisionFlags(stream);
     I0       = stream.ReadValueS32();
     Cylinder = new AxialCylinder(stream);
     AABB     = new AABB(stream);
     F0       = stream.ReadValueF32();
     stream.ReadValueS32();// Testing - DarkLotus
 }
Exemple #13
0
        public TagMapEntry(MpqFileStream stream)
        {
            this.Type  = stream.ReadValueS32();
            this.TagID = stream.ReadValueS32();

            switch (this.Type)
            {
            case 0:
                this.Int = stream.ReadValueS32();
                break;

            case 1:
                Float = stream.ReadValueF32();
                break;

            case 2:     // SNO
                this.Int = stream.ReadValueS32();
                break;

            // TODO: Create strong type for gbid (at least i think they are)
            case 3:
                this.Int = stream.ReadValueS32();
                break;

            case 4:
                this.ScriptFormula = new ScriptFormula(stream);
                break;

            // TODO: Strong type for group hashes
            case 5:
                this.Int = stream.ReadValueS32();
                break;

            // Todo: Strong type for ... hmmm.. is that a gameattributeindex?
            case 6:
                this.Int = stream.ReadValueS32();
                break;

            // Todo: Strong type fo StartingLocationID
            case 7:
                this.Int = stream.ReadValueS32();
                break;

            default:
                // if this break hits, blizz introduced a new key type and most likey we should have to react to it
                System.Diagnostics.Debugger.Break();
                this.Int = stream.ReadValueS32();
                break;
            }
        }
Exemple #14
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();
     }
     this.I6 = stream.ReadValueS32();
 }
Exemple #15
0
 public void Read(MpqFileStream stream)
 {
     this.F0    = stream.ReadValueF32();
     this.Event = new TriggerEvent(stream);
 }
Exemple #16
0
 public void Read(MpqFileStream stream)
 {
     this.Z     = stream.ReadValueF32();
     this.Flags = (NavCellFlags)stream.ReadValueS32();
 }
Exemple #17
0
 public Float3(MpqFileStream stream)
 {
     X = stream.ReadValueF32();
     Y = stream.ReadValueF32();
     Z = stream.ReadValueF32();
 }
Exemple #18
0
 public Sphere(MpqFileStream stream)
 {
     Position = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
     Radius   = stream.ReadValueF32();
 }
Exemple #19
0
 public AxialCylinder(MpqFileStream stream)
 {
     this.Position = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
     Ax1           = stream.ReadValueF32();
     Ax2           = stream.ReadValueF32();
 }
Exemple #20
0
 /// <summary>
 /// Reads AABB from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public AABB(MpqFileStream stream)
 {
     this.Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
     this.Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
 }
Exemple #21
0
 /// <summary>
 /// Reads Vector3D from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public Vector3D(MpqFileStream stream)
     : this(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32())
 {
 }
Exemple #22
0
        public void Read(MpqFileStream stream)
        {
            this.ActorGroups = new Dictionary <int, FileFormats.ActorGroup>();
            foreach (var group in stream.ReadSerializedData <ActorGroup>()) //166
            {
                this.ActorGroups.Add(group.UHash, group);
            }

            stream.Position      += 8;
            this.ScriptGlobalVars = stream.ReadSerializedData <GlobalScriptVariable>();
            stream.Position      += 8;
            this.TuningParams     = new DifficultyTuningParams[4];
            for (int i = 0; i < 4; i++)
            {
                this.TuningParams[i] = new DifficultyTuningParams(stream);
            }
            this.F0  = stream.ReadValueF32();
            this.F1  = stream.ReadValueF32();
            this.F2  = stream.ReadValueF32();
            this.F3  = stream.ReadValueF32();
            this.F4  = stream.ReadValueF32();
            this.I0  = stream.ReadValueS32();
            this.I1  = stream.ReadValueS32();
            this.F5  = stream.ReadValueF32();
            this.F6  = stream.ReadValueF32();
            this.F7  = stream.ReadValueF32();
            this.F8  = stream.ReadValueF32();
            this.F20 = stream.ReadValueF32();
            this.F21 = stream.ReadValueF32();
            this.F22 = stream.ReadValueF32();
            this.I5  = stream.ReadValueS32();
            this.F23 = stream.ReadValueF32();
            this.I2  = stream.ReadValueS32();
            this.I3  = stream.ReadValueS32();
            this.I4  = stream.ReadValueS32();
            this.F9  = stream.ReadValueF32();
            this.F10 = stream.ReadValueF32();
            this.F11 = stream.ReadValueF32();
            this.F12 = stream.ReadValueF32();
            this.F13 = stream.ReadValueF32();
            this.F14 = stream.ReadValueF32();
            this.F15 = stream.ReadValueF32();
            this.F16 = stream.ReadValueF32();
            this.F17 = stream.ReadValueF32();
            this.F18 = stream.ReadValueF32();
            this.F19 = new float[4];
            for (var i = 0; i < 4; i++)
            {
                this.F19[i] = stream.ReadValueF32();
            }
        }
Exemple #23
0
 public void Read(MpqFileStream stream)
 {
     Center = new Vector2F(stream.ReadValueF32(), stream.ReadValueF32());
     Radius = stream.ReadValueF32();
 }
Exemple #24
0
 public void Read(MpqFileStream stream)
 {
     X = stream.ReadValueF32();
     Y = stream.ReadValueF32();
     Z = stream.ReadValueF32();
 }
Exemple #25
0
 public void Read(MpqFileStream stream)
 {
     this.UHash = stream.ReadValueS32();
     this.S0    = stream.ReadString(32, true);
     this.F0    = stream.ReadValueF32();
 }
Exemple #26
0
 public HealthDropInfo(MpqFileStream stream)
 {
     this.F0   = stream.ReadValueF32();
     this.GBID = stream.ReadValueS32();
     this.I1   = stream.ReadValueS32();
 }
Exemple #27
0
 /// <summary>
 /// Reads Quaternion from given MPQFileStream.
 /// </summary>
 /// <param name="stream">The MPQFileStream to read from.</param>
 public Quaternion(MpqFileStream stream)
 {
     this.Vector3D = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
     this.W        = stream.ReadValueF32();
 }
Exemple #28
0
 public VelocityVector3D(MpqFileStream stream)
 {
     this.VelocityX = stream.ReadValueF32();
     this.VelocityY = stream.ReadValueF32();
     this.VelocityZ = stream.ReadValueF32();
 }
Exemple #29
0
 public void Read(MpqFileStream stream)
 {
     this.I0                    = stream.ReadValueS32();
     this.AnimName              = stream.ReadString(65, true);
     stream.Position           += 3;
     this.Velocity              = stream.ReadValueF32();
     this.F0                    = stream.ReadValueF32();
     this.F1                    = stream.ReadValueF32();
     this.F2                    = stream.ReadValueF32();
     this.F3                    = stream.ReadValueF32();
     this.Time1                 = stream.ReadValueS32();
     this.Time2                 = stream.ReadValueS32();
     this.I1                    = stream.ReadValueS32();
     this.F4                    = stream.ReadValueF32();
     this.F5                    = stream.ReadValueF32();
     this.F6                    = stream.ReadValueF32();
     this.F7                    = stream.ReadValueF32();
     this.BoneNameCount         = stream.ReadValueS32();
     this.BoneNames             = stream.ReadSerializedData <BoneName>();
     stream.Position           += 12;
     this.KeyframePosCount      = stream.ReadValueS32();
     this.TranslationCurves     = stream.ReadSerializedData <TranslationCurve>();
     stream.Position           += 12;
     this.RotationCurves        = stream.ReadSerializedData <RotationCurve>();
     stream.Position           += 8;
     this.ScaleCurves           = stream.ReadSerializedData <ScaleCurve>();
     stream.Position           += 8;
     this.F8                    = stream.ReadValueF32();
     this.F9                    = stream.ReadValueF32();
     this.F10                   = stream.ReadValueF32();
     this.F11                   = stream.ReadValueF32();
     this.V0                    = new Vector3D(stream);
     this.V1                    = new Vector3D(stream);
     this.V2                    = new Vector3D(stream);
     this.V3                    = new Vector3D(stream);
     this.F12                   = stream.ReadValueF32();
     this.KeyedAttachments      = stream.ReadSerializedData <KeyframedAttachment>();
     this.KeyedAttachmentsCount = stream.ReadValueS32();
     stream.Position           += 8;
     this.KeyframePosList       = stream.ReadSerializedData <Vector3D>();
     stream.Position           += 8;
     this.NonlinearOffset       = stream.ReadSerializedData <Vector3D>();
     stream.Position           += 8;
     this.Velocity3D            = new VelocityVector3D(stream);
     this.Link                  = new HardPointLink(stream);
     this.S0                    = stream.ReadString(256, true);
     this.S1                    = stream.ReadString(256, true);
     stream.Position           += 8;
 }
Exemple #30
0
 public void Read(MpqFileStream stream)
 {
     this.I0    = stream.ReadValueS32();
     this.Scale = stream.ReadValueF32();
 }