Esempio n. 1
0
        public Monster(MpqFile file)
        {
            var stream = file.Open();
            this.Header = new Header(stream);
            stream.Position += (1 * 4);
            this.ActorSNO = stream.ReadValueS32();
            stream.Position += 4;
            this.Type = (MonsterType)stream.ReadValueS32();
            this.Race = (MonsterRace)stream.ReadValueS32();
            this.Size = (MonsterSize)stream.ReadValueS32();
            this.Monsterdef = new MonsterDef(stream);
            this.Resists = (Resistance)stream.ReadValueS32();
            this.I0 = stream.ReadValueS32();
            this.I1 = stream.ReadValueS32();
            this.Level.Normal = stream.ReadValueS32();
            this.Level.Nightmare = stream.ReadValueS32();
            this.Level.Hell = stream.ReadValueS32();
            this.Level.Inferno = stream.ReadValueS32();
            Floats = new float[144];
            for (int i = 0; i < 144; i++)
            {
                Floats[i] = stream.ReadValueF32();
            }


            this.I3 = stream.ReadValueS32();
            this.HealthDropinfo0 = new HealthDropInfo(stream);
            this.HealthDropinfo1 = new HealthDropInfo(stream);
            this.HealthDropinfo2 = new HealthDropInfo(stream);
            this.SNOSkillKit = stream.ReadValueS32();
            this.SkillDeclarations = new SkillDeclaration[8];
            for (int i = 0; i < 8; i++)
            {
                this.SkillDeclarations[i] = new SkillDeclaration(stream);
            }
            this.MonsterSkillDeclarations = new MonsterSkillDeclaration[8];
            for (int i = 0; i < 8; i++)
            {
                this.MonsterSkillDeclarations[i] = new MonsterSkillDeclaration(stream);
            }
            this.SNOTreasureClassFirstKill = stream.ReadValueS32();
            this.SNOTreasureClass = stream.ReadValueS32();
            this.SNOTreasureClassRare = stream.ReadValueS32();
            this.SNOTreasureClassChampion = stream.ReadValueS32();
            this.SNOTreasureClassChampionLight = stream.ReadValueS32();
            // at 916 here
            this.F2 = stream.ReadValueF32();
            this.F3 = stream.ReadValueF32();
            this.F4 = stream.ReadValueF32();
            this.F5 = stream.ReadValueF32();
            I4 = stream.ReadValueS32();
            F6 = stream.ReadValueF32();
            I5 = stream.ReadValueS32();
            I6 = stream.ReadValueS32();
            //948
            this.SNOInventory = stream.ReadValueS32();
            this.SNOSecondaryInventory = stream.ReadValueS32();
            this.SNOLore = stream.ReadValueS32();
            AIBehavior = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.AIBehavior[i] = stream.ReadValueS32();
            }
            GbidArray0 = new int[8];
            for (int i = 0; i < 8; i++)
            {
                this.GbidArray0[i] = stream.ReadValueS32();
            }
            this.SNOSummonActor = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.SNOSummonActor[i] = stream.ReadValueS32();
            }
            GbidArray1 = new int[4];
            for (int i = 0; i < 4; i++)
            {
                this.GbidArray1[i] = stream.ReadValueS32();
            }
            GbidArray2 = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.GbidArray2[i] = stream.ReadValueS32();
            }
            this.I7 = stream.ReadValueS32();
            this.I8 = stream.ReadValueS32();
            this.I9 = stream.ReadValueS32();
            this.PowerType = (MonsterPowerType)stream.ReadValueS32();

            stream.Position += (6*4);
            this.TagMap = stream.ReadSerializedItem<TagMap>();
            stream.Position += (2 * 4);
            this.I10 = stream.ReadValueS32();
            stream.Position += (3 * 4);
            this.MonsterMinionSpawngroup = stream.ReadSerializedItem<MonsterMinionSpawnGroup>();
            Name = stream.ReadString(128, true);         
            stream.Close();
        }
