This commit is contained in:
BuildTools 2022-09-09 00:34:27 -04:00
parent 0a2d3da084
commit e3d74db312
16 changed files with 770 additions and 397 deletions

View File

@ -216,18 +216,20 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="currency_classes.cs" />
<Compile Include="generator\accessory.cs" />
<Compile Include="generator\armour.cs" />
<Compile Include="generator\base.cs" />
<Compile Include="generator\card.cs" />
<Compile Include="generator\fossil.cs" />
<Compile Include="generator\tier.cs" />
<Compile Include="generator\tier_caster.cs" />
<Compile Include="generator\weapon.cs" />
<Compile Include="generator_classes.cs" />
<Compile Include="json\settings.cs" />
<Compile Include="main.cs" />
<Compile Include="msg.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="structures.cs" />
<Compile Include="web.cs" />
</ItemGroup>
<ItemGroup>
@ -250,6 +252,9 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="content\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>

View File

@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
public class CurrencyDetail
{
public int id { get; set; }
public string icon { get; set; }
public string name { get; set; }
public string tradeId { get; set; }
}
public class LanguageCurrency
{
public string name { get; set; }
public Translations translations { get; set; }
}
public class LineCurrency
{
public string currencyTypeName { get; set; }
public Pay pay { get; set; }
public Receive receive { get; set; }
public double chaosEquivalent { get; set; }
public LowConfidencePaySparkLine lowConfidencePaySparkLine { get; set; }
public LowConfidenceReceiveSparkLine lowConfidenceReceiveSparkLine { get; set; }
public string detailsId { get; set; }
}
public class LowConfidencePaySparkLine
{
public List<object> data { get; set; }
public double totalChange { get; set; }
}
public class LowConfidenceReceiveSparkLine
{
public List<double?> data { get; set; }
public double totalChange { get; set; }
}
public class Pay
{
public int id { get; set; }
public int league_id { get; set; }
public int pay_currency_id { get; set; }
public int get_currency_id { get; set; }
public DateTime sample_time_utc { get; set; }
public int count { get; set; }
public double value { get; set; }
public int data_point_count { get; set; }
public bool includes_secondary { get; set; }
public int listing_count { get; set; }
}
public class PaySparkLine
{
public List<object> data { get; set; }
public double totalChange { get; set; }
}
public class Receive
{
public int id { get; set; }
public int league_id { get; set; }
public int pay_currency_id { get; set; }
public int get_currency_id { get; set; }
public DateTime sample_time_utc { get; set; }
public int count { get; set; }
public double value { get; set; }
public int data_point_count { get; set; }
public bool includes_secondary { get; set; }
public int listing_count { get; set; }
}
public class ReceiveSparkLine
{
public List<double> data { get; set; }
public double totalChange { get; set; }
}
public class RootCurrency
{
public List<LineCurrency> lines { get; set; }
public List<CurrencyDetail> currencyDetails { get; set; }
public LanguageCurrency language { get; set; }
}
public class TranslationsCurrency
{
}
}

View File

@ -6,38 +6,38 @@ using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class accessory
{
private static string iB;
public static void Gen(string section, int uniquev)
internal class accessory
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8)).lines)
{
double? chaosValue = line.chaosValue;
double num = (double) uniquev;
if (chaosValue.GetValueOrDefault() >= num & chaosValue.HasValue && !stringList.Contains(line.baseType))
private static string iB;
public static void Gen(string section, int uniquev)
{
stringList.Add(line.baseType);
accessory.iB += string.Format(" \"{0}\"", (object) line.baseType);
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(uniquev);
if (chaosValue >= num)
{
stringList.Add(line.baseType);
accessory.iB += string.Format(@" ""{0}""", line.baseType);
}
}
if (accessory.iB == null)
accessory.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + accessory.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_unique.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
}
}
if (accessory.iB == null)
accessory.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + accessory.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_chase.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
}
}
}

View File

