public void BuildImplants(List<Program.Item> items) { List<Implant>[] Implants = new List<Implant>[13] { new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>() }; List<Implant>[] RefinedImplants = new List<Implant>[13] { new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>(), new List<Implant>() }; bool isRefined = false; foreach (Program.Item item in items) { if (Regex.IsMatch(item.Name, "^(A Shining)", RegexOptions.IgnoreCase) || Regex.IsMatch(item.Name, "^A Bright", RegexOptions.IgnoreCase) || Regex.IsMatch(item.Name, "^A Faded", RegexOptions.IgnoreCase)) { continue; } Implant implant = new Implant(); if (Regex.IsMatch(item.Name, "Basic.*Implant", RegexOptions.IgnoreCase)) { string loc = Regex.Match(item.Name, "Basic.*Implant", RegexOptions.IgnoreCase).Value; loc = loc.Substring(6); loc = loc.Remove(loc.Count() - 8); implant.Location = loc; implant.Faded = "Empty"; implant.Bright = "Empty"; implant.Shining = "Empty"; } else if (Regex.IsMatch(item.Name, "Chest Implant: Refined Empty", RegexOptions.IgnoreCase)) { implant.Location = "Chest"; implant.Faded = "Empty"; implant.Bright = "Empty"; implant.Shining = "Empty"; } else if (Regex.IsMatch(item.Name, ".*Implant", RegexOptions.IgnoreCase)) { string loc = Regex.Match(item.Name, ".*Implant", RegexOptions.IgnoreCase).Value; loc = loc.Remove(loc.Count() - 8); implant.Location = loc.Trim(); string faded = Regex.Match(item.Description, "Faded NanoCluster: .*?\n", RegexOptions.IgnoreCase).Value; if (faded.Count() > 19) { faded = faded.Substring(19).Trim(); implant.Faded = faded; } else implant.Faded = ""; string bright = Regex.Match(item.Description, "Bright NanoCluster: .*?\n", RegexOptions.IgnoreCase).Value; if (bright.Count() > 20) { bright = bright.Substring(20).Trim(); implant.Bright = bright; } else implant.Bright = ""; string shining = Regex.Match(item.Description, "Shining NanoCluster: .*?\n", RegexOptions.IgnoreCase).Value; if (shining.Count() > 21) { shining = shining.Substring(21).Trim(); implant.Shining = shining; } else implant.Shining = ""; } implant.Name = item.Name; implant.HighID = item.AOID; implant.LowID = item.AOID - 1; if (item.QL == 300) { isRefined = true; #region Switch switch (implant.Location.ToLower()) { case "eye": RefinedImplants[0].Add(implant); break; case "head": RefinedImplants[1].Add(implant); break; case "ear": RefinedImplants[2].Add(implant); break; case "right-arm": RefinedImplants[3].Add(implant); break; case "chest": RefinedImplants[4].Add(implant); break; case "left-arm": RefinedImplants[5].Add(implant); break; case "right-wrist": RefinedImplants[6].Add(implant); break; case "waist": RefinedImplants[7].Add(implant); break; case "left-wrist": RefinedImplants[8].Add(implant); break; case "right-hand": RefinedImplants[9].Add(implant); break; case "leg": RefinedImplants[10].Add(implant); break; case "left-hand": RefinedImplants[11].Add(implant); break; case "feet": RefinedImplants[12].Add(implant); break; } #endregion } else if (item.QL == 200) { isHigh = false; #region Switch switch (implant.Location.ToLower()) { case "eye": Implants[0].Add(implant); break; case "head": Implants[1].Add(implant); break; case "ear": Implants[2].Add(implant); break; case "right-arm": Implants[3].Add(implant); break; case "chest": Implants[4].Add(implant); break; case "left-arm": Implants[5].Add(implant); break; case "right-wrist": Implants[6].Add(implant); break; case "waist": Implants[7].Add(implant); break; case "left-wrist": Implants[8].Add(implant); break; case "right-hand": Implants[9].Add(implant); break; case "leg": Implants[10].Add(implant); break; case "left-hand": Implants[11].Add(implant); break; case "feet": Implants[12].Add(implant); break; } #endregion } } if (!isRefined) { Program.EyeImplants = Implants[0]; Program.HeadImplants = Implants[1]; Program.EarImplants = Implants[2]; Program.RightArmImplants = Implants[3]; Program.ChestImplants = Implants[4]; Program.LeftArmImplants = Implants[5]; Program.RightWristImplants = Implants[6]; Program.WaistImplants = Implants[7]; Program.LeftWristImplants = Implants[8]; Program.RightHandImplants = Implants[9]; Program.LegImplants = Implants[10]; Program.LeftHandImplants = Implants[11]; Program.FeetImplants = Implants[12]; } if (isRefined) { Program.RefinedEyeImplants = RefinedImplants[0]; Program.RefinedHeadImplants = RefinedImplants[1]; Program.RefinedEarImplants = RefinedImplants[2]; Program.RefinedRightArmImplants = RefinedImplants[3]; Program.RefinedChestImplants = RefinedImplants[4]; Program.RefinedLeftArmImplants = RefinedImplants[5]; Program.RefinedRightWristImplants = RefinedImplants[6]; Program.RefinedWaistImplants = RefinedImplants[7]; Program.RefinedLeftWristImplants = RefinedImplants[8]; Program.RefinedRightHandImplants = RefinedImplants[9]; Program.RefinedLegImplants = RefinedImplants[10]; Program.RefinedLeftHandImplants = RefinedImplants[11]; Program.RefinedFeetImplants = RefinedImplants[12]; } }
public Tradeskill(Cluster cluster, Implant implant, Implant result) { StreamWriter sw = new StreamWriter(Environment.CurrentDirectory + @"\implants.txt", true, Encoding.GetEncoding("windows-1252")); sw.AutoFlush = true; string skills = "160"; string percent = string.Empty; string bump = ""; switch (cluster.Type) { case "Faded": if (cluster.isJobe == true) bump = "200"; else bump = "100"; break; case "Bright": if (cluster.isJobe == true) bump = "300"; else bump = "200"; break; case "Shining": if (cluster.isJobe == true) bump = "400"; else bump = "300"; break; } int minxp = 50; int maxxp = 50; int range; var l1 = from m in NPMult where m.Key == cluster.Skill select m; var l2 = from m in Type where m.Key == cluster.Type select m; percent = Math.Round(l1.ElementAt(0).Value * l2.ElementAt(0).Value).ToString(); if (cluster.MaxQL == 200) { minxp = 5; maxxp = 1000; } else { minxp = 1005; maxxp = 1500; } if (cluster.Type == "Faded") { range = 18; } else if (cluster.Type == "Bright") { range = 16; } else { range = 14; } // COLS: // SrcHighID // TgtHighID // SrcName // TgtName // ResName // ResLowID // ResHighID // SkillsIds // SkillReqs // SkillBumps // MaxBump // MinXP // MaxXP switch (cluster.Skill) { case "% Add All Def.": case "% Add All Off": case "% Add. Xp": case "Nano Formula Interrupt Modifier": case "Skill Time Lock Modifier": { if (cluster.Type == "Faded") { skills += ",162"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",162"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",162"; percent += ",625"; bump += "," + bump; } } break; case "% Add. Chem. Dam.": case "% Add. Energy Dam.": case "% Add. Fire Dam.": case "% Add. Melee Dam.": case "% Add. Poison Dam.": case "% Add. Proj. Dam.": case "% Add.Rad. Dam.": case "Shield Chemical AC": case "Shield Cold AC": case "Shield Energy AC": case "Shield Fire AC": case "Shield Melee AC": case "Shield Poison AC": case "Shield Projectile AC": case "Shield Radiation AC": case "Nano Point Cost Modifier": { if (cluster.Type == "Faded") { skills += ",157"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",157"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",157"; percent += ",625"; bump += "," + bump; } } break; case "Heal Delta": { if (cluster.Type == "Faded") { skills += ",159"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",159"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",159"; percent += ",625"; bump += "," + bump; } } break; case "Nano Regeneration": { if (cluster.Type == "Faded") { skills += ",159"; percent += ",275"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",159"; percent += ",400"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",159"; percent += ",525"; bump += "," + bump; } } break; case "Max NCU": { if (cluster.Type == "Faded") { skills += ",161"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",161"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",161"; percent += ",625"; bump += "," + bump; } } break; case "RangeInc. NF": { if (cluster.Type == "Faded") { skills = "160"; percent = "325"; } else if (cluster.Type == "Bright") { skills = "160"; percent = "475"; } else if (cluster.Type == "Shining") { skills = "160"; percent = "625"; } } break; case "RangeInc. Weapon": { // WS if (cluster.Type == "Faded") { skills += ",158"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",158"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",158"; percent += ",625"; bump += "," + bump; } } break; default: break; } sw.WriteLine("INSERT INTO `tradeskill` VALUES (" + cluster.HighID + "," + implant.HighID + ",0," + "\'" + result.LowID + "," + result.HighID + "\'," + range + ",3,\"" + skills + "\",\"" + percent + "\",\"" + bump + "\",5," + minxp + "," + maxxp + ",1);"); sw.Close(); sw.Dispose(); }
public Tradeskill(Cluster cluster, Implant implant, Implant result) { StreamWriter sw = new StreamWriter(Environment.CurrentDirectory + @"\implants.txt", true, Encoding.GetEncoding("windows-1252")); sw.AutoFlush = true; string skills = "160"; string percent = string.Empty; string bump = ""; switch (cluster.Type) { case "Faded": if (cluster.isJobe == true) { bump = "200"; } else { bump = "100"; } break; case "Bright": if (cluster.isJobe == true) { bump = "300"; } else { bump = "200"; } break; case "Shining": if (cluster.isJobe == true) { bump = "400"; } else { bump = "300"; } break; } int minxp = 50; int maxxp = 50; int range; var l1 = from m in NPMult where m.Key == cluster.Skill select m; var l2 = from m in Type where m.Key == cluster.Type select m; percent = Math.Round(l1.ElementAt(0).Value *l2.ElementAt(0).Value).ToString(); if (cluster.MaxQL == 200) { minxp = 5; maxxp = 1000; } else { minxp = 1005; maxxp = 1500; } if (cluster.Type == "Faded") { range = 18; } else if (cluster.Type == "Bright") { range = 16; } else { range = 14; } // COLS: // SrcHighID // TgtHighID // SrcName // TgtName // ResName // ResLowID // ResHighID // SkillsIds // SkillReqs // SkillBumps // MaxBump // MinXP // MaxXP switch (cluster.Skill) { case "% Add All Def.": case "% Add All Off": case "% Add. Xp": case "Nano Formula Interrupt Modifier": case "Skill Time Lock Modifier": { if (cluster.Type == "Faded") { skills += ",162"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",162"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",162"; percent += ",625"; bump += "," + bump; } } break; case "% Add. Chem. Dam.": case "% Add. Energy Dam.": case "% Add. Fire Dam.": case "% Add. Melee Dam.": case "% Add. Poison Dam.": case "% Add. Proj. Dam.": case "% Add.Rad. Dam.": case "Shield Chemical AC": case "Shield Cold AC": case "Shield Energy AC": case "Shield Fire AC": case "Shield Melee AC": case "Shield Poison AC": case "Shield Projectile AC": case "Shield Radiation AC": case "Nano Point Cost Modifier": { if (cluster.Type == "Faded") { skills += ",157"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",157"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",157"; percent += ",625"; bump += "," + bump; } } break; case "Heal Delta": { if (cluster.Type == "Faded") { skills += ",159"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",159"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",159"; percent += ",625"; bump += "," + bump; } } break; case "Nano Regeneration": { if (cluster.Type == "Faded") { skills += ",159"; percent += ",275"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",159"; percent += ",400"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",159"; percent += ",525"; bump += "," + bump; } } break; case "Max NCU": { if (cluster.Type == "Faded") { skills += ",161"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",161"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",161"; percent += ",625"; bump += "," + bump; } } break; case "RangeInc. NF": { if (cluster.Type == "Faded") { skills = "160"; percent = "325"; } else if (cluster.Type == "Bright") { skills = "160"; percent = "475"; } else if (cluster.Type == "Shining") { skills = "160"; percent = "625"; } } break; case "RangeInc. Weapon": { // WS if (cluster.Type == "Faded") { skills += ",158"; percent += ",325"; bump += "," + bump; } else if (cluster.Type == "Bright") { skills += ",158"; percent += ",475"; bump += "," + bump; } else if (cluster.Type == "Shining") { skills += ",158"; percent += ",625"; bump += "," + bump; } } break; default: break; } sw.WriteLine("INSERT INTO `tradeskill` VALUES (" + cluster.HighID + "," + implant.HighID + ",0," + "\'" + result.LowID + "," + result.HighID + "\'," + range + ",3,\"" + skills + "\",\"" + percent + "\",\"" + bump + "\",5," + minxp + "," + maxxp + ",1);"); sw.Close(); sw.Dispose(); }
static void Main(string[] args) { XmlReader reader = XmlReader.Create(new FileStream(Environment.CurrentDirectory + @"\Items.xml", FileMode.Open, FileAccess.Read)); while (reader.Read()) { if (reader.Name == "Item") { Item item = new Item(); reader.MoveToAttribute("AOID"); item.AOID = Convert.ToInt32(reader.Value); reader.MoveToAttribute("Name"); item.Name = reader.Value; reader.MoveToAttribute("QL"); item.QL = Convert.ToInt32(reader.Value); reader.MoveToAttribute("ItemType"); item.Type = reader.Value; while (reader.Read()) { if (reader.Name == "Description") { item.Description = reader.ReadElementString(); if (item.Type == "Implant") { if (Regex.IsMatch(item.Description, "Shining NanoCluster", RegexOptions.IgnoreCase)) { if (Regex.IsMatch(item.Name, "Refined", RegexOptions.IgnoreCase)) { RefinedImplants.Add(item); } else { Implants.Add(item); } } } else if (item.Type == "Misc" && Regex.IsMatch(item.Description, "can be used with any.*?implant", RegexOptions.IgnoreCase)) { if (Regex.IsMatch(item.Name, "Refined", RegexOptions.IgnoreCase)) { RefinedClusters.Add(item); } else { Clusters.Add(item); } } break; } } while (reader.Name != "Item") { reader.Read(); } } } Cluster c = new Cluster(); c.BuildClusters(Clusters); c.BuildClusters(RefinedClusters); Implant i = new Implant(); i.BuildImplants(Implants); i.BuildImplants(RefinedImplants); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("==============CLUSTERS=============="); Console.WriteLine(); Console.WriteLine("Eye Clusters:\t\t\t{0}", EyeClusters.Count); Console.WriteLine("Refined Eye Clusters:\t\t{0}", RefinedEyeClusters.Count); Console.WriteLine("Head Clusters:\t\t\t{0}", HeadClusters.Count); Console.WriteLine("Refined Head Clusters:\t\t{0}", RefinedHeadClusters.Count); Console.WriteLine("Ear Clusters:\t\t\t{0}", EarClusters.Count); Console.WriteLine("Refined Ear Clusters:\t\t{0}", RefinedEarClusters.Count); Console.WriteLine("Right-Arm Clusters:\t\t{0}", RightArmClusters.Count); Console.WriteLine("Refined Right-Arm Clusters:\t{0}", RefinedRightArmClusters.Count); Console.WriteLine("Chest Clusters:\t\t\t{0}", ChestClusters.Count); Console.WriteLine("Refined Chest Clusters:\t\t{0}", RefinedChestClusters.Count); Console.WriteLine("Left-Arm Clusters:\t\t{0}", LeftArmClusters.Count); Console.WriteLine("Refined Left-Arm Clusters:\t{0}", RefinedLeftArmClusters.Count); Console.WriteLine("Right-Wrist Clusters:\t\t{0}", RightWristClusters.Count); Console.WriteLine("Refined Right-Wrist Clusters:\t{0}", RefinedRightWristClusters.Count); Console.WriteLine("Waist Clusters:\t\t\t{0}", WaistClusters.Count); Console.WriteLine("Refined Waist Clusters:\t\t{0}", RefinedWaistClusters.Count); Console.WriteLine("Left-Wrist Clusters:\t\t{0}", LeftWristClusters.Count); Console.WriteLine("Refined Left-Wrist Clusters:\t{0}", RefinedLeftWristClusters.Count); Console.WriteLine("Right-Hand Clusters:\t\t{0}", RightHandClusters.Count); Console.WriteLine("Refined Right-Hand Clusters:\t{0}", RefinedRightHandClusters.Count); Console.WriteLine("Leg Clusters:\t\t\t{0}", LegClusters.Count); Console.WriteLine("Refined Leg Clusters:\t\t{0}", RefinedLegClusters.Count); Console.WriteLine("Left-Hand Clusters:\t\t{0}", LeftHandClusters.Count); Console.WriteLine("Refined Left-Hand Clusters:\t{0}", RefinedLeftHandClusters.Count); Console.WriteLine("Feet Clusters:\t\t\t{0}", FeetClusters.Count); Console.WriteLine("Refined Feet Clusters:\t\t{0}", RefinedFeetClusters.Count); Console.WriteLine(); Console.WriteLine("==============CLUSTERS=============="); Console.WriteLine(); Console.WriteLine("==============IMPLANTS=============="); Console.WriteLine(); Console.WriteLine("Eye Implants:\t\t\t{0}", EyeImplants.Count); Console.WriteLine("Refined Eye Implants:\t\t{0}", RefinedEyeImplants.Count); Console.WriteLine("Head Implants:\t\t\t{0}", HeadImplants.Count); Console.WriteLine("Refined Head Implants:\t\t{0}", RefinedHeadImplants.Count); Console.WriteLine("Ear Implants:\t\t\t{0}", EarImplants.Count); Console.WriteLine("Refined Ear Implants:\t\t{0}", RefinedEarImplants.Count); Console.WriteLine("Right-Arm Implants:\t\t{0}", RightArmImplants.Count); Console.WriteLine("Refined Right-Arm Implants:\t{0}", RefinedRightArmImplants.Count); Console.WriteLine("Chest Implants:\t\t\t{0}", ChestImplants.Count); Console.WriteLine("Refined Chest Implants:\t\t{0}", RefinedChestImplants.Count); Console.WriteLine("Left-Arm Implants:\t\t{0}", LeftArmImplants.Count); Console.WriteLine("Refined Left-Arm Implants:\t{0}", RefinedLeftArmImplants.Count); Console.WriteLine("Right-Wrist Implants:\t\t{0}", RightWristImplants.Count); Console.WriteLine("Refined Right-Wrist Implants:\t{0}", RefinedRightWristImplants.Count); Console.WriteLine("Waist Implants:\t\t\t{0}", WaistImplants.Count); Console.WriteLine("Refined Waist Implants:\t\t{0}", RefinedWaistImplants.Count); Console.WriteLine("Left-Wrist Implants:\t\t{0}", LeftWristImplants.Count); Console.WriteLine("Refined Left-Wrist Implants:\t{0}", RefinedLeftWristImplants.Count); Console.WriteLine("Right-Hand Implants:\t\t{0}", RightHandImplants.Count); Console.WriteLine("Refined Right-Hand Implants:\t{0}", RefinedRightHandImplants.Count); Console.WriteLine("Leg Implants:\t\t\t{0}", LegImplants.Count); Console.WriteLine("Refined Leg Implants:\t\t{0}", RefinedLegImplants.Count); Console.WriteLine("Left-Hand Implants:\t\t{0}", LeftHandImplants.Count); Console.WriteLine("Refined Left-Hand Implants:\t{0}", RefinedLeftHandImplants.Count); Console.WriteLine("Feet Implants:\t\t\t{0}", FeetImplants.Count); Console.WriteLine("Refined Feet Implants:\t\t{0}", RefinedFeetImplants.Count); Console.WriteLine(); Console.WriteLine("==============IMPLANTS=============="); Console.ResetColor(); Console.WriteLine(); Builder.Disassemble(EyeImplants); Builder.Disassemble(HeadImplants); Builder.Disassemble(EarImplants); Builder.Disassemble(RightArmImplants); Builder.Disassemble(ChestImplants); Builder.Disassemble(LeftArmImplants); Builder.Disassemble(RightWristImplants); Builder.Disassemble(WaistImplants); Builder.Disassemble(LeftWristImplants); Builder.Disassemble(RightHandImplants); Builder.Disassemble(LegImplants); Builder.Disassemble(LeftHandImplants); Builder.Disassemble(FeetImplants); Builder.PopulateDictionary(); Tradeskill.PopulateTypes(); Tradeskill.PopulateNanoProgrammingMultiplier(); //Builder.Build(EyeClusters, EyeImplants); //Builder.Build(RefinedEyeClusters, RefinedEyeImplants); //Builder.Build(HeadClusters, HeadImplants); //Builder.Build(RefinedHeadClusters, RefinedHeadImplants); //Builder.Build(EarClusters, EarImplants); //Builder.Build(RefinedEarClusters, RefinedEarImplants); //Builder.Build(RightArmClusters, RightArmImplants); //Builder.Build(RefinedRightArmClusters, RefinedRightArmImplants); //Builder.Build(ChestClusters, ChestImplants); //Builder.Build(RefinedChestClusters, RefinedChestImplants); //Builder.Build(LeftArmClusters, LeftArmImplants); //Builder.Build(RefinedLeftArmClusters, RefinedLeftArmImplants); //Builder.Build(RightWristClusters, RightWristImplants); //Builder.Build(RefinedRightWristClusters, RefinedRightWristImplants); //Builder.Build(WaistClusters, WaistImplants); //Builder.Build(RefinedWaistClusters, RefinedWaistImplants); //Builder.Build(LeftWristClusters, LeftWristImplants); //Builder.Build(RefinedLeftWristClusters, RefinedLeftWristImplants); //Builder.Build(RightHandClusters, RightHandImplants); //Builder.Build(RefinedRightHandClusters, RefinedRightHandImplants); //Builder.Build(LegClusters, LegImplants); //Builder.Build(RefinedLegClusters, RefinedLegImplants); //Builder.Build(LeftHandClusters, LeftHandImplants); //Builder.Build(RefinedLeftHandClusters, RefinedLeftHandImplants); //Builder.Build(FeetClusters, FeetImplants); //Builder.Build(RefinedFeetClusters, RefinedFeetImplants); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("\nComplete..."); Console.ResetColor(); reader.Close(); Console.ReadLine(); }
public void BuildImplants(List <Program.Item> items) { List <Implant>[] Implants = new List <Implant>[13] { new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>() }; List <Implant>[] RefinedImplants = new List <Implant>[13] { new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>(), new List <Implant>() }; bool isRefined = false; foreach (Program.Item item in items) { if (Regex.IsMatch(item.Name, "^(A Shining)", RegexOptions.IgnoreCase) || Regex.IsMatch(item.Name, "^A Bright", RegexOptions.IgnoreCase) || Regex.IsMatch(item.Name, "^A Faded", RegexOptions.IgnoreCase)) { continue; } Implant implant = new Implant(); if (Regex.IsMatch(item.Name, "Basic.*Implant", RegexOptions.IgnoreCase)) { string loc = Regex.Match(item.Name, "Basic.*Implant", RegexOptions.IgnoreCase).Value; loc = loc.Substring(6); loc = loc.Remove(loc.Count() - 8); implant.Location = loc; implant.Faded = "Empty"; implant.Bright = "Empty"; implant.Shining = "Empty"; } else if (Regex.IsMatch(item.Name, "Chest Implant: Refined Empty", RegexOptions.IgnoreCase)) { implant.Location = "Chest"; implant.Faded = "Empty"; implant.Bright = "Empty"; implant.Shining = "Empty"; } else if (Regex.IsMatch(item.Name, ".*Implant", RegexOptions.IgnoreCase)) { string loc = Regex.Match(item.Name, ".*Implant", RegexOptions.IgnoreCase).Value; loc = loc.Remove(loc.Count() - 8); implant.Location = loc.Trim(); string faded = Regex.Match(item.Description, "Faded NanoCluster: .*?\n", RegexOptions.IgnoreCase).Value; if (faded.Count() > 19) { faded = faded.Substring(19).Trim(); implant.Faded = faded; } else { implant.Faded = ""; } string bright = Regex.Match(item.Description, "Bright NanoCluster: .*?\n", RegexOptions.IgnoreCase).Value; if (bright.Count() > 20) { bright = bright.Substring(20).Trim(); implant.Bright = bright; } else { implant.Bright = ""; } string shining = Regex.Match(item.Description, "Shining NanoCluster: .*?\n", RegexOptions.IgnoreCase).Value; if (shining.Count() > 21) { shining = shining.Substring(21).Trim(); implant.Shining = shining; } else { implant.Shining = ""; } } implant.Name = item.Name; implant.HighID = item.AOID; implant.LowID = item.AOID - 1; if (item.QL == 300) { isRefined = true; #region Switch switch (implant.Location.ToLower()) { case "eye": RefinedImplants[0].Add(implant); break; case "head": RefinedImplants[1].Add(implant); break; case "ear": RefinedImplants[2].Add(implant); break; case "right-arm": RefinedImplants[3].Add(implant); break; case "chest": RefinedImplants[4].Add(implant); break; case "left-arm": RefinedImplants[5].Add(implant); break; case "right-wrist": RefinedImplants[6].Add(implant); break; case "waist": RefinedImplants[7].Add(implant); break; case "left-wrist": RefinedImplants[8].Add(implant); break; case "right-hand": RefinedImplants[9].Add(implant); break; case "leg": RefinedImplants[10].Add(implant); break; case "left-hand": RefinedImplants[11].Add(implant); break; case "feet": RefinedImplants[12].Add(implant); break; } #endregion } else if (item.QL == 200) { isHigh = false; #region Switch switch (implant.Location.ToLower()) { case "eye": Implants[0].Add(implant); break; case "head": Implants[1].Add(implant); break; case "ear": Implants[2].Add(implant); break; case "right-arm": Implants[3].Add(implant); break; case "chest": Implants[4].Add(implant); break; case "left-arm": Implants[5].Add(implant); break; case "right-wrist": Implants[6].Add(implant); break; case "waist": Implants[7].Add(implant); break; case "left-wrist": Implants[8].Add(implant); break; case "right-hand": Implants[9].Add(implant); break; case "leg": Implants[10].Add(implant); break; case "left-hand": Implants[11].Add(implant); break; case "feet": Implants[12].Add(implant); break; } #endregion } } if (!isRefined) { Program.EyeImplants = Implants[0]; Program.HeadImplants = Implants[1]; Program.EarImplants = Implants[2]; Program.RightArmImplants = Implants[3]; Program.ChestImplants = Implants[4]; Program.LeftArmImplants = Implants[5]; Program.RightWristImplants = Implants[6]; Program.WaistImplants = Implants[7]; Program.LeftWristImplants = Implants[8]; Program.RightHandImplants = Implants[9]; Program.LegImplants = Implants[10]; Program.LeftHandImplants = Implants[11]; Program.FeetImplants = Implants[12]; } if (isRefined) { Program.RefinedEyeImplants = RefinedImplants[0]; Program.RefinedHeadImplants = RefinedImplants[1]; Program.RefinedEarImplants = RefinedImplants[2]; Program.RefinedRightArmImplants = RefinedImplants[3]; Program.RefinedChestImplants = RefinedImplants[4]; Program.RefinedLeftArmImplants = RefinedImplants[5]; Program.RefinedRightWristImplants = RefinedImplants[6]; Program.RefinedWaistImplants = RefinedImplants[7]; Program.RefinedLeftWristImplants = RefinedImplants[8]; Program.RefinedRightHandImplants = RefinedImplants[9]; Program.RefinedLegImplants = RefinedImplants[10]; Program.RefinedLeftHandImplants = RefinedImplants[11]; Program.RefinedFeetImplants = RefinedImplants[12]; } }
static void Main(string[] args) { XmlReader reader = XmlReader.Create(new FileStream(Environment.CurrentDirectory + @"\Items.xml", FileMode.Open, FileAccess.Read)); while (reader.Read()) { if (reader.Name == "Item") { Item item = new Item(); reader.MoveToAttribute("AOID"); item.AOID = Convert.ToInt32(reader.Value); reader.MoveToAttribute("Name"); item.Name = reader.Value; reader.MoveToAttribute("QL"); item.QL = Convert.ToInt32(reader.Value); reader.MoveToAttribute("ItemType"); item.Type = reader.Value; while (reader.Read()) { if (reader.Name == "Description") { item.Description = reader.ReadElementString(); if (item.Type == "Implant") { if (Regex.IsMatch(item.Description, "Shining NanoCluster", RegexOptions.IgnoreCase)) { if (Regex.IsMatch(item.Name, "Refined", RegexOptions.IgnoreCase)) { RefinedImplants.Add(item); } else Implants.Add(item); } } else if (item.Type == "Misc" && Regex.IsMatch(item.Description, "can be used with any.*?implant", RegexOptions.IgnoreCase)) { if (Regex.IsMatch(item.Name, "Refined", RegexOptions.IgnoreCase)) { RefinedClusters.Add(item); } else Clusters.Add(item); } break; } } while (reader.Name != "Item") { reader.Read(); } } } Cluster c = new Cluster(); c.BuildClusters(Clusters); c.BuildClusters(RefinedClusters); Implant i = new Implant(); i.BuildImplants(Implants); i.BuildImplants(RefinedImplants); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("==============CLUSTERS=============="); Console.WriteLine(); Console.WriteLine("Eye Clusters:\t\t\t{0}", EyeClusters.Count); Console.WriteLine("Refined Eye Clusters:\t\t{0}", RefinedEyeClusters.Count); Console.WriteLine("Head Clusters:\t\t\t{0}", HeadClusters.Count); Console.WriteLine("Refined Head Clusters:\t\t{0}", RefinedHeadClusters.Count); Console.WriteLine("Ear Clusters:\t\t\t{0}", EarClusters.Count); Console.WriteLine("Refined Ear Clusters:\t\t{0}", RefinedEarClusters.Count); Console.WriteLine("Right-Arm Clusters:\t\t{0}", RightArmClusters.Count); Console.WriteLine("Refined Right-Arm Clusters:\t{0}", RefinedRightArmClusters.Count); Console.WriteLine("Chest Clusters:\t\t\t{0}", ChestClusters.Count); Console.WriteLine("Refined Chest Clusters:\t\t{0}", RefinedChestClusters.Count); Console.WriteLine("Left-Arm Clusters:\t\t{0}", LeftArmClusters.Count); Console.WriteLine("Refined Left-Arm Clusters:\t{0}", RefinedLeftArmClusters.Count); Console.WriteLine("Right-Wrist Clusters:\t\t{0}", RightWristClusters.Count); Console.WriteLine("Refined Right-Wrist Clusters:\t{0}", RefinedRightWristClusters.Count); Console.WriteLine("Waist Clusters:\t\t\t{0}", WaistClusters.Count); Console.WriteLine("Refined Waist Clusters:\t\t{0}", RefinedWaistClusters.Count); Console.WriteLine("Left-Wrist Clusters:\t\t{0}", LeftWristClusters.Count); Console.WriteLine("Refined Left-Wrist Clusters:\t{0}", RefinedLeftWristClusters.Count); Console.WriteLine("Right-Hand Clusters:\t\t{0}", RightHandClusters.Count); Console.WriteLine("Refined Right-Hand Clusters:\t{0}", RefinedRightHandClusters.Count); Console.WriteLine("Leg Clusters:\t\t\t{0}", LegClusters.Count); Console.WriteLine("Refined Leg Clusters:\t\t{0}", RefinedLegClusters.Count); Console.WriteLine("Left-Hand Clusters:\t\t{0}", LeftHandClusters.Count); Console.WriteLine("Refined Left-Hand Clusters:\t{0}", RefinedLeftHandClusters.Count); Console.WriteLine("Feet Clusters:\t\t\t{0}", FeetClusters.Count); Console.WriteLine("Refined Feet Clusters:\t\t{0}", RefinedFeetClusters.Count); Console.WriteLine(); Console.WriteLine("==============CLUSTERS=============="); Console.WriteLine(); Console.WriteLine("==============IMPLANTS=============="); Console.WriteLine(); Console.WriteLine("Eye Implants:\t\t\t{0}", EyeImplants.Count); Console.WriteLine("Refined Eye Implants:\t\t{0}", RefinedEyeImplants.Count); Console.WriteLine("Head Implants:\t\t\t{0}", HeadImplants.Count); Console.WriteLine("Refined Head Implants:\t\t{0}", RefinedHeadImplants.Count); Console.WriteLine("Ear Implants:\t\t\t{0}", EarImplants.Count); Console.WriteLine("Refined Ear Implants:\t\t{0}", RefinedEarImplants.Count); Console.WriteLine("Right-Arm Implants:\t\t{0}", RightArmImplants.Count); Console.WriteLine("Refined Right-Arm Implants:\t{0}", RefinedRightArmImplants.Count); Console.WriteLine("Chest Implants:\t\t\t{0}", ChestImplants.Count); Console.WriteLine("Refined Chest Implants:\t\t{0}", RefinedChestImplants.Count); Console.WriteLine("Left-Arm Implants:\t\t{0}", LeftArmImplants.Count); Console.WriteLine("Refined Left-Arm Implants:\t{0}", RefinedLeftArmImplants.Count); Console.WriteLine("Right-Wrist Implants:\t\t{0}", RightWristImplants.Count); Console.WriteLine("Refined Right-Wrist Implants:\t{0}", RefinedRightWristImplants.Count); Console.WriteLine("Waist Implants:\t\t\t{0}", WaistImplants.Count); Console.WriteLine("Refined Waist Implants:\t\t{0}", RefinedWaistImplants.Count); Console.WriteLine("Left-Wrist Implants:\t\t{0}", LeftWristImplants.Count); Console.WriteLine("Refined Left-Wrist Implants:\t{0}", RefinedLeftWristImplants.Count); Console.WriteLine("Right-Hand Implants:\t\t{0}", RightHandImplants.Count); Console.WriteLine("Refined Right-Hand Implants:\t{0}", RefinedRightHandImplants.Count); Console.WriteLine("Leg Implants:\t\t\t{0}", LegImplants.Count); Console.WriteLine("Refined Leg Implants:\t\t{0}", RefinedLegImplants.Count); Console.WriteLine("Left-Hand Implants:\t\t{0}", LeftHandImplants.Count); Console.WriteLine("Refined Left-Hand Implants:\t{0}", RefinedLeftHandImplants.Count); Console.WriteLine("Feet Implants:\t\t\t{0}", FeetImplants.Count); Console.WriteLine("Refined Feet Implants:\t\t{0}", RefinedFeetImplants.Count); Console.WriteLine(); Console.WriteLine("==============IMPLANTS=============="); Console.ResetColor(); Console.WriteLine(); Builder.Disassemble(EyeImplants); Builder.Disassemble(HeadImplants); Builder.Disassemble(EarImplants); Builder.Disassemble(RightArmImplants); Builder.Disassemble(ChestImplants); Builder.Disassemble(LeftArmImplants); Builder.Disassemble(RightWristImplants); Builder.Disassemble(WaistImplants); Builder.Disassemble(LeftWristImplants); Builder.Disassemble(RightHandImplants); Builder.Disassemble(LegImplants); Builder.Disassemble(LeftHandImplants); Builder.Disassemble(FeetImplants); Builder.PopulateDictionary(); Tradeskill.PopulateTypes(); Tradeskill.PopulateNanoProgrammingMultiplier(); //Builder.Build(EyeClusters, EyeImplants); //Builder.Build(RefinedEyeClusters, RefinedEyeImplants); //Builder.Build(HeadClusters, HeadImplants); //Builder.Build(RefinedHeadClusters, RefinedHeadImplants); //Builder.Build(EarClusters, EarImplants); //Builder.Build(RefinedEarClusters, RefinedEarImplants); //Builder.Build(RightArmClusters, RightArmImplants); //Builder.Build(RefinedRightArmClusters, RefinedRightArmImplants); //Builder.Build(ChestClusters, ChestImplants); //Builder.Build(RefinedChestClusters, RefinedChestImplants); //Builder.Build(LeftArmClusters, LeftArmImplants); //Builder.Build(RefinedLeftArmClusters, RefinedLeftArmImplants); //Builder.Build(RightWristClusters, RightWristImplants); //Builder.Build(RefinedRightWristClusters, RefinedRightWristImplants); //Builder.Build(WaistClusters, WaistImplants); //Builder.Build(RefinedWaistClusters, RefinedWaistImplants); //Builder.Build(LeftWristClusters, LeftWristImplants); //Builder.Build(RefinedLeftWristClusters, RefinedLeftWristImplants); //Builder.Build(RightHandClusters, RightHandImplants); //Builder.Build(RefinedRightHandClusters, RefinedRightHandImplants); //Builder.Build(LegClusters, LegImplants); //Builder.Build(RefinedLegClusters, RefinedLegImplants); //Builder.Build(LeftHandClusters, LeftHandImplants); //Builder.Build(RefinedLeftHandClusters, RefinedLeftHandImplants); //Builder.Build(FeetClusters, FeetImplants); //Builder.Build(RefinedFeetClusters, RefinedFeetImplants); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("\nComplete..."); Console.ResetColor(); reader.Close(); Console.ReadLine(); }