Page 8 of 10
Re: Implementing: Tradeskills
Posted: Mon Feb 25, 2013 10:44 pm
by Jabantiz
More table changes, it is possible for a
recipe to give more then 255 of the product, so need to change the table to support an int16
Code: Select all
ALTER TABLE `recipes`
ALTER `product_qty` DROP DEFAULT;
ALTER TABLE `recipes`
CHANGE COLUMN `product_qty` `product_qty` SMALLINT(5) UNSIGNED NOT NULL AFTER `product_name`;
ALTER TABLE `recipe_products`
ALTER `product_qty` DROP DEFAULT;
ALTER TABLE `recipe_products`
CHANGE COLUMN `product_qty` `product_qty` SMALLINT(5) UNSIGNED NOT NULL AFTER `byproduct_id`;
Re: Implementing: Tradeskills
Posted: Tue Feb 26, 2013 2:59 pm
by John Adams
Committed - Minor Version 32
Re: Implementing: Tradeskills
Posted: Sat Mar 02, 2013 6:35 pm
by Jabantiz
Ran into an issue with DoV (1096) it seems like no matter what I send in the packets it always shows the crafter having the primary component when they don't. This is not an issue in 1193 though.
Also when you go to a device it gives you all the recipes you know, not just the ones you can craft on that device. While I can fake it the way we currently do it I wanted to attempt to figure out the packets to do it correctly, sadly I have had no luck so far. WS_RecipeList sends all the recipes the player knows, and from what I can tell it only is sent when the list changes, we send it every time we click on a device, which with thousands of recipes could be an issue. WS_ShowRecipeBook seems to be sent every time you click on a device and seems to filter the results somehow but have yet to figure out how it is filtering the results.
I could use help figuring out both issues.
Re: Implementing: Tradeskills
Posted: Tue Mar 05, 2013 4:31 pm
by Jabantiz
Did some research on tradeskill respec, didn't actually run a collect because of the account I did it on but all it does is change your tradeskill class to artisan and level to 9 so you are back at the first class choice. It also uses the window for the class choice with 1 option and a confirmation box after you select the option.
TSRespec.png
TSConfirmRespec.png
All of this can be done with the current lua functions.
Re: Implementing: Tradeskills
Posted: Mon Apr 01, 2013 7:02 pm
by Jabantiz
Thanks to Zcoretri's help we may have figured out how to filter the recipe list properly. Each recipe has an unknown2 which we think might be the device ID. In WS_ShowRecipeBook unknown3 might be a bitmask of the device ID we are using telling the client to show only those recipes.
The new issue is how to determine the device id? I was going to hard code it based on the device name but every time a new device is added it would require a recompile, also not sure how special devices are handled yet. Should we add a field to the spawn table for the device id? It would only be needed for the handful of crafting stations though and 0 for every thing else.
John, any ideas?
Re: Implementing: Tradeskills
Posted: Tue Apr 02, 2013 6:32 am
by John Adams
If it were me, and devices are "objects", I would add a field to the spawn_objects table only, not spawn (parent) since it would be useless for most spawns. Sounds like the easiest solution. Good job, guys.
Re: Implementing: Tradeskills
Posted: Tue Apr 02, 2013 7:44 pm
by Jabantiz
Added a field to spawn_objects and now have the recipe list only being sent once and the filter message being sent based on what device you select. Will commit this code later tonight, trying to figure out how they update the list when you scribe a new recipe book and how to send the recipe list when you just open the window when not at a crafting station.
Re: Implementing: Tradeskills
Posted: Tue Apr 02, 2013 7:51 pm
by John Adams
FYI, recipe data parsed with Jab's app is now set to download from DB PatchServer.
Nice work on that app, Jab

Re: Implementing: Tradeskills
Posted: Tue Apr 02, 2013 9:20 pm
by Jabantiz
Got the recipe list working properly, it is only sent once now. Scribing a new recipe book will update the list and not send the entire thing again, opening the recipe list with the key and not the device will now send the recipe list (CoE clients only, need to identify the opcode in lower versions), and clicking on a device should now filter the list.
To get the list to filter you need to set unknown2 in the recipe table to the id of the device it uses. Here is the device ID list, Thanks to Zcoretri for getting this list
1 - Sewing
2 - Forge
3 - Chemistry
4 - Engraving Desk
5 - Work Bench
6 - Woodworking
7 - Stove
The crafting table will also need this id set in spawn_objects table.
Re: Implementing: Tradeskills
Posted: Wed Apr 03, 2013 7:19 am
by Zcoretri
Nice work Jabantiz.

Re: Implementing: Tradeskills
Posted: Wed Apr 03, 2013 3:38 pm
by John Adams
Jabantiz wrote:To get the list to filter you need to set unknown2 in the recipe table to the id of the device it uses. Here is the device ID list, Thanks to Zcoretri for getting this list
Maybe I'm just confused, but we have an enum in Recipes for "device". Can't we just use those values in unknown2?
Re: Implementing: Tradeskills
Posted: Wed Apr 03, 2013 6:07 pm
by Jabantiz
I am still debating on taking the enum out because of the special devices, but don't have enough info on special devices yet so I just used the unknown2 as we already had a field in the db and that is what it is in the struct. Also the enum is in the DB only I believe, would have to double check, so any new device (again special devices if they work this way) would require a recompile, if we just use unknown2 in the recipe table and set the device to the same value we won't have to recompile to add a new device.
Re: Implementing: Tradeskills
Posted: Thu Apr 04, 2013 5:04 pm
by Jabantiz
I updated the zam recipe parser to set the value, if any one has already run it and doesn't want to run it again this sql will update all the recipes.
Code: Select all
UPDATE `recipes` SET `unknown2` = 1 WHERE `device` = 'Sewing Table & Mannequin';
UPDATE `recipes` SET `unknown2` = 2 WHERE `device` = 'Forge';
UPDATE `recipes` SET `unknown2` = 3 WHERE `device` = 'Chemistry Table';
UPDATE `recipes` SET `unknown2` = 4 WHERE `device` = 'Engraved Desk';
UPDATE `recipes` SET `unknown2` = 5 WHERE `device` = 'Work Bench';
UPDATE `recipes` SET `unknown2` = 6 WHERE `device` = 'Woodworking Table';
UPDATE `recipes` SET `unknown2` = 7 WHERE `device` = 'Stove & Keg';
Re: Implementing: Tradeskills
Posted: Thu Apr 04, 2013 5:45 pm
by John Adams
John Adams wrote:FYI, recipe data parsed with Jab's app is now set to download from DB PatchServer.
Your data is live, downloadable, so you can apply those updates to DB PatchServer and everyone should get them.
Re: Implementing: Tradeskills
Posted: Thu Apr 04, 2013 5:48 pm
by Jabantiz
Ok I put that on the DB updater.