Esempio n. 1
0
        public void ReadFromFile(BinaryReader reader)
        {
            unk0 = reader.ReadUInt32();
            uint count0 = reader.ReadUInt32();
            uint count1 = reader.ReadUInt32();

            unk1 = reader.ReadUInt32();

            missions = new MissionItem[count0];

            for (int i = 0; i < count1; i++)
            {
                MissionItem item = new MissionItem();
                item.ID.ReadFromFile(reader);
                item.TextID.ReadFromFile(reader);
                item.DescriptionID.ReadFromFile(reader);
                item.IconID    = reader.ReadUInt32();
                item.CityID    = reader.ReadUInt32();
                item.Type      = (EMissionType)reader.ReadUInt32();
                item.MissionID = XBinCoreUtils.ReadStringPtrWithOffset(reader);

                // Only read checkpoint file if we are running M1: DE...
                if (gameVersion == GamesEnumerator.MafiaI_DE)
                {
                    item.CheckPointFile = XBinCoreUtils.ReadStringPtrWithOffset(reader);
                    item.Unknown        = reader.ReadUInt32();
                }

                missions[i] = item;
            }
        }
Esempio n. 2
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. 3
0
        public void SetFromTreeNodes(TreeNode Root)
        {
            Missions = new MissionItem[Root.Nodes.Count];

            for (int i = 0; i < Missions.Length; i++)
            {
                TreeNode    ChildNode = Root.Nodes[i];
                MissionItem Entry     = (MissionItem)ChildNode.Tag;
                Missions[i] = Entry;
            }
        }
Esempio n. 4
0
        public void ReadFromFile(BinaryReader reader)
        {
            unk0 = reader.ReadUInt32();
            uint count0 = reader.ReadUInt32();
            uint count1 = reader.ReadUInt32();

            missions = new MissionItem[count0];

            for (int i = 0; i < count1; i++)
            {
                MissionItem item = new MissionItem();
                item.ID             = reader.ReadUInt64();
                item.TextID         = reader.ReadUInt64();
                item.DescriptionID  = reader.ReadUInt64();
                item.IconID         = reader.ReadUInt32();
                item.CityID         = reader.ReadUInt32();
                item.Type           = (EMissionType)reader.ReadUInt32();
                item.Unknown        = reader.ReadUInt32();
                item.MissionID      = XBinCoreUtils.ReadStringPtrWithOffset(reader);
                item.CheckPointFile = XBinCoreUtils.ReadStringPtrWithOffset(reader);
                missions[i]         = item;
            }
        }
Esempio n. 5
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();
        }