Beispiel #1
0
        public void RepackBtlPack()
        {
            //var OldFps4 = new FPS4(OldStream.Slice());
            //var NewFps4 = new FPS4(OldStream.Slice()); // Intended OldStream

            Patcher.Action("Packing BTL_PACK_ES.DAT", () =>
            {
                Patcher.TempFS.OpenFileReadScope("BTL_PACK_UK.DAT", (OldStream) =>
                {
                    Patcher.TempFS.OpenFileCreateScope("BTL_PACK_ES.DAT", (NewStream) =>
                    {
                        var OldFps4 = new FPS4(OldStream.Slice());
                        var NewFps4 = new FPS4(OldStream.Slice());                         // Intended OldStream

                        NewFps4.ClearAllEntries();

                        for (int n = 0; n <= 19; n++)
                        {
                            NewFps4.CreateEntry(String.Format("{0}", n), Patcher.TempFS.OpenFileRead(String.Format("BTL_PACK/{0}", n)));
                        }

                        NewFps4.SaveTo(NewStream, DoAlign: false);
                    });
                });
            });
        }
Beispiel #2
0
        public void HandleBattlePackImagesCommon()
        {
            Patcher.Action("Battle Common", () =>
            {
                Patcher.GameAccessPath("2", () =>
                {
                    Patcher.Action("Level Up", () =>
                    {
                        Patcher.GameAccessPath("E_A018", () =>
                        {
                            Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A018_LVUP_00, "E_A018_LVUP_00"); });
                        });
                    });

                    Patcher.Action("New Skill", () =>
                    {
                        Patcher.GameAccessPath("E_A019", () =>
                        {
                            Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A019_NEW_00, "E_A019_NEW_00"); });
                        });
                    });

                    Patcher.Action("New Arte", () =>
                    {
                        Patcher.GameAccessPath("E_A024", () =>
                        {
                            Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A024_LEARNING_00, "E_A024_LEARNING_00"); });
                            Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithEmpty(Txm, "E_A024_LEARNING_00_F", "E_A024_LEARNING_00_G"); });
                        });
                    });

                    Patcher.Action("Secret Mission Completed!", () =>
                    {
                        Patcher.GameAccessPath("E_A027", () =>
                        {
                            Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A027_MISSION_00, "E_A027_MISSION_00"); });
                        });
                    });

                    Patcher.Action("New Title", () =>
                    {
                        Patcher.GameAccessPath("E_A062", () =>
                        {
                            Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A062_TITLE_00, "E_A062_TITLE_00"); });
                            Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithEmpty(Txm, "E_A062_TITLE_00_F", "E_A062_TITLE_00_G"); });
                        });
                    });
                });
            });
        }
Beispiel #3
0
        public void Handle()
        {
            Patcher.Action("chat.svo", () =>
            {
                TranslatedChatSvo = new FPS4(Patcher.GameFileSystem.OpenFileRead("chat.svo")).ClearAllEntries();
                OriginalChatSvo   = new FPS4(Patcher.GameFileSystem.OpenFileRead("chat.svo"));

                Patcher.ProgressHandler.ExecuteActionsWithProgressTracking("chat.svo",
                                                                           Handle1,
                                                                           Handle2,
                                                                           Handle3
                                                                           );
            });
        }
Beispiel #4
0
        private void Handle3()
        {
            Patcher.ProgressHandler.AddProgressLevel("Actualizando chat.svo", 1, () =>
            {
                Patcher.Action("Updating chat.svo...", () =>
                {
                    Patcher.GameFileSystem.ReplaceFileWithStream("chat.svo", Patcher.TempFS.OpenFileRead("chat.es.svo"), (Current, Total) =>
                    {
                        Patcher.ProgressHandler.SetLevelProgressTo(Current, Total);
                    });
                });
            });
#if false
            //Patcher.TempFS.OpenFileRead("chat.es.svo").CopyTo(Patcher.GameFileSystem.OpenFileRW("chat.svo"));

            //Patcher.TempFS.WriteAllBytes("VC001US.DAT", TalesCompression.DecompressStream(ChatSvo["VC001US.DAT"].Open()).ReadAll());
            Patcher.GameAccessPath("chat.svo", () =>
            {
                var ChatId = "VC001";
                //Patcher.GameGetFile(ChatId + "US.DAT", (File) => { });

                Patcher.GameAccessPath(ChatId + "US.DAT", () =>
                {
                    Patcher.GameGetFile("3", (ChtxStream) =>
                    {
                        var Chtx = new TO8CHTX();
                        Chtx.Load(ChtxStream);
                        // Translate
                        {
                            foreach (var Entry in Patcher.EntriesByRoom["skits/" + ChatId])
                            {
                                int TextId = int.Parse(Entry.text_id) - 1;
                                if (TextId >= 0)
                                {
                                    Chtx[TextId].Title          = Entry.texts.es[0].TrimEnd(' ', '\t', '\n', '\r', '.');
                                    Chtx[TextId].TextOriginal   = "";
                                    Chtx[TextId].TextTranslated = Entry.texts.es[1];
                                }
                            }
                        }
                        //ChtxStream.SetLength(0);
                        ChtxStream.Position = 0;
                        Chtx.Save(ChtxStream);
                    });
                    //Console.WriteLine("Done");
                });
            });
#endif
        }
