Esempio n. 1
0
        public void WriteToFile(XBinWriter writer)
        {
            writer.Write(unk0);
            writer.Write(missions.Length);
            writer.Write(missions.Length);
            writer.Write(unk1);

            foreach (var slot in missions)
            {
                MissionItem Item = slot;
                Item.ID.WriteToFile(writer);
                Item.TextID.WriteToFile(writer);
                Item.DescriptionID.WriteToFile(writer);
                writer.Write(Item.IconID);
                writer.Write(Item.CityID);
                writer.Write((int)Item.Type);
                writer.PushStringPtr(Item.MissionID);

                if (gameVersion == GamesEnumerator.MafiaI_DE)
                {
                    writer.PushStringPtr(Item.CheckPointFile);
                    writer.Write(Item.Unknown);
                }
            }

            writer.Write(0); // padding?
            writer.FixUpStringPtrs();
        }
Esempio n. 2
0
        public void WriteToFile(XBinWriter writer)
        {
            writer.Write(unk0);
            writer.Write(Lines.Length);
            writer.Write(Lines.Length);

            for (int i = 0; i < Lines.Length; i++)
            {
                StreamMapLine Line = Lines[i];
                writer.Write((uint)Line.LineType);
                writer.PushStringPtr(Line.GameID);
                writer.PushStringPtr(Line.MissionID);
                writer.PushStringPtr(Line.PartID);
                writer.PushObjectPtr(string.Format("TableOffset_{0}", i));
                writer.Write(Line.TableCommands.Length); // This file stores it twice.
                writer.Write(Line.TableCommands.Length);
                writer.Write(Line.IsAsync);
            }

            for (int i = 0; i < Lines.Length; i++)
            {
                StreamMapLine Line = Lines[i];

                writer.FixUpObjectPtr(string.Format("TableOffset_{0}", i));

                for (int x = 0; x < Line.TableCommands.Length; x++)
                {
                    writer.PushObjectPtr(string.Format("TableCommandsOffset_{0}", x));
                    writer.Write(Line.TableCommands[x].GetMagic());
                }

                for (int x = 0; x < Line.TableCommands.Length; x++)
                {
                    writer.FixUpObjectPtr(string.Format("TableCommandsOffset_{0}", x));
                    Line.TableCommands[x].WriteToFile(writer);
                }
            }

            writer.FixUpStringPtrs();
        }
Esempio n. 3
0
        public void WriteToFile(XBinWriter writer)
        {
            writer.Write(unk0);
            writer.Write(missions.Length);
            writer.Write(missions.Length);

            foreach (var slot in missions)
            {
                MissionItem Item = slot;
                writer.Write(Item.ID);
                writer.Write(Item.TextID);
                writer.Write(Item.DescriptionID);
                writer.Write(Item.IconID);
                writer.Write(Item.CityID);
                writer.Write((int)Item.Type);
                writer.Write(Item.Unknown);
                writer.PushStringPtr(Item.MissionID);
                writer.PushStringPtr(Item.CheckPointFile);
            }

            writer.Write(0); // padding?
            writer.FixUpStringPtrs();
        }
Esempio n. 4
0
        public void WriteToFile(XBinWriter writer)
        {
            writer.Write(unk0);
            writer.Write(cities.Length);
            writer.Write(cities.Length);
            writer.Write(unk1);

            foreach (var Item in cities)
            {
                writer.PushObjectPtr(string.Format("RespawnPlace_{0}", Item.ID));
                writer.Write(Item.RespawnPlaces.Length);
                writer.Write(Item.RespawnPlaces.Length);
                writer.PushObjectPtr(string.Format("CityArea_{0}", Item.ID));

                writer.Write(Item.ID);
                writer.PushStringPtr(Item.Name);
                writer.PushStringPtr(Item.MissionLine);
                writer.PushStringPtr(Item.SDSPrefix);
                Item.TextID.WriteToFile(writer);
                Item.CarGarageType.WriteToFile(writer);
                Item.BoatGarageType.WriteToFile(writer);

                if (gameVersion == GamesEnumerator.MafiaI_DE)
                {
                    writer.PushStringPtr(Item.Unk01);
                }

                writer.PushStringPtr(Item.Map);

                // Content doesn't exist in M1DE.. Unused?
                if (gameVersion == GamesEnumerator.MafiaIII)
                {
                    writer.Write(0);
                }
            }

            foreach (var Item in Cities)
            {
                writer.FixUpObjectPtr(string.Format("RespawnPlace_{0}", Item.ID));
                foreach (var Respawn in Item.RespawnPlaces)
                {
                    Respawn.PosPlayer.WriteToFile(writer);
                    Respawn.DirPlayer.WriteToFile(writer);
                    writer.Write((int)Respawn.RespawnType);
                    writer.PushStringPtr(Respawn.StreamMapPart);
                }

                writer.FixUpObjectPtr(string.Format("CityArea_{0}", Item.ID));

                writer.PushObjectPtr("CityPointOffset");
                writer.Write(Item.Points.Length);
                writer.Write(Item.Points.Length);
                writer.PushObjectPtr("CityPolygonOffset");
                writer.Write(Item.Polygons.Length);
                writer.Write(Item.Polygons.Length);

                writer.FixUpObjectPtr("CityPointOffset");

                foreach (var Entry in Item.Points)
                {
                    Entry.WriteToFile(writer);
                }

                writer.FixUpObjectPtr("CityPolygonOffset");

                foreach (var Entry in Item.Polygons)
                {
                    writer.PushObjectPtr("PolygonIndexOffset");
                    writer.Write(Entry.Indexes.Length);
                    writer.Write(Entry.Indexes.Length);

                    writer.PushStringPtr(Entry.Name);
                    Entry.TextID.WriteToFile(writer);
                    writer.Write(Entry.Unk0);

                    writer.FixUpObjectPtr("PolygonIndexOffset");
                    foreach (var Index in Entry.Indexes)
                    {
                        writer.Write(Index);
                    }
                }
            }

            writer.FixUpStringPtrs();
        }