@ -12,43 +12,39 @@ using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class armour
{
private static string iB;
public static void Gen(string section, int uniquev)
internal class armour
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8)).lines)
{
int? links = line.links;
int num1 = 5;
if (links.GetValueOrDefault() <= num1 & links.HasValue)
private static string iB;
public static void Gen(string section, int uniquev)
{
double? chaosValue = line.chaosValue;
double num2 = (double) uniquev;
if (chaosValue.GetValueOrDefault() >= num2 & chaosValue.HasValue && !stringList.Contains(line.baseType))
{
stringList.Add(line.baseType);
armour.iB += string.Format(" \"{0}\"", (object) line.baseType);
}
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
List<string> stringList = new List<string>();
foreach (Line line in ln.lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int? links = line.links;
if (chaosValue >= uniquev && !stringList.Contains(line.baseType) && links == null)
{
stringList.Add(line.baseType);
armour.iB += string.Format(@" ""{0}""", line.baseType);
}
}
if (armour.iB == null)
armour.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + armour.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_unique.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
}
}
if (armour.iB == null)
armour.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + armour.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_chase.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,30 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen.generator
{
internal class @base
{
private static string iB;
public static void GenAccessory(string section, int basev)
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(basev);
if (chaosValue >= num)
{
stringList.Add(line.baseType);
@base.iB += string.Format(@" ""{0}""", line.baseType);
}
}
}
}
}

View File

@ -21,13 +21,13 @@ namespace PoE_MxFilterGen.generator
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.card.json", Encoding.UTF8)).lines)
{
double? chaosValue = line.chaosValue;
double num = (double) cardv;
if (chaosValue.GetValueOrDefault() >= num & chaosValue.HasValue && !stringList.Contains(line.name))
{
stringList.Add(line.name);
card.iB += string.Format(" \"{0}\"", (object) line.name);
}
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(cardv);
if (chaosValue >= num)
{
stringList.Add(line.name);
card.iB += string.Format(@" ""{0}""", line.name);
}
}
if (card.iB == null)
card.iB = "\"\"";

View File

@ -21,12 +21,12 @@ namespace PoE_MxFilterGen.generator
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.fossil.json", Encoding.UTF8)).lines)
{
double? chaosValue = line.chaosValue;
double num = (double) fossilv;
if (chaosValue.GetValueOrDefault() >= num & chaosValue.HasValue && !stringList.Contains(line.name))
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(fossilv);
if (chaosValue >= num)
{
stringList.Add(line.name);
fossil.iB += string.Format(" \"{0}\"", (object) line.name);
fossil.iB += string.Format(@" ""{0}""", line.name);
}
}
if (fossil.iB == null)

View File