Beispiel #5
0
        private void Handle2()
        {
            Patcher.Action("Building Spanish chat.svo...", () =>
            {
                if (!Patcher.TempFS.Exists("chat.es.svo"))
                {
                    foreach (var ChatSvoEntry in OriginalChatSvo)
                    {
                        var VcMatch = ChatSvoEntry.Name.RegexMatch(@"^(VC\d+B?)(\w{2})\.DAT$");
                        if (VcMatch != null)
                        {
                            if (VcMatch[2].Value == "UK")
                            {
                                var EsEntry = TranslatedChatSvo.CreateEntry(VcMatch[1] + "DE.DAT", Patcher.TempFS.OpenFile(PreppendTempFile + VcMatch[1].Value + "ES.DAT", FileMode.Open));
                                foreach (var Ext in new[] { "FR", "UK", "US" })
                                {
                                    var FileName = VcMatch[1] + Ext + ".DAT";
                                    if (OriginalChatSvo.Entries.ContainsKey(FileName))
                                    {
                                        TranslatedChatSvo.CreateEntry(FileName, EsEntry);
                                    }
                                }
                            }
                            else
                            {
                                if (!OriginalChatSvo.Entries.ContainsKey(VcMatch[1] + "UK.DAT"))
                                {
                                    TranslatedChatSvo.CreateEntry(ChatSvoEntry.Name, ChatSvoEntry.Open());
                                }
                            }
                        }
                        else
                        {
                            TranslatedChatSvo.CreateEntry(ChatSvoEntry.Name, ChatSvoEntry.Open());
                        }
                    }

                    using (var EsSvoStream = Patcher.TempFS.OpenFile("chat.es.svo", FileMode.Create))
                    {
                        TranslatedChatSvo.SaveTo(EsSvoStream, true);
                    }
                }
            });
        }
Beispiel #6
0
        public void HandleBattlePackDialogs(Stream OldStream, Stream NewStream)
        {
            FPS4 OldFps4;
            FPS4 NewFps4;

            OldFps4 = new FPS4(OldStream.Slice());
            NewFps4 = new FPS4(OldStream.Slice()); // Intended OldStream

            var TranslatedFiles = new ConcurrentDictionary <string, MemoryStream>();

            var Names = new[]
            {
                "BTL_EP_0070_010", "BTL_EP_030_040", "BTL_EP_030_080", "BTL_EP_0950_010",
                "BTL_EP_0960_020", "BTL_EP_1040_020", "BTL_EP_150_170", "BTL_EP_170_050",
                "BTL_EP_210_090", "BTL_EP_270_110", "BTL_EP_270_110_1", "BTL_EP_340_070",
                "BTL_EP_370_050", "BTL_EP_420_080", "BTL_EP_440_040", "BTL_EP_470_030",
                "BTL_EP_490_060_0", "BTL_EP_490_060_1", "BTL_EP_510_050", "BTL_EP_510_080",
                "BTL_EP_640_050", "BTL_EP_650_030", "BTL_EP_650_050", "BTL_LL_MONSTER",
                "MA_VAL_A_05",
            };

            Patcher.Action("Translating Battle Scripts", () =>
            {
                Patcher.ProgressHandler.AddProgressLevel("Traduciendo scripts de batalla...", Names.Length, () =>
                {
                    Patcher.ParallelForeach("Translating", Names, (Name) => Name, (Name) =>
                    {
                        using (var CompressedTssStream = OldFps4[Name].Open())
                        {
                            using (var TssStream = TalesCompression.DecompressStream(CompressedTssStream))
                            {
                                var TssName = Name;
                                var Tss     = new TSS().Load(TssStream);
                                Tss.TranslateTexts((Entry) =>
                                {
                                    //if (Entry == null) return;
                                    var TranslationEntry = Patcher.EntriesByRoom["battle/" + TssName][String.Format("{0:X8}", Entry.Id2)];

                                    int TextCount = Entry.Original.Length;

                                    Entry.TranslateWithTranslationEntry(TranslationEntry);

                                    //Console.WriteLine("{0} : {1}", Entry.Translated[1], TranslationEntry.texts.es[1]);
                                }, (String) =>
                                {
                                    return(null);
                                });

                                var TranslatedCompressedStream = TalesCompression.CreateFromVersion(Patcher.CompressionVersion, Patcher.CompressionFallback).EncodeFile(Tss.Save());

                                TranslatedFiles[Name] = TranslatedCompressedStream;
                            }
                        }
                        Patcher.ProgressHandler.IncrementLevelProgress();
                    });
                });
            });

            Patcher.Action("Reconstructing Battle Scripts Package", () =>
            {
                NewFps4.ClearAllEntries();
                foreach (var Entry in OldFps4.Entries.Values)
                {
                    var EntryName = Entry.Name;
                    if (TranslatedFiles.ContainsKey(EntryName))
                    {
                        NewFps4.CreateEntry(EntryName, TranslatedFiles[EntryName]);
                    }
                    else
                    {
                        NewFps4.CreateEntry(EntryName, Entry.Open());
                    }
                }

                NewFps4.SaveTo(NewStream, DoAlign: false);
            });
        }
