Exemplo n.º 1
0
		static Clilocs()
		{
			CSOptions = new CoreServiceOptions(typeof(Clilocs));

			Tables = new Dictionary<ClilocLNG, ClilocTable>
			{
				{ClilocLNG.ENU, new ClilocTable()},
				{ClilocLNG.DEU, new ClilocTable()},
				{ClilocLNG.ESP, new ClilocTable()},
				{ClilocLNG.FRA, new ClilocTable()},
				{ClilocLNG.JPN, new ClilocTable()},
				{ClilocLNG.KOR, new ClilocTable()},
				{ClilocLNG.CHT, new ClilocTable()}
			};
		}
Exemplo n.º 2
0
        static Clilocs()
        {
            CSOptions = new CoreServiceOptions(typeof(Clilocs));

            Tables = new Dictionary <ClilocLNG, ClilocTable>
            {
                { ClilocLNG.ENU, new ClilocTable() },
                { ClilocLNG.DEU, new ClilocTable() },
                { ClilocLNG.ESP, new ClilocTable() },
                { ClilocLNG.FRA, new ClilocTable() },
                { ClilocLNG.JPN, new ClilocTable() },
                { ClilocLNG.KOR, new ClilocTable() },
                { ClilocLNG.CHT, new ClilocTable() }
            };
        }
Exemplo n.º 3
0
		static ArtworkSupport()
		{
			CSOptions = new CoreServiceOptions(typeof(ArtworkSupport));

			Info = new Dictionary<Type, List<ArtworkInfo>>();

			LandTextures = new short[TileData.MaxLandValue];
			LandTextures.SetAll((short)-1);

			StaticAnimations = new short[TileData.MaxItemValue];
			StaticAnimations.SetAll((short)-1);

			string filePath = Core.FindDataFile("tiledata.mul");

			if (String.IsNullOrWhiteSpace(filePath))
			{
				return;
			}

			var file = new FileInfo(filePath);

			if (!file.Exists)
			{
				return;
			}

			using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
			{
				var bin = new BinaryReader(fs);
				var buffer = new byte[25];

				if (fs.Length == 3188736)
				{
					// 7.0.9.0
					LandTextures = new short[0x4000];

					for (int i = 0; i < 0x4000; ++i)
					{
						if (i == 1 || (i > 0 && (i & 0x1F) == 0))
						{
							bin.Read(buffer, 0, 4);
						}

						bin.Read(buffer, 0, 8);

						short texture = bin.ReadInt16();

						bin.Read(buffer, 0, 20);

						LandTextures[i] = texture;
					}

					StaticAnimations = new short[0x10000];

					for (int i = 0; i < 0x10000; ++i)
					{
						if ((i & 0x1F) == 0)
						{
							bin.Read(buffer, 0, 4);
						}

						bin.Read(buffer, 0, 14);

						short anim = bin.ReadInt16();

						bin.Read(buffer, 0, 25);

						StaticAnimations[i] = anim;
					}
				}
				else
				{
					LandTextures = new short[0x4000];

					for (int i = 0; i < 0x4000; ++i)
					{
						if ((i & 0x1F) == 0)
						{
							bin.Read(buffer, 0, 4);
						}

						bin.Read(buffer, 0, 4);

						short texture = bin.ReadInt16();

						bin.Read(buffer, 0, 20);

						LandTextures[i] = texture;
					}

					if (fs.Length == 1644544)
					{
						// 7.0.0.0
						StaticAnimations = new short[0x8000];

						for (int i = 0; i < 0x8000; ++i)
						{
							if ((i & 0x1F) == 0)
							{
								bin.Read(buffer, 0, 4);
							}

							bin.Read(buffer, 0, 10);

							short anim = bin.ReadInt16();

							bin.Read(buffer, 0, 25);

							StaticAnimations[i] = anim;
						}
					}
					else
					{
						StaticAnimations = new short[0x4000];

						for (int i = 0; i < 0x4000; ++i)
						{
							if ((i & 0x1F) == 0)
							{
								bin.Read(buffer, 0, 4);
							}

							bin.Read(buffer, 0, 10);

							short anim = bin.ReadInt16();

							bin.Read(buffer, 0, 25);

							StaticAnimations[i] = anim;
						}
					}
				}
			}
		}
Exemplo n.º 4
0
        static ArtworkSupport()
        {
            CSOptions = new CoreServiceOptions(typeof(ArtworkSupport));

            Info = new Dictionary <Type, List <ArtworkInfo> >();

            LandTextures = new short[TileData.MaxLandValue];
            LandTextures.SetAll((short)-1);

            StaticAnimations = new short[TileData.MaxItemValue];
            StaticAnimations.SetAll((short)-1);

            string filePath = Core.FindDataFile("tiledata.mul");

            if (String.IsNullOrWhiteSpace(filePath))
            {
                return;
            }

            var file = new FileInfo(filePath);

            if (!file.Exists)
            {
                return;
            }

            using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                var bin    = new BinaryReader(fs);
                var buffer = new byte[25];

                if (fs.Length == 3188736)
                {
                    // 7.0.9.0
                    LandTextures = new short[0x4000];

                    for (int i = 0; i < 0x4000; ++i)
                    {
                        if (i == 1 || (i > 0 && (i & 0x1F) == 0))
                        {
                            bin.Read(buffer, 0, 4);
                        }

                        bin.Read(buffer, 0, 8);

                        short texture = bin.ReadInt16();

                        bin.Read(buffer, 0, 20);

                        LandTextures[i] = texture;
                    }

                    StaticAnimations = new short[0x10000];

                    for (int i = 0; i < 0x10000; ++i)
                    {
                        if ((i & 0x1F) == 0)
                        {
                            bin.Read(buffer, 0, 4);
                        }

                        bin.Read(buffer, 0, 14);

                        short anim = bin.ReadInt16();

                        bin.Read(buffer, 0, 25);

                        StaticAnimations[i] = anim;
                    }
                }
                else
                {
                    LandTextures = new short[0x4000];

                    for (int i = 0; i < 0x4000; ++i)
                    {
                        if ((i & 0x1F) == 0)
                        {
                            bin.Read(buffer, 0, 4);
                        }

                        bin.Read(buffer, 0, 4);

                        short texture = bin.ReadInt16();

                        bin.Read(buffer, 0, 20);

                        LandTextures[i] = texture;
                    }

                    if (fs.Length == 1644544)
                    {
                        // 7.0.0.0
                        StaticAnimations = new short[0x8000];

                        for (int i = 0; i < 0x8000; ++i)
                        {
                            if ((i & 0x1F) == 0)
                            {
                                bin.Read(buffer, 0, 4);
                            }

                            bin.Read(buffer, 0, 10);

                            short anim = bin.ReadInt16();

                            bin.Read(buffer, 0, 25);

                            StaticAnimations[i] = anim;
                        }
                    }
                    else
                    {
                        StaticAnimations = new short[0x4000];

                        for (int i = 0; i < 0x4000; ++i)
                        {
                            if ((i & 0x1F) == 0)
                            {
                                bin.Read(buffer, 0, 4);
                            }

                            bin.Read(buffer, 0, 10);

                            short anim = bin.ReadInt16();

                            bin.Read(buffer, 0, 25);

                            StaticAnimations[i] = anim;
                        }
                    }
                }
            }
        }