Implementing: Tradeskills
Moderator: Team Members
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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?
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Re: Implementing: Tradeskills
Got most of the recipe examine working, only thing left is to get end product to display correctly
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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).
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Implementing: Tradeskills
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.)
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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;
Last edited by Jabantiz on Fri Sep 21, 2012 5:56 pm, edited 1 time in total.
Reason: Change to a table
Reason: Change to a table
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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).
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).
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Implementing: Tradeskills
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.
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.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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.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?
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.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Implementing: Tradeskills
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.
Everyone loves a revamp.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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);
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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.
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.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
When you finish crafting (or stop) the build components will now be consumed.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Implementing: Tradeskills
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.
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.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Implementing: Tradeskills
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.
Who is online
Users browsing this forum: No registered users and 0 guests