Beispiel #7
0
        private void Handle1()
        {
            Patcher.ProgressHandler.AddProgressLevel("chara.svo", 3, () =>
            {
                Patcher.GameAccessPath("chara.svo", () =>
                {
                    Patcher.GameAccessPath("BTL_COMMON.DAT", () =>
                    {
                        (new BtlSvo(Patcher)).HandleBattlePackImagesCommon();
                    });

                    Patcher.Action("Title Menu", () =>
                    {
                        Patcher.GameAccessPath("TITLE.DAT/2/E_A101_TITLE", () =>
                        {
                            Patcher.GameGetTXM("90", "91", (Txm) =>
                            {
                                //Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_P001, "E_A101_TITLE_P001", "E_A101_TITLE_P001_D", "E_A101_TITLE_P001_F");
                                Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_P001, "E_A101_TITLE_P001");
                                Patcher.UpdateTxm2DWithEmpty(Txm, "E_A101_TITLE_P001_D", "E_A101_TITLE_P001_F");
                                Patcher.ProgressHandler.IncrementLevelProgress();

                                //Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_PUSH, "E_A101_TITLE_PUSH", "E_A101_TITLE_PUSH_D", "E_A101_TITLE_PUSH_F");
                                Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_PUSH, "E_A101_TITLE_PUSH");
                                Patcher.UpdateTxm2DWithEmpty(Txm, "E_A101_TITLE_PUSH_D", "E_A101_TITLE_PUSH_F");
                                Patcher.ProgressHandler.IncrementLevelProgress();

                                Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_CREDIT_E, "E_A101_TITLE_CREDIT_E");
                                Patcher.ProgressHandler.IncrementLevelProgress();

                                Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_TEAM, "E_A101_TITLE_TEAM", "E_A101_TITLE_TEAM_D", "E_A101_TITLE_TEAM_F");
                            });
                        });
                    });

                    Patcher.Action("Game Over", () =>
                    {
                        Patcher.GameAccessPath("GAMEOVER.DAT/2/E_A104_GAMEOVER", () =>
                        {
                            HandleGameOver();
                        });
                    });

                    Patcher.Action("Skill Tutorial", () =>
                    {
                        Patcher.GameAccessPath("EP_050_010.DAT", () =>
                        {
                            Patcher.GameAccessPath("2", () =>
                            {
                                Patcher.GameAccessPath("E_A031", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA01, "SKILL_NA01");
                                        Patcher.UpdateTxm2DWithEmpty(Txm, "SKILL_FR01", "SKILL_DE01");
                                    });
                                });

                                Patcher.GameAccessPath("E_A032", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_01, "SKILL_NA02_01");
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_02, "SKILL_NA02_02");
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_03, "SKILL_NA02_03");
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_04, "SKILL_NA02_04");

                                        Patcher.UpdateTxm2DWithEmpty(Txm, "SKILL_FR02_01", "SKILL_DE02_01");
                                        Patcher.UpdateTxm2DWithEmpty(Txm, "SKILL_FR02_02", "SKILL_DE02_02");
                                        Patcher.UpdateTxm2DWithEmpty(Txm, "SKILL_FR02_03", "SKILL_DE02_03");
                                        Patcher.UpdateTxm2DWithEmpty(Txm, "SKILL_FR02_04", "SKILL_DE02_04");
                                    });
                                });

                                Patcher.GameAccessPath("E_A033", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA03, "SKILL_NA03");
                                        Patcher.UpdateTxm2DWithEmpty(Txm, "SKILL_FR03", "SKILL_DE03");
                                    });
                                });

                                /*
                                 * Patcher.GameAccessPath("E_A063", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) =>
                                 *  {
                                 *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA01, "SKILL_NA01");
                                 *  });
                                 * });
                                 *
                                 * Patcher.GameAccessPath("E_A064", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) =>
                                 *  {
                                 *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_01, "SKILL_NA02_01");
                                 *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_02, "SKILL_NA02_02");
                                 *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_03, "SKILL_NA02_03");
                                 *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_04, "SKILL_NA02_04");
                                 *  });
                                 * });
                                 *
                                 * Patcher.GameAccessPath("E_A065", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) =>
                                 *  {
                                 *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA03, "SKILL_NA03");
                                 *  });
                                 * });
                                 */
                            });
                        }, 15);
                    });

                    Patcher.Action("Cooking Tutorial", () =>
                    {
                        Patcher.GameAccessPath("EP_060_040.DAT", () =>
                        {
                            Patcher.GameAccessPath("2", () =>
                            {
                                Patcher.GameAccessPath("E_A057", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA01, "COOK_NA01", "COOK_FR01", "COOK_DE01");
                                        //Patcher.UpdateTxm2DWithEmpty(Txm, "COOK01");
                                    });
                                });

                                //No hay E_A058, que es donde estaría el COOK_NA02

                                Patcher.GameAccessPath("E_A059", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA03, "COOK_NA03", "COOK_FR03", "COOK_DE03");
                                        //Patcher.UpdateTxm2DWithEmpty(Txm, "COOK03");
                                    });
                                });

                                Patcher.GameAccessPath("E_A060", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA04, "COOK_NA04", "COOK_FR04", "COOK_DE04");
                                        //Patcher.UpdateTxm2DWithEmpty(Txm, "COOK04");
                                    });
                                });

                                Patcher.GameAccessPath("E_A061", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA05, "COOK_NA05", "COOK_FR05", "COOK_DE05");
                                        //Patcher.UpdateTxm2DWithEmpty(Txm, "COOK05");
                                    });
                                });

                                /*
                                 * Patcher.GameAccessPath("E_A066", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA01, "COOK_NA01"); });
                                 * });
                                 * Patcher.GameAccessPath("E_A068", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA03, "COOK_NA03"); });
                                 * });
                                 * Patcher.GameAccessPath("E_A069", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA04, "COOK_NA04"); });
                                 * });
                                 * Patcher.GameAccessPath("E_A070", () =>
                                 * {
                                 *  Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA05, "COOK_NA05"); });
                                 * });
                                 */
                            });
                        }, 15);
                    });

                    //El dichoso "Great!" aparece en cada una de las batallas que tienen misión secreta
                    Patcher.Action("Battle texts", () =>
                    {
                        foreach (var DatFileNumber in new[] { "030_080", "110_040", "140_050", "150_170", "170_050", "195_030", "210_090", "270_110", "280_030", "300_070", "340_070", "370_050", "420_080", "440_040", "470_030_1", "490_060_1", "510_050", "510_080", "580_030", "590_030", "640_050", "650_030", "650_050" })
                        {
                            Patcher.GameAccessPath("BTL_EP_" + DatFileNumber + ".DAT/2/E_A028", () =>
                            {
                                Patcher.GameGetTXM("0", "1", (Txm) =>
                                {
                                    Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_USUALBTLFONT01, "E_A034_BTLFONT01_E", "E_A034_BTLFONT01_F", "E_A034_BTLFONT01_G");
                                    Patcher.UpdateTxm2DWithEmpty(Txm, "E_A023_BTLFONT01");
                                });
                            });
                        }
                    });

                    Patcher.Action("High/Low, Even/Odd Minigame", () =>
                    {
                        foreach (var DatFile in new[] { "EP_0670_010.DAT", "POR_C03.DAT" })
                        {
                            Patcher.GameAccessPath(DatFile, () =>
                            {
                                Patcher.GameAccessPath("2", () =>
                                {
                                    Patcher.GameAccessPath("E_MG_STONERESULT01", () =>
                                    {
                                        Patcher.GameGetTXM("0", "1", (Txm) =>
                                        {
                                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MINIGAMEISHI01E, "U_MINIGAMEISHI01E", "U_MINIGAMEISHI01F", "U_MINIGAMEISHI01G");
                                            Patcher.UpdateTxm2DWithEmpty(Txm, "U_MINIGAMEISHI01J");
                                        });
                                    });

                                    Patcher.GameAccessPath("E_MG_STONERESULT02", () =>
                                    {
                                        Patcher.GameGetTXM("0", "1", (Txm) =>
                                        {
                                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MINIGAMEISHI02E, "U_MINIGAMEISHI02E", "U_MINIGAMEISHI02F", "U_MINIGAMEISHI02G");
                                            Patcher.UpdateTxm2DWithEmpty(Txm, "U_MINIGAMEISHI02J");
                                        });
                                    });
                                });
                            }, 15);
                        }
                    });

                    //Se decidió dejar este minijuego en inglés.

                    /*
                     * Patcher.Action("Tales of Draspi Minigame", () =>
                     * {
                     *  Patcher.GameAccessPath("EP_0680_010.DAT", () =>
                     *  {
                     *      Patcher.GameAccessPath("2", () =>
                     *      {
                     *          Patcher.GameAccessPath("E_MG_STG_FONT", () =>
                     *          {
                     *              Patcher.GameGetTXM("0", "1", (Txm) =>
                     *              {
                     *                  Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.MG_BS_FONT_128, "MG_BS_FONT");
                     *              });
                     *          });
                     *      });
                     *  }, 15);
                     *
                     *  Patcher.GameAccessPath("NAM_C.DAT", () =>
                     *  {
                     *      Patcher.GameAccessPath("2", () =>
                     *      {
                     *          Patcher.GameAccessPath("E_MG_STG_FONT", () =>
                     *          {
                     *              Patcher.GameGetTXM("0", "1", (Txm) =>
                     *              {
                     *                  Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.MG_BS_FONT, "MG_BS_FONT", "MG_BS_FONT_DE", "MG_BS_FONT_FR");
                     *                  //Patcher.UpdateTxm2DWithEmpty(Txm, "MG_BS_FONT_DE", "MG_BS_FONT_FR");
                     *              });
                     *          }, 15);
                     *      });
                     *  }, 15);
                     * });*/

                    Patcher.Action("Ba'ul Rings Minigame", () =>
                    {
                        Patcher.GameAccessPath("FIELD.DAT", () =>
                        {
                            Patcher.GameAccessPath("2", () =>
                            {
                                Patcher.GameAccessPath("E_MG_RING_2D", () =>
                                {
                                    Patcher.GameGetTXM("0", "1", (Txm) =>
                                    {
                                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MG_BR, "U_MG_BR", "U_MG_BR_DE", "U_MG_BR_FR");
                                    });
                                }, 15);
                            });
                        }, 15);
                    });
                });
            });
        }
