I got tired of alt-tabbing after each boss to see if the items dropped are an upgrade so I wrote a short program that opens the upgrade xml file and converts it into a lua saved variable file for LootPlan addon. It's not release quality as it is hardcoded for my case, but I've decided to share the source in case anyone finds it useful. All you need to do is add a reference to Rawr.Base.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rawr;
using Rawr.Optimizer;
using System.IO;
using System.Xml.Serialization;
namespace LootPlanImport
{
[Serializable]
public class SerializationData
{
public string[] CustomSubpoints;
public List<string> Keys;
public List<ComparisonCalculationUpgrades[]> ItemCalculations;
}
class Program
{
static void Main(string[] args)
{
string file = @"insert path to your upgrade xml";
if (args.Length > 0) file = args[0];
SerializationData data = new SerializationData();
using (StreamReader reader = new StreamReader(file, Encoding.UTF8))
{
XmlSerializer serializer = new XmlSerializer(typeof(SerializationData));
data = (SerializationData)serializer.Deserialize(reader);
reader.Close();
}
StreamWriter sw = new StreamWriter(@"insert path to LootPlan.lua");
sw.WriteLine(@"LootPlanDB = {
[""char""] = {
[""Kavan - Kilrogg""] = {
[""lootpercat""] = {
[5] = {");
foreach (var list in data.ItemCalculations)
{
foreach (var item in list)
{
sw.WriteLine(item.ItemInstance.Id + ",");
}
}
sw.WriteLine(@" },
},
[""itemnotes""] = {");
foreach (var list in data.ItemCalculations)
{
foreach (var item in list)
{
sw.WriteLine(@"[""5:{0}""] = ""{1} Dps"",", item.ItemInstance.Id, item.OverallPoints);
}
}
sw.WriteLine(@" },
},
},
[""profileKeys""] = {
[""Kavan - Kilrogg""] = ""Kavan - Kilrogg"",
},
[""profiles""] = {
[""Kavan - Kilrogg""] = {
[""noteintooltip""] = true,
},
},
}");
sw.Close();
}
}
}