Esempio n. 2
0
        public Monster(MpqFile file)
        {
            var stream = file.Open();
            this.Header = new Header(stream);

            this.I0 = stream.ReadValueS32();
            this.ActorSNO = stream.ReadValueS32();
            this.I2 = stream.ReadValueS32();
            this.Type = (MonsterType)stream.ReadValueS32();
            this.Race = (MonsterRace)stream.ReadValueS32();
            this.Size = (MonsterSize)stream.ReadValueS32();
            this.Monsterdef = new MonsterDef(stream);
            this.Resists = (Resistance)stream.ReadValueS32();
            this.I2 = stream.ReadValueS32();
            this.I3 = stream.ReadValueS32();
            this.Level.Normal = stream.ReadValueS32();
            this.Level.Nightmare = stream.ReadValueS32();
            this.Level.Hell = stream.ReadValueS32();
            this.Level.Inferno = stream.ReadValueS32();
            // 84 - last 6 of these floats are not in the array actually.
            Floats = new float[138];
            for (int i = 0; i < 138; i++)
            {
                Floats[i] = stream.ReadValueF32();
            }
            F0 = stream.ReadValueF32();
            F1 = stream.ReadValueF32();
            F2 = stream.ReadValueF32();
            F3 = stream.ReadValueF32();
            F4 = stream.ReadValueF32();
            F5 = stream.ReadValueF32();

            // 660
            this.I4 = stream.ReadValueS32();
            this.HealthDropinfo0 = new HealthDropInfo(stream);
            this.HealthDropinfo1 = new HealthDropInfo(stream);
            this.HealthDropinfo2 = new HealthDropInfo(stream);
            this.HealthDropinfo3 = new HealthDropInfo(stream);
            // 712
            this.SNOSkillKit = stream.ReadValueS32();
            this.SkillDeclarations = new SkillDeclaration[8];
            for (int i = 0; i < 8; i++)
            {
                this.SkillDeclarations[i] = new SkillDeclaration(stream);
            }
            this.MonsterSkillDeclarations = new MonsterSkillDeclaration[8];
            for (int i = 0; i < 8; i++)
            {
                this.MonsterSkillDeclarations[i] = new MonsterSkillDeclaration(stream);
            }
            // 908
            this.SNOTreasureClassFirstKill = stream.ReadValueS32();
            this.SNOTreasureClass = stream.ReadValueS32();
            this.SNOTreasureClassRare = stream.ReadValueS32();
            this.SNOTreasureClassChampion = stream.ReadValueS32();
            this.SNOTreasureClassChampionLight = stream.ReadValueS32();
            // 928
            this.F6 = stream.ReadValueF32();
            this.F7 = stream.ReadValueF32();
            this.F8 = stream.ReadValueF32();
            this.F9 = stream.ReadValueF32();
            I5 = stream.ReadValueS32();
            F10 = stream.ReadValueF32();
            I6 = stream.ReadValueS32();
            I7 = stream.ReadValueS32();
            //960
            this.SNOInventory = stream.ReadValueS32();
            this.SNOSecondaryInventory = stream.ReadValueS32();
            this.SNOLore = stream.ReadValueS32();
            AIBehavior = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.AIBehavior[i] = stream.ReadValueS32();
            }
            GbidArray0 = new int[8];
            for (int i = 0; i < 8; i++)
            {
                this.GbidArray0[i] = stream.ReadValueS32();
            }
            this.SNOSummonActor = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.SNOSummonActor[i] = stream.ReadValueS32();
            }
            GbidArray1 = new int[4];
            for (int i = 0; i < 4; i++)
            {
                this.GbidArray1[i] = stream.ReadValueS32();
            }
            GbidArray2 = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.GbidArray2[i] = stream.ReadValueS32();
            }
            // 1092
            this.I8 = stream.ReadValueS32();
            this.I9 = stream.ReadValueS32();
            this.I10 = stream.ReadValueS32();
            this.PowerType = (MonsterPowerType)stream.ReadValueS32();

            stream.Position += (7 * 4);
            // 1136
            this.TagMap = stream.ReadSerializedItem<TagMap>();
            stream.Position += (2 * 4);
            this.I11 = stream.ReadValueS32();
            stream.Position += (3 * 4);
            this.MonsterMinionSpawngroup = stream.ReadSerializedItem<MonsterMinionSpawnGroup>();
            this.Name = stream.ReadString(128, true);
            stream.Close();
        }