Beispiel #8
0
        private void Handle1()
        {
            Patcher.GameAccessPath("effect.svo", () =>
            {
                Patcher.Action("Level Up", () =>
                {
                    Patcher.GameAccessPath("E_A018.DAT", () =>
                    {
                        Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A018_LVUP_00, "E_A018_LVUP_00"); });
                        Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A018_LVUP_00, "E_A018_LVUP_00_F", "E_A018_LVUP_00_G"); });
                    });
                });

                Patcher.Action("New Skill", () =>
                {
                    Patcher.GameAccessPath("E_A019.DAT", () =>
                    {
                        Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A019_NEW_00, "E_A019_NEW_00"); });
                        Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A019_NEW_00, "E_A019_NEW_00_F", "E_A019_NEW_00_G"); });
                    });
                });

                Patcher.Action("Secret Mission", () =>
                {
                    Patcher.GameAccessPath("E_A027.DAT", () =>
                    {
                        Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A027_MISSION_00, "E_A027_MISSION_00"); });
                        Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithEmpty(Txm, "E_A027_MISSION_00_F", "E_A027_MISSION_00_G"); });
                    });
                });

                Patcher.Action("New Arte", () =>
                {
                    Patcher.GameAccessPath("E_A024.DAT", () =>
                    {
                        Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A024_LEARNING_00, "E_A024_LEARNING_00"); });
                        Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithEmpty(Txm, "E_A024_LEARNING_00_F", "E_A024_LEARNING_00_G"); });
                    });
                });

                Patcher.Action("New Title", () =>
                {
                    Patcher.GameAccessPath("E_A062.DAT", () =>
                    {
                        Patcher.GameGetTXM("8", "9", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A062_TITLE_00, "E_A062_TITLE_00"); });
                        Patcher.GameGetTXM("10", "11", (Txm) => { Patcher.UpdateTxm2DWithEmpty(Txm, "E_A062_TITLE_00_F", "E_A062_TITLE_00_G"); });
                    });
                });

                Patcher.Action("Game Over", () =>
                {
                    Patcher.GameAccessPath("E_A104_GAMEOVER.DAT", () =>
                    {
                        new CharaSvo(Patcher).HandleGameOver();
                    });
                });


                Patcher.Action("Encounter Types", () =>
                {
                    foreach (var DatFile in new[] { "E_A023.DAT", "E_A028.DAT" })
                    {
                        Patcher.GameAccessPath(DatFile, () =>
                        {
                            Patcher.GameGetTXM("0", "1", (Txm) =>
                            {
                                Patcher.UpdateTxm2DWithPng(
                                    Txm, PatchPaths.U_USUALBTLFONT01,
                                    "E_A023_BTLFONT01", "E_A034_BTLFONT01_E", "E_A034_BTLFONT01_F", "E_A034_BTLFONT01_G"
                                    );
                            });
                        });
                    }

                    Patcher.GameAccessPath("E_A034.DAT", () =>
                    {
                        Patcher.GameGetTXM("0", "1", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(
                                Txm, PatchPaths.U_USUALBTLFONT01,
                                "E_A034_BTLFONT01_E"
                                );
                        });
                    });
                });

                Patcher.Action("Cooking Tutorial", () =>
                {
                    Patcher.GameAccessPath("E_A057.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA01, "COOK_NA01", "COOK_FR01", "COOK_DE01"); }); }, 15);
                    Patcher.GameAccessPath("E_A058.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA02, "COOK_NA02", "COOK_FR02", "COOK_DE02"); }); }, 15);
                    Patcher.GameAccessPath("E_A059.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA03, "COOK_NA03", "COOK_FR03", "COOK_DE03"); }); }, 15);
                    Patcher.GameAccessPath("E_A060.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA04, "COOK_NA04", "COOK_FR04", "COOK_DE04"); }); }, 15);
                    Patcher.GameAccessPath("E_A061.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.COOK_NA05, "COOK_NA05", "COOK_FR05", "COOK_DE05"); }); }, 15);
                });

                Patcher.Action("Skill Tutorial", () =>
                {
                    Patcher.GameAccessPath("E_A031.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA01, "SKILL_NA01", "SKILL_FR01", "SKILL_DE01"); }); }, 15);
                    Patcher.GameAccessPath("E_A032.DAT", () =>
                    {
                        Patcher.GameGetTXM("0", "1", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_01, "SKILL_NA02_01", "SKILL_FR02_01", "SKILL_DE02_01");
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_02, "SKILL_NA02_02", "SKILL_FR02_02", "SKILL_DE02_02");
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_03, "SKILL_NA02_03", "SKILL_FR02_03", "SKILL_DE02_03");
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_04, "SKILL_NA02_04", "SKILL_FR02_04", "SKILL_DE02_04");
                        });
                    }, 15);
                    Patcher.GameAccessPath("E_A033.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA03, "SKILL_NA03", "SKILL_FR03", "SKILL_DE03"); }); }, 15);

                    /*
                     * Patcher.GameAccessPath("E_A063.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA01, "SKILL_NA01"); }); }, 15);
                     * Patcher.GameAccessPath("E_A064.DAT", () =>
                     * {
                     *  Patcher.GameGetTXM("0", "1", (Txm) =>
                     *  {
                     *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_01, "SKILL_NA02_01");
                     *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_02, "SKILL_NA02_02");
                     *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_03, "SKILL_NA02_03");
                     *      Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA02_04, "SKILL_NA02_04");
                     *  });
                     * }, 15);
                     * Patcher.GameAccessPath("E_A065.DAT", () => { Patcher.GameGetTXM("0", "1", (Txm) => { Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.SKILL_NA03, "SKILL_NA03"); }); }, 15);
                     */
                });

                Patcher.Action("Title Menu", () =>
                {
                    Patcher.GameAccessPath("E_A101_TITLE.DAT", () =>
                    {
                        Patcher.GameGetTXM("90", "91", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_CREDIT_E, "E_A101_TITLE_CREDIT_E");
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_P001, "E_A101_TITLE_P001", "E_A101_TITLE_P001_D", "E_A101_TITLE_P001_F");
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_PUSH, "E_A101_TITLE_PUSH", "E_A101_TITLE_PUSH_D", "E_A101_TITLE_PUSH_F");
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.E_A101_TITLE_TEAM, "E_A101_TITLE_TEAM", "E_A101_TITLE_TEAM_D", "E_A101_TITLE_TEAM_F");
                        });
                    });
                });

                Patcher.Action("High/Low, Even/Odd Minigame", () =>
                {
                    Patcher.GameAccessPath("E_MG_STONERESULT01.DAT", () =>
                    {
                        Patcher.GameGetTXM("0", "1", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MINIGAMEISHI01E, "U_MINIGAMEISHI01E", "U_MINIGAMEISHI01F", "U_MINIGAMEISHI01G");
                        });
                    });
                    Patcher.GameAccessPath("E_MG_STONERESULT02.DAT", () =>
                    {
                        Patcher.GameGetTXM("0", "1", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MINIGAMEISHI02E, "U_MINIGAMEISHI02E", "U_MINIGAMEISHI02F", "U_MINIGAMEISHI02G");
                        });
                    });
                });

                Patcher.Action("Ba'ul Rings Minigame", () =>
                {
                    Patcher.GameAccessPath("E_MG_RING_2D.DAT", () =>
                    {
                        Patcher.GameGetTXM("0", "1", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MG_BR, "U_MG_BR");
                        });
                    }, 15);
                });

                Patcher.Action("Tales of Draspi Minigame", () =>
                {
                    Patcher.GameAccessPath("E_MG_STG_FONT.DAT", () =>
                    {
                        Patcher.GameGetTXM("0", "1", (Txm) =>
                        {
                            Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.MG_BS_FONT, "MG_BS_FONT", "MG_BS_FONT_DE", "MG_BS_FONT_FR");
                        });
                    }, 15);
                });
            });
        }
