Page 4 of 10
Re: Implementing: Tradeskills
Posted: Thu Jul 26, 2012 4:43 am
by Jabantiz
Do we really need primary_comp, fuel_comp_name, and fuel_comp_qty in the recipes table? Those would all be in the recipe_build_comps as well so do we need to store that info twice?
Re: Implementing: Tradeskills
Posted: Thu Jul 26, 2012 8:13 pm
by Zcoretri
Got most of the recipe examine working, only thing left is to get end product to display correctly
Re: Implementing: Tradeskills
Posted: Thu Jul 26, 2012 11:43 pm
by Jabantiz
With the help of Scatman and Zcoretri I was able to get the basics of the crafting process done and commited to dev svn. This is just the basics and still uses a hardcoded packet or two but it should be a good starting point. Updates are every 4 seconds, just like live, and only changes values by the base +50 progress -10 durability (all 3 of those values may be good rules).
Re: Implementing: Tradeskills
Posted: Fri Jul 27, 2012 11:31 am
by John Adams
Feel free to add Rules wherever you see fit, Jab. Otherwise, we're just going back over your new code and hacking it apart anyway. Come up with what you think are good, standard EQ2-Live like values, and those are our base. Just let me know when you add them and what their values are, so I can add them to the DB Patcher (or you can insert them yourself to the rule_details table.)
Re: Implementing: Tradeskills
Posted: Sat Sep 15, 2012 5:12 pm
by Jabantiz
I just wanted to post an update on this, I have got some tables set up and filled with test data and as of right now my server loads the ingrediants and sends them when needed. The only reason why I have not submitted this code is because the database tables are not complete and will continue to change. My next step is to make the actual crafting process random and take into account stats/buffs.
Re: Implementing: Tradeskills
Posted: Fri Sep 21, 2012 4:17 pm
by Jabantiz
These are the tables I have added/modified I made these in HeidiSQL, I know how John feels about that program so decided to post them for review first
Code: Select all
CREATE TABLE `recipes` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`recipe_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`tier` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`icon` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
`skill_level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`technique` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`knowledge` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`name` VARCHAR(200) NULL DEFAULT 'Unknown' COLLATE 'latin1_general_ci',
`book` VARCHAR(200) NULL DEFAULT 'Unknown' COLLATE 'latin1_general_ci',
`device` ENUM('Chemistry Table','Engraved Desk','Forge','Stove & Keg','Loom','Woodworking Table','Work Bench') NOT NULL,
`product_classes` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`unknown2` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`unknown3` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`unknown4` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`product_item_id` INT(10) NOT NULL,
`product_name` VARCHAR(200) NOT NULL,
`product_qty` TINYINT(3) NOT NULL,
`primary_comp_title` VARCHAR(200) NOT NULL,
`build_comp_title` VARCHAR(200) NOT NULL,
`build2_comp_title` VARCHAR(200) NULL DEFAULT NULL,
`build3_comp_title` VARCHAR(200) NULL DEFAULT NULL,
`build4_comp_title` VARCHAR(200) NULL DEFAULT NULL,
`build_comp_qty` VARCHAR(200) NOT NULL,
`build2_comp_qty` VARCHAR(200) NULL DEFAULT NULL,
`build3_comp_qty` VARCHAR(200) NULL DEFAULT NULL,
`build4_comp_qty` VARCHAR(200) NULL DEFAULT NULL,
`fuel_comp_title` VARCHAR(200) NOT NULL,
`fuel_comp_qty` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `recipe_id` (`recipe_id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;
Code: Select all
CREATE TABLE `recipe_components` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`recipe_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`item_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`slot_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
)
COLLATE='latin1_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;
Code: Select all
CREATE TABLE `recipe_products` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`recipe_id` INT(10) UNSIGNED NOT NULL,
`stage` TINYINT(3) UNSIGNED NOT NULL,
`product_id` INT(10) UNSIGNED NOT NULL,
`byproduct_id` INT(10) UNSIGNED NOT NULL,
`product_qty` TINYINT(3) UNSIGNED NOT NULL,
`byproduct_qty` TINYINT(3) UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_RECIPE_ID` (`recipe_id`),
CONSTRAINT `FK_RECIPE_ID` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`recipe_id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1;
Re: Implementing: Tradeskills
Posted: Fri Sep 21, 2012 9:11 pm
by Jabantiz
The tables are on the patcher and the code is on dev svn. for the components table slot_id = 0 means primary component, 1 - 4 are the secondaries and 5 is fuel, a recipe must have 0,1,5 to work properly, a recipe can also have multiple components per slot (support for the old style system).
For products table, stage = 0 means you haven't finished a single stage yet 4 is the final product, 1 - 4 is what is displayed on the crafting window. If there is no entry for the stage that was just completed the code will default to fuel.
Still a lot of work to be done, but all the work with packets should be done, if you enter test data you can go through the entire process of crafting (materials won't be taken and you won't get the product yet).
Re: Implementing: Tradeskills
Posted: Fri Sep 21, 2012 10:38 pm
by John Adams
Excellent work as usual, Jab. Do you get sick of hearing me say that? I can stop
So all the packet work is done, woot. Does that include the reactives or whatever they are called, that come up during the "fight" with the table? haha All the spell info for those should be in the spells table, just let us know if we need to script some up for testing purposes.
Re: Implementing: Tradeskills
Posted: Mon Sep 24, 2012 7:31 pm
by Jabantiz
So all the packet work is done, woot. Does that include the reactives or whatever they are called, that come up during the "fight" with the table?
I forgot about those, to send one to the client is easy and in the packet used for the updates while crafting so adding that won't be hard. For the client to counter is a special packet that I have not added in yet but I believe it is a very simple one and will be easy to add.
As for how the "events" will work with the emu, I currently have no clue. I have tried to come up with a good way of doing it but haven't figured anything out yet. All I have come up with is we will probably have to store the last reaction in the player class, probably just need the icon id for the reaction, and when a spell is cast check to see if it is a tradeskill and if so compare the icons (if there is an icon stored).
If anyone else wants to tackle this feel free to, I have been unexpectedly swamped and have very little free time right now.
Re: Implementing: Tradeskills
Posted: Mon Sep 24, 2012 11:11 pm
by John Adams
Comparing the icon ID does sound like a bad hack, but really does make sense lol... if the pretty picture shows up, squash it! We certainly can try that approach to start with, and if any better ideas arise in-progress (like usual) then we revamp!
Everyone loves a revamp.
Re: Implementing: Tradeskills
Posted: Tue Sep 25, 2012 9:29 pm
by Jabantiz
Here is the sample data I used while testing, all entered manually so there is some issues. You will need to set up a crafting table like described on the first page of this post, you will also need to manually add the recipe to the character in the character_recipes table
Code: Select all
INSERT INTO `recipes` (`id`, `recipe_id`, `tier`, `level`, `icon`, `skill_level`, `technique`, `knowledge`, `name`, `book`, `device`, `product_classes`, `unknown2`, `unknown3`, `unknown4`, `product_item_id`, `product_name`, `product_qty`, `primary_comp_title`, `build_comp_title`, `build2_comp_title`, `build3_comp_title`, `build4_comp_title`, `build_comp_qty`, `build2_comp_qty`, `build3_comp_qty`, `build4_comp_qty`, `fuel_comp_title`, `fuel_comp_qty`) VALUES
(1, 1, 1, 1, 1, 1, 0, 0, 'Elm Club', 'Unknown', 'Forge', 0, 0, 0, 0, 105254, 'elm club', 1, 'Raw Tin', 'Raw Elm', 'Raw Root', 'Raw Tin', NULL, '1', '1', '1', NULL, 'Basic Coal', '2');
INSERT INTO `recipe_components` (`id`, `recipe_id`, `item_id`, `slot_id`) VALUES
(1, 1, 12630, 0),
(2, 1, 10450, 1),
(3, 1, 10101, 2),
(4, 1, 12630, 3),
(5, 1, 4436, 5);
INSERT INTO `recipe_products` (`id`, `recipe_id`, `stage`, `product_id`, `byproduct_id`, `product_qty`, `byproduct_qty`) VALUES
(1, 1, 4, 105254, 0, 1, 0);
Re: Implementing: Tradeskills
Posted: Thu Oct 04, 2012 9:18 pm
by Jabantiz
Crafting is now random and when you stop/complete the crafting process you should now be given an item. I think the logic to determine the item you get is correct but as usual more testing is needed.
I made up the following % chances for crafting currently and they will more than likely need to be tweaked as it is hard to find detailed numbers for crafting (I think fail chance is to high currently)
78% success
15% fail
5% crit success
2% crit fail
Still no skills to use while crafting so you will more then likely never get the final product right now, the skills are just buffs that add to your stats (blue stats) so they probably won't be added until the stats are implemented.
Re: Implementing: Tradeskills
Posted: Sat Oct 06, 2012 3:41 pm
by Jabantiz
When you finish crafting (or stop) the build components will now be consumed.
Re: Implementing: Tradeskills
Posted: Mon Oct 08, 2012 5:11 pm
by Jabantiz
The highest rank you completed when crafting is now saved. This lets you see the products on the crafting window instead of "?". This will also be used in examines for the same purpose.
I need input on how to determine xp for a product, should I just copy the normal level xp stuff for now or does any one have detailed info on this aspect (never paid attention to xp after my first crafter on live). I know the first time you make a pristine item (final product) you get an xp boost but not sure on the amount.
Re: Implementing: Tradeskills
Posted: Tue Oct 09, 2012 3:13 pm
by John Adams
I'd say set 2 Rules; One is normal XP, one for bonus XP (first success). For now, it can be whatever value you want to use and as a Rule, we can then change it dynamically.