コード例 #1
0
        public override void Unserialize(BinaryReader br, UInt32 mapVersion)
        {
            ReadTriggerEvents(br, mapVersion);

            Location        = Vector4.Read(br);
            Quaternion      = Vector4.Read(br);
            Radius          = br.ReadSingle();
            RespawnTime     = br.ReadSingle();
            ActivationRange = br.ReadSingle();

            UseGenerator   = br.ReadBoolean();
            HasChampion    = br.ReadBoolean();
            ChampionChance = br.ReadByte();
            SpawnChance    = br.ReadByte();
            var j = br.ReadByte();

            if (mapVersion >= 31)
            {
                RandomlyOffsetSpawnPosition = br.ReadByte();
            }

            if (mapVersion >= 29)
            {
                for (var i = 0; i < 12; ++i)
                {
                    SpawnLists.Add(SpawnList.Read(br));
                }
            }
            else // UNREACHABLE CODE
            {
                Debug.Assert(false, "Unreachable code reached!");
            }

            Loot                  = br.ReadInt32();
            LootPercent           = br.ReadSingle();
            MapPathCOID           = br.ReadUInt64();
            InitialPatrolDistance = br.ReadSingle();

            if (mapVersion >= 15)
            {
                FactionDirty    = br.ReadBoolean();
                OriginalFaction = br.ReadUInt32();
            }

            if (mapVersion >= 24)
            {
                LootChance = br.ReadSingle();
            }

            if (mapVersion >= 32)
            {
                var str = br.ReadLengthedString();
            }
        }
コード例 #2
0
        public static SpawnList Read(BinaryReader br)
        {
            var sl = new SpawnList {
                LowerNumberOfSpawns = br.ReadByte(), UpperNumberOfSpawns = br.ReadByte()
            };

            br.ReadBytes(2);

            sl.SpawnType   = br.ReadInt32();
            sl.LevelOffset = br.ReadByte();
            sl.IsTemplate  = br.ReadBoolean();

            br.ReadBytes(2);

            return(sl);
        }