@ -4,112 +4,177 @@
// MVID: 9686B206-07DB-4C70-B4F4-1F6EF4D87358
// Assembly location: C:\Users\blood\OneDrive\Desktop\mxfiltergen.exe
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class tier
{
private static string iB;
public static void Gen(string section)
{
internal class tier
{
string str = File.ReadAllText("config/Tiers.txt");
if (tier.iB == null)
tier.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " HasExplicitMod \"Veiled\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " FracturedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SynthesisedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Identified True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 0 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Corrupted True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 210 0 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 75" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 100" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 184 218 242" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
private static string iB;
private static string bAxe;
private static string bBow;
private static string bClaw;
private static string bDagger;
private static string bFishing;
private static string bMace;
private static string bSceptre;
private static string bStaff;
private static string bSword;
private static string bWand;
private static string bBody;
private static string bBoots;
private static string bGloves;
private static string bHelmet;
private static string bShield;
private static string bQuiver;
public static void Gen(string section, int tierValue, bool tier1HAxe, bool tier2HAxe, bool tierBow, bool tierClaw, bool tierDagger, bool tier1HMace, bool tier2HMace, bool tierSceptre, bool tierStaff, bool tier1HSword, bool tier2HSword, bool tierWand, bool tierBody, bool tierBoots, bool tierGloves, bool tierHelmet, bool tierShield, bool tierQuiver)
{
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.base.json", Encoding.UTF8));
ForEachLine(ln, "One Handed Axe", tier1HAxe, section, tierValue);
ForEachLine(ln, "Two Handed Axe", tier2HAxe, section, tierValue);
ForEachLine(ln, "Bow", tierBow, section, tierValue);
ForEachLine(ln, "Claw", tierClaw, section, tierValue);
ForEachLine(ln, "Dagger", tierDagger, section, tierValue);
ForEachLine(ln, "One Handed Mace", tier1HMace, section, tierValue);
ForEachLine(ln, "Two Handed Mace", tier2HMace, section, tierValue);
ForEachLine(ln, "Sceptre", tierSceptre, section, tierValue);
ForEachLine(ln, "Staff", tierStaff, section, tierValue);
ForEachLine(ln, "One Handed Sword", tier1HSword, section, tierValue);
ForEachLine(ln, "Two Handed Sword", tier2HSword, section, tierValue);
ForEachLine(ln, "Wand", tierWand, section, tierValue);
ForEachLine(ln, "Body Armour", tierBody, section, tierValue);
ForEachLine(ln, "Boots", tierBoots, section, tierValue);
ForEachLine(ln, "Gloves", tierGloves, section, tierValue);
ForEachLine(ln, "Helmet", tierHelmet, section, tierValue);
ForEachLine(ln, "Shield", tierShield, section, tierValue);
ForEachLine(ln, "Quiver", tierQuiver, section, tierValue);
}
public static void ForEachLine(dynamic lnb, string type, bool tierBool, string section, int tierValue)
{
int c = 0;
if (tierBool)
{
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.base.json", Encoding.UTF8));
foreach (var line in ln.lines)
{
if (line.itemType == type && tierBool && line.levelRequired <= 86 && line.variant == null && line.chaosValue >= tierValue)
{
c++;
iB += string.Format(@" ""{0}""", line.baseType);
}
}
}
if (tierBool && c != 0)
{
GenerateFile(section, iB, type);
}
iB = "";
c = 0;
}
public static void GenerateFile(string section, string iB, string type)
{
if (iB == null)
iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, $"# Section: {section} ({type})" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " HasExplicitMod \"Veiled\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " FracturedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SynthesisedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Identified True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 0 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Corrupted True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 210 0 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 75" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 100" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 184 218 242" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + 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);
}
}
}
}

View File