Beispiel #9
0
        private void HandleImages()
        {
            Patcher.Action("Patching Images...", () =>
            {
                var PatcherDataFS = Patcher.PatcherDataFS;

                foreach (var Suffix in new[] { "", "DE", "FR" })
                {
                    Patcher.GameGetTXM("COMALL" + Suffix, (Txm) =>
                    {
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_COMALLINFO00, "U_COMALLINFO00");
                    });

                    Patcher.GameGetTXM("ICONBTN360" + Suffix, (Txm) =>
                    {
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_ICONBTN36000, "U_ICONBTN36000");
                    });

                    Patcher.GameGetTXM("ICONKIND" + Suffix, (Txm) =>
                    {
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_ICONKIND00, "U_ICONKIND00");
                    });

                    Patcher.GameGetTXM("ICONSORT" + Suffix, (Txm) =>
                    {
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_ICONSORT00, "U_ICONSORT00");
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_ICONSORT01, "U_ICONSORT01");
                    });

                    Patcher.GameGetTXM("ICONSYM" + Suffix, (Txm) =>
                    {
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_ICONSYM01, "U_ICONSYM01");
                    });

                    Patcher.GameGetTXM("MENU" + Suffix, (Txm) =>
                    {
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MENUBTLINFO00, "U_MENUBTLINFO00");
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MENUBTLINFO02, "U_MENUBTLINFO02");
                        Patcher.UpdateTxm2DWithPng(Txm, PatchPaths.U_MENUSTR01, "U_MENUSTR01");
                    });
                }

                foreach (var Suffix in new[] { "", "_E", "_F", "_G" })
                {
                    Patcher.GameGetTXM("MINIGAMEPOKER" + Suffix, (Txm) =>
                    {
                        foreach (var n in new[] { 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 70 })
                        {
                            var TexName = String.Format("U_MINIGAMEPOKER{0:D2}", n);
                            Patcher.UpdateTxm2DWithPng(Txm, String.Format("Images/Minigames/{0}.png", TexName), TexName);
                        }
                    });
                }

                foreach (var Suffix in new[] { "", "_E" })
                {
                    Patcher.GameGetTXM("MINIGAMEISHI" + Suffix, (Txm) =>
                    {
                        foreach (var n in new[] { 1, 2 })
                        {
                            var TexName = String.Format("U_MINIGAMEISHI{0:D2}", n);
                            Patcher.UpdateTxm2DWithPng(Txm, String.Format("Images/Minigames/{0}.png", TexName), TexName);
                        }
                    });
                    Patcher.GameGetTXM("MINIGAMERACE" + Suffix, (Txm) =>
                    {
                        foreach (var n in new[] { 1, 2, 3 })
                        {
                            var TexName = String.Format("U_MINIGAMERACE{0:D2}", n);
                            Patcher.UpdateTxm2DWithPng(Txm, String.Format("Images/Minigames/{0}.png", TexName), TexName);
                        }
                    });
                }

                // TODO: TOWNMAP!

                //Patcher.GameGetTXM("TOWNMAPFOR", (Txm) =>
                //{
                //	var BaseImage = Txm.Surface2DEntriesByName["U_MAP_EFOR"].Bitmap;
                //	var Bitmap = _TranslateZoneAnimationImage(BaseImage, "", "Fuerte de Deidon");
                //	Patcher.UpdateTxm2DWithImage(Txm, Bitmap, "U_MAP_EFOR");
                //});
            });

            Patcher.Action("Patching Misc...", () =>
            {
                //Patcher.PatcherGetFile("Test/SITE00.DAV.test", (Stream) =>
                //Patcher.PatcherGetFile("Test/SITE00.DAV.old", (Stream) =>
                //{
                //	Patcher.GameReplaceFile("SITE00.DAV", Stream);
                //});
            });
        }
