So, I was thinking about the powers of Roster while I was looking at a stack of Argent Dawn writs in my backpack. I have a list of things like "4 Gnomish Battle Chickens" and "10 Major Mana Potions".
Now, my next to-do would be to go to our guild roster, and build a list of ingredients of all the different things I need to gather to fulfill the writs I have. This got me thinking:
Wouldn't it be cool if an add-on existed in WoWRoster called Writ Calculator? All it would need is a list of known writs. The user would then check off which writs they have and hit 'Calculate'. Based on the known items in the writs, it'll check the db for the ingredients, parse it out per writ checked of, finally producing a long list of the base materials needed.
In my example of Battle Chickens, a db might know (and might not, just return 'Not found') that a single Gnomish Battle Chicken takes:
1 Mithril Casing
6 Truesilver Bar
6 Mithril Bar
2 Inlaid Mithril Cylinder
1 Gold Power Core
2 Jade
If we parse that again to see if any of these items are recipie items, we see:
1 mithril casing takes 3 mithril bars
1 Inlaid Mithril Cylinder takes 5 mithril bars, 1 gold bar, and one truesilver bar
1 gold power core takes 1/3 gold bar
So, to make 1 gnomish battle chicken, it should list the following raw ingredients (sequence unimportant):
13 Mithril Bars
8 Truesilver Bars
3 gold bars (always round up!)
2 Jade
So, to fulfill the Writ of 4 Gnomish Battle Chicken, this Writ Calculator would display to the user:
52 Mithril Bars
32 Truesilver Bars
10 Gold Bars (remember, 0.3 gold bar for a power core, so 9.2 are needed, but we round up)
8 Jade
I can easily help with the logic and populating the Writ data into something (table, array, whatever), but I don't know php well enough to just write this bugger on my own.
Anyone who is savvy to PHP and WoWRoster interested in picking up this gauntlet of coding challenge?