@ -1,115 +0,0 @@
// Decompiled with JetBrains decompiler
// Type: PoE_MxFilterGen.generator.tier_caster
// Assembly: mxfiltergen, Version=8.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9686B206-07DB-4C70-B4F4-1F6EF4D87358
// Assembly location: C:\Users\blood\OneDrive\Desktop\mxfiltergen.exe
using System;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class tier_caster
{
private static string iB;
public static void Gen(string section)
{
string str = File.ReadAllText("config/Tiers_Caster.txt");
if (tier_caster.iB == null)
tier_caster.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " HasExplicitMod \"Veiled\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " FracturedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SynthesisedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Identified True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 0 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Corrupted True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 210 0 0" + 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);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 75" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 100" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 184 218 242" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + str + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -12,43 +12,39 @@ using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class weapon
{
private static string iB;
public static void Gen(string section, int uniquev)
internal class weapon
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.weapon.json", Encoding.UTF8)).lines)
{
int? links = line.links;
int num1 = 5;
if (links.GetValueOrDefault() <= num1 & links.HasValue)
private static string iB;
public static void Gen(string section, int uniquev)
{
double? chaosValue = line.chaosValue;
double num2 = (double) uniquev;
if (chaosValue.GetValueOrDefault() >= num2 & chaosValue.HasValue && !stringList.Contains(line.baseType))
{
stringList.Add(line.baseType);
weapon.iB += string.Format(" \"{0}\"", (object) line.baseType);
}
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.weapon.json", Encoding.UTF8));
List<string> stringList = new List<string>();
foreach (Line line in ln.lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int? links = line.links;
if (chaosValue >= uniquev && !stringList.Contains(line.baseType) && links == null)
{
stringList.Add(line.baseType);
weapon.iB += string.Format(@" ""{0}""", line.baseType);
}
}
if (weapon.iB == null)
weapon.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + weapon.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_unique.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
}
}
if (weapon.iB == null)
weapon.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("# Section: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + weapon.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_chase.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
}
}
}

View File

@ -10,6 +10,25 @@ namespace PoE_MxFilterGen.json
{
public class SETTINGS
{
public int tierValue { get; set; }
public bool tier1HAxe { get; set; }
public bool tier2HAxe { get; set; }
public bool tierBow { get; set; }
public bool tierClaw { get; set; }
public bool tierDagger { get; set; }
public bool tier1HMace { get; set; }
public bool tier2HMace { get; set; }
public bool tierSceptre { get; set; }
public bool tierStaff { get; set; }
public bool tier1HSword { get; set; }
public bool tier2HSword { get; set; }
public bool tierWand { get; set; }
public bool tierBody { get; set; }
public bool tierBoots { get; set; }
public bool tierGloves { get; set; }
public bool tierHelmet { get; set; }
public bool tierShield { get; set; }
public bool tierQuiver { get; set; }
public int uniqueValue { get; set; }
public int fossilValue { get; set; }
public int cardValue { get; set; }
@ -19,6 +38,11 @@ namespace PoE_MxFilterGen.json
class settings
{
public static int GetTierValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierValue;
}
public static int GetUniqueValue()
{
@ -44,19 +68,145 @@ namespace PoE_MxFilterGen.json
return j.section;
}
internal static bool GetTier1HAxe()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tier1HAxe;
}
internal static bool GetTier2HAxe()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tier2HAxe;
}
internal static bool GetTierBow()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierBow;
}
internal static bool GetTierClaw()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierClaw;
}
internal static bool GetTierDagger()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierDagger;
}
internal static bool GetTier1HMace()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tier1HMace;
}
internal static bool GetTier2HMace()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tier2HMace;
}
internal static bool GetTierSceptre()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierSceptre;
}
internal static bool GetTierStaff()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierStaff;
}
internal static bool GetTier1HSword()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tier1HSword;
}
internal static bool GetTier2HSword()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tier2HSword;
}
internal static bool GetTierWand()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierWand;
}
internal static bool GetTierBody()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierBody;
}
internal static bool GetTierBoots()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierBoots;
}
internal static bool GetTierGloves()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierGloves;
}
internal static bool GetTierHelmet()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierHelmet;
}
internal static bool GetTierShield()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierShield;
}
internal static bool GetTierQuiver()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.tierQuiver;
}
public static void WriteSection(string section)
{
SETTINGS js = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($@"settings.json"));
SETTINGS se = new SETTINGS
{
tierValue = js.tierValue,
tier1HAxe = js.tier1HAxe,
tier2HAxe = js.tier2HAxe,
tierBow = js.tierBow,
tierClaw = js.tierClaw,
tierDagger = js.tierDagger,
tier1HMace = js.tier1HMace,
tier2HMace = js.tier2HMace,
tierSceptre = js.tierSceptre,
tierStaff = js.tierStaff,
tier1HSword = js.tier1HSword,
tier2HSword = js.tier2HSword,
tierWand = js.tierWand,
tierBody = js.tierBody,
tierBoots = js.tierBoots,
tierGloves = js.tierGloves,
tierHelmet = js.tierHelmet,
tierShield = js.tierShield,
tierQuiver = js.tierQuiver,
uniqueValue = js.uniqueValue,
fossilValue = js.fossilValue,
cardValue = js.cardValue,
updateurl = js.updateurl,
section = section
};
var raw = JsonConvert.SerializeObject(se, Formatting.Indented);
File.WriteAllText($@"settings.json", raw);
}
}
}
}

View File