Esempio n. 3
0
        public Monster(MpqFile file)
        {
            var stream = file.Open();

            this.Header = new Header(stream);

            this.I0              = stream.ReadValueS32();
            this.ActorSNO        = stream.ReadValueS32();
            this.I2              = stream.ReadValueS32();
            this.Type            = (MonsterType)stream.ReadValueS32();
            this.Race            = (MonsterRace)stream.ReadValueS32();
            this.Size            = (MonsterSize)stream.ReadValueS32();
            this.Monsterdef      = new MonsterDef(stream);
            this.Resists         = (Resistance)stream.ReadValueS32();
            this.I2              = stream.ReadValueS32();
            this.I3              = stream.ReadValueS32();
            this.Level.Normal    = stream.ReadValueS32();
            this.Level.Nightmare = stream.ReadValueS32();
            this.Level.Hell      = stream.ReadValueS32();
            this.Level.Inferno   = stream.ReadValueS32();
            // 84 - last 6 of these floats are not in the array actually.
            Floats = new float[138];
            for (int i = 0; i < 138; i++)
            {
                Floats[i] = stream.ReadValueF32();
            }
            F0 = stream.ReadValueF32();
            F1 = stream.ReadValueF32();
            F2 = stream.ReadValueF32();
            F3 = stream.ReadValueF32();
            F4 = stream.ReadValueF32();
            F5 = stream.ReadValueF32();

            // 660
            this.I4 = stream.ReadValueS32();
            this.HealthDropinfo0 = new HealthDropInfo(stream);
            this.HealthDropinfo1 = new HealthDropInfo(stream);
            this.HealthDropinfo2 = new HealthDropInfo(stream);
            this.HealthDropinfo3 = new HealthDropInfo(stream);
            // 712
            this.SNOSkillKit       = stream.ReadValueS32();
            this.SkillDeclarations = new SkillDeclaration[8];
            for (int i = 0; i < 8; i++)
            {
                this.SkillDeclarations[i] = new SkillDeclaration(stream);
            }
            this.MonsterSkillDeclarations = new MonsterSkillDeclaration[8];
            for (int i = 0; i < 8; i++)
            {
                this.MonsterSkillDeclarations[i] = new MonsterSkillDeclaration(stream);
            }
            // 908
            this.SNOTreasureClassFirstKill     = stream.ReadValueS32();
            this.SNOTreasureClass              = stream.ReadValueS32();
            this.SNOTreasureClassRare          = stream.ReadValueS32();
            this.SNOTreasureClassChampion      = stream.ReadValueS32();
            this.SNOTreasureClassChampionLight = stream.ReadValueS32();
            // 928
            this.F6 = stream.ReadValueF32();
            this.F7 = stream.ReadValueF32();
            this.F8 = stream.ReadValueF32();
            this.F9 = stream.ReadValueF32();
            I5      = stream.ReadValueS32();
            F10     = stream.ReadValueF32();
            I6      = stream.ReadValueS32();
            I7      = stream.ReadValueS32();
            //960
            this.SNOInventory          = stream.ReadValueS32();
            this.SNOSecondaryInventory = stream.ReadValueS32();
            this.SNOLore = stream.ReadValueS32();
            AIBehavior   = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.AIBehavior[i] = stream.ReadValueS32();
            }
            GbidArray0 = new int[8];
            for (int i = 0; i < 8; i++)
            {
                this.GbidArray0[i] = stream.ReadValueS32();
            }
            this.SNOSummonActor = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.SNOSummonActor[i] = stream.ReadValueS32();
            }
            GbidArray1 = new int[4];
            for (int i = 0; i < 4; i++)
            {
                this.GbidArray1[i] = stream.ReadValueS32();
            }
            GbidArray2 = new int[6];
            for (int i = 0; i < 6; i++)
            {
                this.GbidArray2[i] = stream.ReadValueS32();
            }
            // 1092
            this.I8        = stream.ReadValueS32();
            this.I9        = stream.ReadValueS32();
            this.I10       = stream.ReadValueS32();
            this.PowerType = (MonsterPowerType)stream.ReadValueS32();

            stream.Position += (7 * 4);
            // 1136
            this.TagMap      = stream.ReadSerializedItem <TagMap>();
            stream.Position += (2 * 4);
            this.I11         = stream.ReadValueS32();
            stream.Position += (3 * 4);
            this.MonsterMinionSpawngroup = stream.ReadSerializedItem <MonsterMinionSpawnGroup>();
            this.Name = stream.ReadString(128, true);
            stream.Close();
        }