Beispiel #10
0
        private void Handle1()
        {
            Patcher.TempFS.CreateDirectory("CHAT_ES", 0777, false);

            Patcher.Action("Translating Skits...", () =>
            {
                Patcher.ProgressHandler.AddProgressLevel("Traduciendo skits", OriginalChatSvo.Count(), () =>
                {
                    Patcher.ParallelForeach("Translating", OriginalChatSvo, (ChatSvoEntry) => ChatSvoEntry.Name, (ChatSvoEntry) =>
                    {
                        var Match = ChatSvoEntry.Name.RegexMatch(@"^(VC\d+B?)(UK)\.DAT$");
                        if (Match != null)
                        {
                            var CompleteFile = Match[0].Value;
                            var ChatId       = Match[1].Value;
                            var EsFile       = PreppendTempFile + ChatId + "ES.DAT";

                            Console.WriteLine("{0}...", ChatId);

                            if (!Patcher.TempFS.Exists(EsFile))
                            {
                                var Fps4 = new FPS4(TalesCompression.DecompressStream(OriginalChatSvo[CompleteFile].Open()));
                                {
                                    var Chtx = new TO8CHTX();
                                    Chtx.Load(Fps4["3"].Open());
                                    // Translate
                                    {
                                        foreach (var Entry in Patcher.EntriesByRoom["skits/" + ChatId].Values)
                                        {
                                            int TextId = int.Parse(Entry.text_id) - 1;
                                            if (TextId >= 0)
                                            {
                                                //Chtx[TextId].Title = "";
                                                //Chtx[TextId].Title = TextProcessor.Instance.ProcessAndDetectPitfalls(Chtx[TextId].Title, Entry.texts.es[0].TrimEnd(' ', '\t', '\n', '\r', '.'));
                                                //Chtx[TextId].Title = TextProcessor.Instance.ProcessAndDetectPitfalls(Chtx[TextId].Title, Entry.texts.es[0]);
                                                Chtx[TextId].Title          = "";
                                                Chtx[TextId].TextOriginal   = "";
                                                Chtx[TextId].TextTranslated = TextProcessor.Instance.ProcessAndDetectPitfalls(Chtx[TextId].TextTranslated, Entry.texts.es[1]);
                                            }
                                        }
                                    }
                                    //ChtxStream.SetLength(0);
                                    var ChtxStream = new MemoryStream();
                                    Chtx.SaveTo(ChtxStream);
                                    ChtxStream.Position = 0;
                                    Fps4["3"].SetStream(ChtxStream);
                                }
                                Patcher.TempFS.WriteAllBytes(EsFile, TalesCompression.CreateFromVersion(Patcher.CompressionVersion, Patcher.CompressionFallback).EncodeBytes(Fps4.Save(false).ToArray()));
                                Console.WriteLine("{0}...Ok", ChatId);
                            }
                            else
                            {
                                Console.WriteLine("{0}...Exists", ChatId);
                            }
                        }

                        Patcher.ProgressHandler.IncrementLevelProgress();
                    });
                });
            });
        }