@ -4,16 +4,17 @@ using PoE_MxFilterGen.json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen
{
internal class main
{
private static DateTime dt = DateTime.Now;
public static string version = "9.0.0";
public static string version = "10.5.1";
public static string fDate = string.Format("{0}-{1}-{2}", (object)main.dt.Day, (object)main.dt.Month, (object)main.dt.Year);
public static string api = "";
public static string giturl = "https://git.mxnet.xyz/mikx";
public static string giturl = "https://mxgit.ovh/mikx";
public static string section = "";
public static string league = "";
public static string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
@ -21,21 +22,14 @@ namespace PoE_MxFilterGen
public static int ftotal = 0;
public static int sprog = 0;
public static int stotal = 0;
public static bool deb = false;
public static string[] filters = new string[4]
{
"Normal",
"Strict",
"Strict_NSNLC",
"Strict_Caster"
};
public static bool debug = false;
private static void Main(string[] args)
{
if (!File.Exists("config/mxfiltergen_settings.json"))
{
msg.CMW("ERROR: settings.json not found! Downloading a template...", true, 3);
web.DownloadFile("https://poe.mikx.xyz/mxfilter/data/settings_template.json", "config/mxfiltergen_settings.json");
web.DownloadFile("https://mxpoe.ovh/mxfilter/data/settings_template.json", "config/mxfiltergen_settings.json");
}
msg.Splash();
main.CleanDirData();
@ -55,7 +49,7 @@ namespace PoE_MxFilterGen
msg.CMW("Cleaning the base dirs...", true, 1);
main.CleanDirData();
msg.CMW("Cleaning the last filter from path...", true, 1);
foreach (string filter in main.filters)
foreach (string filter in structures.Filters())
File.Delete("out/MxFilter_" + filter + ".filter");
msg.CMW("Downloading the latest API data from poe.ninja...", true, 1);
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=UniqueArmour&language=en", "data/ninja.armour.json");
@ -64,75 +58,183 @@ namespace PoE_MxFilterGen
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=DivinationCard&language=en", "data/ninja.card.json");
web.SaveString(main.api + "currencyoverview?league=" + main.league + "&type=Currency&language=en", "data/ninja.currency.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=Fossil&language=en", "data/ninja.fossil.json");
foreach (string filter in main.filters)
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=BaseType&language=en", "data/ninja.base.json");
foreach (string filter in structures.Filters())
{
string str = "MxFilter";
main.RootStructure rootStructure = JsonConvert.DeserializeObject<main.RootStructure>(File.ReadAllText("structure/" + filter + ".json"));
msg.CMW(string.Format("Generating the {0} filter using {1} source(s)...", (object)filter, (object)rootStructure.structures.Count), true, 1);
main.ftotal = rootStructure.structures.Count;
foreach (main.STRUCTURE structure in rootStructure.structures)
int sc = structures.Structures().Length;
msg.CMW(string.Format("Generating the {0} filter using {1} source(s)...", filter, sc), true, 1);
main.ftotal = sc;
foreach (var structure in structures.Structures())
{
if (structure.gen)
++main.fprog;
msg.drawProgress(main.fprog, main.ftotal);
settings.WriteSection(structure);
string section = structure;
int fossilValue = settings.GetFossilValue();
int cardValue = settings.GetCardValue();
int uniqueValue = settings.GetUniqueValue();
int tierValue = settings.GetTierValue();
bool tier1HAxe = settings.GetTier1HAxe();
bool tier2HAxe = settings.GetTier2HAxe();
bool tierBow = settings.GetTierBow();
bool tierClaw = settings.GetTierClaw();
bool tierDagger = settings.GetTierDagger();
bool tier1HMace = settings.GetTier1HMace();
bool tier2HMace = settings.GetTier2HMace();
bool tierSceptre = settings.GetTierSceptre();
bool tierStaff = settings.GetTierStaff();
bool tier1HSword = settings.GetTier1HSword();
bool tier2HSword = settings.GetTier2HSword();
bool tierWand = settings.GetTierWand();
bool tierBody = settings.GetTierBody();
bool tierBoots = settings.GetTierBoots();
bool tierGloves = settings.GetTierGloves();
bool tierHelmet = settings.GetTierHelmet();
bool tierShield = settings.GetTierShield();
bool tierQuiver = settings.GetTierQuiver();
switch (structure)
{
++main.fprog;
msg.drawProgress(main.fprog, main.ftotal);
settings.WriteSection(structure.section);
string section = structure.section;
int fossilValue = settings.GetFossilValue();
int cardValue = settings.GetCardValue();
int uniqueValue = settings.GetUniqueValue();
switch (structure.section)
{
case "DIVINATION CARD (GEN)":
card.Gen(section, cardValue);
break;
case "EXPENSIVE UNIQUE (GEN) (Accessories)":
accessory.Gen(section, uniqueValue);
break;
case "EXPENSIVE UNIQUE (GEN) (Armours)":
armour.Gen(section, uniqueValue);
break;
case "EXPENSIVE UNIQUE (GEN) (Weapons)":
weapon.Gen(section, uniqueValue);
break;
case "FOSSIL (GEN)":
fossil.Gen(section, fossilValue);
break;
case "Tiers (DATA)":
tier.Gen(section);
break;
case "Tiers - Caster (DATA)":
tier_caster.Gen(section);
break;
}
}
else
{
++main.fprog;
msg.drawProgress(main.fprog, main.ftotal);
case "DIVINATION CARD (GEN)":
card.Gen(section, cardValue);
break;
case "EXPENSIVE UNIQUE (GEN) (Accessories)":
accessory.Gen(section, uniqueValue);
break;
case "EXPENSIVE UNIQUE (GEN) (Armours)":
armour.Gen(section, uniqueValue);
break;
case "EXPENSIVE UNIQUE (GEN) (Weapons)":
weapon.Gen(section, uniqueValue);
break;
case "FOSSIL (GEN)":
fossil.Gen(section, fossilValue);
break;
case "Tiers (DATA)":
tier.Gen(section, tierValue, tier1HAxe, tier2HAxe, tierBow, tierClaw, tierDagger, tier1HMace, tier2HMace, tierSceptre, tierStaff, tier1HSword, tier2HSword, tierWand, tierBody, tierBoots, tierGloves, tierHelmet, tierShield, tierQuiver);
break;
}
}
msg.CMW("Creating the final filter...", true, 1);
foreach (main.STRUCTURE structure in rootStructure.structures)
foreach (var structure in structures.Structures())
{
if (structure.gen)
switch (structure)
{
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure.section + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
}
else
{
File.AppendAllText("out/" + str + "_" + filter + ".filter", string.Format("# Section: {0}", (object)structure.section) + Environment.NewLine);
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("structure/" + filter + "/" + structure.section + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
case "DIVINATION CARD (GEN)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "EXPENSIVE UNIQUE (GEN) (Accessories)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "EXPENSIVE UNIQUE (GEN) (Armours)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "EXPENSIVE UNIQUE (GEN) (Weapons)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "FOSSIL (GEN)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "Tiers (DATA)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "Tiers - Caster (DATA)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
default:
File.AppendAllText("out/" + str + "_" + filter + ".filter", string.Format("# Section: {0}", (object)structure) + Environment.NewLine);
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("structure/" + filter + "/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
}
}
main.ftotal = 0;
main.fprog = 0;
main.CleanDir();
CurrencyValueOut();
if(debug)
{
Console.ReadKey();
}
}
}
public static void CurrencyValueOut()
{
foreach (LineCurrency line in JsonConvert.DeserializeObject<RootCurrency>(File.ReadAllText("data/ninja.currency.json", Encoding.UTF8)).lines)
{
string currencyTypeName = line.currencyTypeName;
if (currencyTypeName == "Divine Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/divine.txt", fc);
}
if (currencyTypeName == "Exalted Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/exalted.txt", fc);
}
if (currencyTypeName == "Orb of Annulment")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/annulment.txt", fc);
}
if (currencyTypeName == "Orb of Alteration")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/alteration.txt", fc);
}
if (currencyTypeName == "Orb of Fusing")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/fusing.txt", fc);
}
if (currencyTypeName == "Chromatic Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/chromatic.txt", fc);
}
if (currencyTypeName == "Jeweller's Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/jeweller.txt", fc);
}
if (currencyTypeName == "Orb of Alchemy")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/alchemy.txt", fc);
}
if (currencyTypeName == "Cartographer's Chisel")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/chisel.txt", fc);
}
}
}

View File

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
internal class structures
{
public static string[] Filters()
{
string[] Filters = new string[] {
"Normal",
"Strict"
};
return Filters;
}
public static string[] Structures()
{
string[] Structures = new string[] {
"LEAGUE",
"FOSSIL (GEN)",
"FOSSIL",
"MISC",
"ESSENCE",
"SKILL GEM",
"FLASK",
"MAPS",
"JEWEL",
"DIVINATION CARD",
"DIVINATION CARD (GEN)",
"EXPENSIVE UNIQUE (GEN) (Armours)",
"EXPENSIVE UNIQUE (GEN) (Weapons)",
"CURRENCY",
"INFLUENCED",
"ACCESSORIES",
"Tiers (DATA)",
"GEAR BY SOCKET",
"GEAR BY QUALITY",
"RECIPES",
"HIDE",
};
return Structures;
}
}
}