From 16dbfe86fa59d1a0bcbd642e8eb8dc1499f50198 Mon Sep 17 00:00:00 2001 From: mikx Date: Fri, 27 Dec 2024 17:05:41 -0500 Subject: [PATCH] 1.1.0 - install + stat gen --- MxFilterGen2/App.config | 14 +- MxFilterGen2/DB/MySql.cs | 23 ++ MxFilterGen2/Generator/Body.cs | 326 ++++++++++++++++++++++++++++ MxFilterGen2/Generator/Boots.cs | 326 ++++++++++++++++++++++++++++ MxFilterGen2/Generator/Bows.cs | 191 ++++++++++++++++ MxFilterGen2/Generator/Claws.cs | 184 ++++++++++++++++ MxFilterGen2/Generator/Daggers.cs | 183 ++++++++++++++++ MxFilterGen2/Generator/Focus.cs | 303 ++++++++++++++++++++++++++ MxFilterGen2/Generator/Gloves.cs | 326 ++++++++++++++++++++++++++++ MxFilterGen2/Generator/Helmets.cs | 326 ++++++++++++++++++++++++++++ MxFilterGen2/Generator/OneHander.cs | 191 ++++++++++++++++ MxFilterGen2/Generator/Shields.cs | 326 ++++++++++++++++++++++++++++ MxFilterGen2/Generator/Staves.cs | 187 ++++++++++++++++ MxFilterGen2/Generator/TwoHander.cs | 191 ++++++++++++++++ MxFilterGen2/Generator/Wands.cs | 183 ++++++++++++++++ MxFilterGen2/Generator/_Color.cs | 24 ++ MxFilterGen2/IO/Cleaner.cs | 7 +- MxFilterGen2/JSON/Settings.cs | 10 + MxFilterGen2/MxFilterGen2.csproj | 67 ++++++ MxFilterGen2/Program.cs | 57 ++++- MxFilterGen2/packages.config | 16 ++ 21 files changed, 3453 insertions(+), 8 deletions(-) create mode 100644 MxFilterGen2/DB/MySql.cs create mode 100644 MxFilterGen2/Generator/Body.cs create mode 100644 MxFilterGen2/Generator/Boots.cs create mode 100644 MxFilterGen2/Generator/Bows.cs create mode 100644 MxFilterGen2/Generator/Claws.cs create mode 100644 MxFilterGen2/Generator/Daggers.cs create mode 100644 MxFilterGen2/Generator/Focus.cs create mode 100644 MxFilterGen2/Generator/Gloves.cs create mode 100644 MxFilterGen2/Generator/Helmets.cs create mode 100644 MxFilterGen2/Generator/OneHander.cs create mode 100644 MxFilterGen2/Generator/Shields.cs create mode 100644 MxFilterGen2/Generator/Staves.cs create mode 100644 MxFilterGen2/Generator/TwoHander.cs create mode 100644 MxFilterGen2/Generator/Wands.cs create mode 100644 MxFilterGen2/Generator/_Color.cs diff --git a/MxFilterGen2/App.config b/MxFilterGen2/App.config index 193aecc..abb8196 100644 --- a/MxFilterGen2/App.config +++ b/MxFilterGen2/App.config @@ -1,6 +1,18 @@ - + + + + + + + + + + + + + \ No newline at end of file diff --git a/MxFilterGen2/DB/MySql.cs b/MxFilterGen2/DB/MySql.cs new file mode 100644 index 0000000..7b2317c --- /dev/null +++ b/MxFilterGen2/DB/MySql.cs @@ -0,0 +1,23 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.DB +{ + internal class MySql + { + public static MySqlConnection MSQLCo() + { + MySqlConnection conn; + string myConnectionString; + + myConnectionString = $"server={JSON.settings.GetdbHost()};port={JSON.settings.GetdbPort()};uid={JSON.settings.GetdbUser()};pwd={JSON.settings.GetdbPass()};database={JSON.settings.GetdbName()};"; + conn = new MySqlConnection(); + conn.ConnectionString = myConnectionString; + return conn; + } + } +} diff --git a/MxFilterGen2/Generator/Body.cs b/MxFilterGen2/Generator/Body.cs new file mode 100644 index 0000000..79f9124 --- /dev/null +++ b/MxFilterGen2/Generator/Body.cs @@ -0,0 +1,326 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Body + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBstrint = ""; + private static string iBstrdex = ""; + private static string iBdex = ""; + private static string iBdexint = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Body Armour") + { + if (reader.GetString("type") == "int_armour") + { + iBint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_armour") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_int_armour") + { + iBstrint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_dex_armour") + { + iBstrdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_armour") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_int_armour") + { + iBdexint += string.Format(@" ""{0}""", name); + } + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/BODY.filter"; + File.AppendAllText(path, $"#### SECTION: (Body Armour)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != null || iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != null || iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != null || iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != null || iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != null || iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != null || iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != null || iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != null || iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != null || iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != null || iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != null || iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != null || iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != null || iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != null || iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != null || iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != null || iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != null || iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != null || iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Boots.cs b/MxFilterGen2/Generator/Boots.cs new file mode 100644 index 0000000..b88e930 --- /dev/null +++ b/MxFilterGen2/Generator/Boots.cs @@ -0,0 +1,326 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Boots + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBstrint = ""; + private static string iBstrdex = ""; + private static string iBdex = ""; + private static string iBdexint = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Boots") + { + if (reader.GetString("type") == "int_armour") + { + iBint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_armour") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_int_armour") + { + iBstrint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_dex_armour") + { + iBstrdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_armour") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_int_armour") + { + iBdexint += string.Format(@" ""{0}""", name); + } + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/BOOTS.filter"; + File.AppendAllText(path, $"#### SECTION: (Boots)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Bows.cs b/MxFilterGen2/Generator/Bows.cs new file mode 100644 index 0000000..37f6792 --- /dev/null +++ b/MxFilterGen2/Generator/Bows.cs @@ -0,0 +1,191 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Bows + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Bow") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "Crossbow") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "Quiver") + { + iBdex += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/BOWS.filter"; + File.AppendAllText(path, $"#### SECTION: (Bows and Crossbows)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Claws.cs b/MxFilterGen2/Generator/Claws.cs new file mode 100644 index 0000000..b10a519 --- /dev/null +++ b/MxFilterGen2/Generator/Claws.cs @@ -0,0 +1,184 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Claws + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Claw") + { + iBdex += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/CLAWS.filter"; + File.AppendAllText(path, $"#### SECTION: (Claws)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Daggers.cs b/MxFilterGen2/Generator/Daggers.cs new file mode 100644 index 0000000..bea73dd --- /dev/null +++ b/MxFilterGen2/Generator/Daggers.cs @@ -0,0 +1,183 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Daggers + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Dagger") + { + iBdex += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/DAGGERS.filter"; + File.AppendAllText(path, $"#### SECTION: (Daggers)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Focus.cs b/MxFilterGen2/Generator/Focus.cs new file mode 100644 index 0000000..785baa8 --- /dev/null +++ b/MxFilterGen2/Generator/Focus.cs @@ -0,0 +1,303 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Focus + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBstrint = ""; + private static string iBstrdex = ""; + private static string iBdex = ""; + private static string iBdexint = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Focus") + { + iBint += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/FOCUS.filter"; + File.AppendAllText(path, $"#### SECTION: (Focus)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Gloves.cs b/MxFilterGen2/Generator/Gloves.cs new file mode 100644 index 0000000..cb733a1 --- /dev/null +++ b/MxFilterGen2/Generator/Gloves.cs @@ -0,0 +1,326 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Gloves + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBstrint = ""; + private static string iBstrdex = ""; + private static string iBdex = ""; + private static string iBdexint = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Gloves") + { + if (reader.GetString("type") == "int_armour") + { + iBint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_armour") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_int_armour") + { + iBstrint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_dex_armour") + { + iBstrdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_armour") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_int_armour") + { + iBdexint += string.Format(@" ""{0}""", name); + } + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/GLOVES.filter"; + File.AppendAllText(path, $"#### SECTION: (Gloves)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Helmets.cs b/MxFilterGen2/Generator/Helmets.cs new file mode 100644 index 0000000..44b4828 --- /dev/null +++ b/MxFilterGen2/Generator/Helmets.cs @@ -0,0 +1,326 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Helmets + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBstrint = ""; + private static string iBstrdex = ""; + private static string iBdex = ""; + private static string iBdexint = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Helmet") + { + if (reader.GetString("type") == "int_armour") + { + iBint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_armour") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_int_armour") + { + iBstrint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_dex_armour") + { + iBstrdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_armour") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_int_armour") + { + iBdexint += string.Format(@" ""{0}""", name); + } + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/HELMETS.filter"; + File.AppendAllText(path, $"#### SECTION: (Helmets)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/OneHander.cs b/MxFilterGen2/Generator/OneHander.cs new file mode 100644 index 0000000..493a21d --- /dev/null +++ b/MxFilterGen2/Generator/OneHander.cs @@ -0,0 +1,191 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class OneHander + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "One Hand Sword") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "One Hand Axe") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "One Hand Mace") + { + iBstr += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/ONEHANDER.filter"; + File.AppendAllText(path, $"#### SECTION: (One Hander (Melee))" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Shields.cs b/MxFilterGen2/Generator/Shields.cs new file mode 100644 index 0000000..f4cac91 --- /dev/null +++ b/MxFilterGen2/Generator/Shields.cs @@ -0,0 +1,326 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Shields + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBstrint = ""; + private static string iBstrdex = ""; + private static string iBdex = ""; + private static string iBdexint = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Shield") + { + if (reader.GetString("type") == "int_armour") + { + iBint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_armour") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_int_armour") + { + iBstrint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "str_dex_armour") + { + iBstrdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_armour") + { + iBdex += string.Format(@" ""{0}""", name); + } + if (reader.GetString("type") == "dex_int_armour") + { + iBdexint += string.Format(@" ""{0}""", name); + } + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/SHIELDS.filter"; + File.AppendAllText(path, $"#### SECTION: (Shields)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrint != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstrdex != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstrdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorStrDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdexint != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdexint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BackgroundColorDexInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Staves.cs b/MxFilterGen2/Generator/Staves.cs new file mode 100644 index 0000000..2948763 --- /dev/null +++ b/MxFilterGen2/Generator/Staves.cs @@ -0,0 +1,187 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Staves + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Staff") + { + iBint += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "Warstaff") + { + iBdex += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/STAVES.filter"; + File.AppendAllText(path, $"#### SECTION: (Staff and Quarterstaff)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/TwoHander.cs b/MxFilterGen2/Generator/TwoHander.cs new file mode 100644 index 0000000..75768d9 --- /dev/null +++ b/MxFilterGen2/Generator/TwoHander.cs @@ -0,0 +1,191 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class TwoHander + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Two Hand Sword") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "Two Hand Axe") + { + iBstr += string.Format(@" ""{0}""", name); + } + if (reader.GetString("class") == "Two Hand Mace") + { + iBstr += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/TWOHANDER.filter"; + File.AppendAllText(path, $"#### SECTION: (Two Hander (Melee))" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/Wands.cs b/MxFilterGen2/Generator/Wands.cs new file mode 100644 index 0000000..ed8a0e7 --- /dev/null +++ b/MxFilterGen2/Generator/Wands.cs @@ -0,0 +1,183 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class Wands + { + private static string iBint = ""; + private static string iBstr = ""; + private static string iBdex = ""; + + public static void Gen() + { + using (MySqlConnection connection = DB.MySql.MSQLCo()) + { + try + { + connection.Open(); + + string query = "SELECT * FROM item_base"; + using (MySqlCommand command = new MySqlCommand(query, connection)) + { + using (MySqlDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + string name = reader.GetString("name"); + + if (reader.GetString("class") == "Wand") + { + iBint += string.Format(@" ""{0}""", name); + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } + + string path = "out/gen/WANDS.filter"; + File.AppendAllText(path, $"#### SECTION: (Wands)" + Environment.NewLine, Encoding.UTF8); + + // normal + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Normal" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorNormal + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // magic + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Magic" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Magic" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorMagic + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + + // rare + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"## RARITY: Rare" + Environment.NewLine, Encoding.UTF8); + if (iBint != ""){ + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + File.AppendAllText(path, $"# TYPE: INT" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBint + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorInt + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBstr != ""){ + File.AppendAllText(path, $"# TYPE: STR" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBstr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorStr + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + + if (iBdex != ""){ + File.AppendAllText(path, $"# TYPE: DEX" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " BaseType " + iBdex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.TextColorRare + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, _Color.BorderColorDex + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8); + } + } + } +} diff --git a/MxFilterGen2/Generator/_Color.cs b/MxFilterGen2/Generator/_Color.cs new file mode 100644 index 0000000..d8e20a3 --- /dev/null +++ b/MxFilterGen2/Generator/_Color.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxFilterGen2.Generator +{ + internal class _Color + { + public static string TextColorNormal = " SetTextColor 200 200 200"; + public static string TextColorMagic = " SetTextColor 136 136 255"; + public static string TextColorRare = " SetTextColor 255 255 0"; + + public static string BorderColorInt = " SetBorderColor 3 48 252"; + public static string BorderColorStr = " SetBorderColor 252 3 36"; + public static string BorderColorDex = " SetBorderColor 4 217 11"; + + public static string BackgroundColorStrInt = " SetBackgroundColor 56 69 89"; + public static string BackgroundColorStrDex = " SetBackgroundColor 50 69 49"; + public static string BackgroundColorDexInt = " SetBackgroundColor 56 69 89"; + } +} diff --git a/MxFilterGen2/IO/Cleaner.cs b/MxFilterGen2/IO/Cleaner.cs index 7ef4ef9..9d42357 100644 --- a/MxFilterGen2/IO/Cleaner.cs +++ b/MxFilterGen2/IO/Cleaner.cs @@ -19,7 +19,12 @@ namespace MxFilterGen2.IO File.Delete(file); } File.Delete($"out/{JSON.settings.GetName()}_{f}.filter"); - } + } + var gens = Directory.GetFiles("out/Gen"); + foreach (var g in gens) + { + File.Delete(g); + } } } } diff --git a/MxFilterGen2/JSON/Settings.cs b/MxFilterGen2/JSON/Settings.cs index 616b516..4387a0c 100644 --- a/MxFilterGen2/JSON/Settings.cs +++ b/MxFilterGen2/JSON/Settings.cs @@ -11,6 +11,11 @@ namespace MxFilterGen2.JSON { internal class SETTINGS { + public string dbHost { get; set; } + public string dbPort { get; set; } + public string dbName { get; set; } + public string dbUser { get; set; } + public string dbPass { get; set; } public string Name { get; set; } public bool Install { get; set; } public List Types { get; set; } @@ -20,6 +25,11 @@ namespace MxFilterGen2.JSON class settings { + public static string GetdbHost() => JsonConvert.DeserializeObject(File.ReadAllText("settings.json")).dbHost; + public static string GetdbPort() => JsonConvert.DeserializeObject(File.ReadAllText("settings.json")).dbPort; + public static string GetdbName() => JsonConvert.DeserializeObject(File.ReadAllText("settings.json")).dbName; + public static string GetdbUser() => JsonConvert.DeserializeObject(File.ReadAllText("settings.json")).dbUser; + public static string GetdbPass() => JsonConvert.DeserializeObject(File.ReadAllText("settings.json")).dbPass; internal static string GetName() { SETTINGS j = JsonConvert.DeserializeObject(File.ReadAllText($"settings.json")); diff --git a/MxFilterGen2/MxFilterGen2.csproj b/MxFilterGen2/MxFilterGen2.csproj index 8ca2327..b42b04f 100644 --- a/MxFilterGen2/MxFilterGen2.csproj +++ b/MxFilterGen2/MxFilterGen2.csproj @@ -33,20 +33,87 @@ 4 + + ..\packages\BouncyCastle.Cryptography.2.3.1\lib\net461\BouncyCastle.Cryptography.dll + + + ..\packages\Google.Protobuf.3.26.1\lib\net45\Google.Protobuf.dll + + + ..\packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll + + + ..\packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll + + + ..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\MySql.Data.9.1.0\lib\net48\MySql.Data.dll + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + ..\packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll + + + ..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll + + + ..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll + + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + + ..\packages\ZstdSharp.Port.0.8.0\lib\net462\ZstdSharp.dll + + + + + + + + + + + + + + + + diff --git a/MxFilterGen2/Program.cs b/MxFilterGen2/Program.cs index 79750c3..17a2c60 100644 --- a/MxFilterGen2/Program.cs +++ b/MxFilterGen2/Program.cs @@ -9,7 +9,8 @@ namespace MxFilterGen2 { internal class Program { - public static string version = "1.0.0"; + public static string version = "1.1.0"; + public static string docpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); static void Main(string[] args) { Message.Splash("MxFilterGen2", "mikx"); @@ -18,10 +19,37 @@ namespace MxFilterGen2 string fname = JSON.settings.GetName(); foreach (string s in JSON.settings.GetStructure()) { - Message.CMW($"Section: {s}",true,2); + if (s != "GEN") + { + Message.CMW($"Section: {s}", true, 2); + foreach (string f in JSON.settings.GetType()) + { + Compiler.section.Compile(s, f); + } + } + } + + Generator.Body.Gen(); + Generator.Boots.Gen(); + Generator.Bows.Gen(); + Generator.Claws.Gen(); + Generator.Daggers.Gen(); + Generator.Focus.Gen(); + Generator.Gloves.Gen(); + Generator.Helmets.Gen(); + Generator.OneHander.Gen(); + Generator.Shields.Gen(); + Generator.Staves.Gen(); + Generator.TwoHander.Gen(); + Generator.Wands.Gen(); + + var gens = Directory.GetFiles("out/Gen"); + string genstring = ""; + foreach (var g in gens) + { foreach (string f in JSON.settings.GetType()) { - Compiler.section.Compile(s, f); + File.AppendAllText($"out/{f}/GEN.filter",File.ReadAllText(g)); } } @@ -41,15 +69,32 @@ namespace MxFilterGen2 { File.AppendAllText(outp, $"# {sspl}{Environment.NewLine}"); } - File.AppendAllText(outp, $"{Environment.NewLine}"); + File.AppendAllText(outp, $"{Environment.NewLine}"); foreach (var structure in JSON.settings.GetStructure()) - { + { File.AppendAllText("out/" + fname + "_" + f + ".filter", string.Format("#### SECTION: {0}", (object)structure) + Environment.NewLine); File.AppendAllText("out/" + fname + "_" + f + ".filter", File.ReadAllText(string.Format("out/" + f + "/" + structure + ".filter"))); File.AppendAllText("out/" + fname + "_" + f + ".filter", Environment.NewLine ?? ""); } } - Console.ReadKey(); + + if (JSON.settings.GetInstall()) + { + Message.CMW($"Install is \"True\". Installing to the game directory...", true, 1); + foreach (string f in JSON.settings.GetType()) + { + File.Copy($"out/MxFilter_{f}.filter", $@"{docpath}\My Games\Path of Exile 2\{JSON.settings.GetName()}_{f}.filter", true); + } + foreach (var s in Directory.EnumerateFiles("sound")) + { + string sf = Path.GetFileName(s); + File.Copy($"{s}", $@"{docpath}\My Games\Path of Exile 2\{sf}", true); + } + } else + { + int fc = JSON.settings.GetType().Count; + Message.CMW($"Install is \"False\". Use the {fc} Filter(s) from the \"out\" directory.", true, 1); + } } } } diff --git a/MxFilterGen2/packages.config b/MxFilterGen2/packages.config index 0b14af3..c797492 100644 --- a/MxFilterGen2/packages.config +++ b/MxFilterGen2/packages.config @@ -1,4 +1,20 @@  + + + + + + + + + + + + + + + + \ No newline at end of file