Implementing: Tradeskills

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Mon Jan 07, 2013 6:23 pm

The struct in the previous post is for this window
Image
Now my question is how do we implement this? The window is reusable for whatever you want, it even lets you specify the commands to send back to the server when hitting ok or cancel, the command for ok can be diffrent based on your selection as well. I think this window was also used back when you had to do class quests and select your class, not posotive on that though.

With so much use, even custom use, I am not sure how to handle this window, I lean towards a lua function but it will need a lot of parameters, should we go ahead and make a lua function or handle this some other way?

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Mon Jan 07, 2013 7:07 pm

Just had a thought, what if we do something like conversations, so functions like AddWindowOption() for all the options (array part of the struct) and then a SendWindow() with the rest of the required info and sending the packet?

something like the following lua functions:

Code: Select all

// create a pointer to the window
CreateOptionWindow()
// add an option to the window, everything in [] is optional
AddWindowOption(window, Title, Description, [Command], [Icon sheet], [Icon ID], [Confirm Window Title])
// finish off the rest of the info and send it to the player
SendWindow(Window, Player, Window Title, [Cancel Command])
Some one will need to think of a better name for these functions, but this is the best way I can think of handling this window, thoughts?

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Implementing: Tradeskills

Post by Zcoretri » Mon Jan 07, 2013 9:10 pm

Sounds good to me :mrgreen:

User avatar
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

Post by John Adams » Tue Jan 08, 2013 6:50 am

Yup, that's brilliant. Give that a try and let's see what use we can get out of this window (I have never seen lol)

Was this part of the "respec" on tradeskills? I have those two logs from long ago in Design (tradeskill10, and 20) but can't remember that far back if this was the window. Doesn't look familiar.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Tue Jan 08, 2013 10:07 pm

Implemented these 3 functions.
CreateOptionWindow
AddOptionWindowOption
SendOptionWindow

Slight changes to the params in AddOptionWindowOption from what I posted above, this has been tested in both DoV and CoE(1193). Also instead of calling a command it will call a lua function.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Wed Jan 09, 2013 5:17 pm

Using the lua functions posted above for the option window and some new tradeskill lua functions I have been able to make a functional window.
tradeskillchoice.png
Here is the script used, it will change the tradeskill class and set tradeskill level to 10.

Code: Select all

function hailed(NPC, Spawn)
	window = CreateOptionWindow();
	AddOptionWindowOption(window, "Craftsman", "Craftsmen become carpenters, provisioners, or woodworkers.  They make furniture and strong boxes, food, drink, bows, arrows, totems, wooden weapons, and wooden shields.", 1, 420, "select_craftsman")
	AddOptionWindowOption(window, "Outfitter", "Outfitters become armorers, tailors, or weaponsmiths.  They make plate and chainmail armor, heavy shields, cloth and leather armor, casual clothing, backpacks, hex dolls, and metal weapons.", 1, 411, "select_outfitter")
	AddOptionWindowOption(window, "Scholar", "Scholars become alchemists, jewelers, and sages.  They make spell and combat art upgrades for adventurers, potions, poisons, and jewelry.", 1, 396, "select_scholar")
	SendOptionWindow(window, Spawn, "Select A Profession")
end

function select_craftsman(NPC, Spawn)
	SetTradeskillClass(Spawn, 2)
	SetTradeskillLevel(Spawn, 10)
end

function select_outfitter(NPC, Spawn)
	SetTradeskillClass(Spawn, 6)
	SetTradeskillLevel(Spawn, 10)
end

function select_scholar(NPC, Spawn)
	SetTradeskillClass(Spawn, 10)
	SetTradeskillLevel(Spawn, 10)
end
I manually pulled the icon ID's and text from a log so all that needs to be done for this to be like live is put the option window in an if for level >= 9 and class = artisan.

I also cleaned up the client::ChangeTSLevel() and implemented not being able to level past 9 if you are an artisan and past 19 if you are a craftsman, outfitter, scholar, so it is important in the lua scripts to change the class before you try and change the level.
You do not have the required permissions to view the files attached to this post.

User avatar
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

Post by John Adams » Thu Jan 10, 2013 6:43 am

This is very cool. I think I have done my due diligence, reading all your information on this, yet I still cannot figure out where this LUA script has to exist to make this work? Assuming the Scripts folder at least... and, where is it set? Is this a DB value so it can be anything we want? If so, where is the field to set lua_script (etc)?

Sorry if I have completely missed you telling us somewhere. It's early.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Thu Jan 10, 2013 11:12 am

It is just a normal spawn script that can be assigned to any spawn, on live when you hit level 9 or 19 you can't advance anymore until you talk to the tradeskill trainer, the guy who sells the recipies, there is usually a little dialog when you are at those levels wich triggers this window. I just made this generic script and assigned it to a random npc on my server.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Thu Jan 10, 2013 7:27 pm

Fixed an issue that could potentially let tradeskills level past the level cap or get stuck at there current level if adventure level was at level cap (copy and paste kicked my ass). Also if a character doesn't have a tradeskill class (new char) the first time they gain tradeskill xp they we be set to artisan.

User avatar
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

Post by John Adams » Thu Jan 10, 2013 7:27 pm

Oh cripes. Yeah, it was early. Sorry. For some reason, I thought it was a UI any player could just open and use... thus my confusion.

Thanks for explaining :)

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Mon Jan 21, 2013 7:06 pm

I updated some structs for tradeskills for CoE, and while it looks good in anal it is not showing in game for some reason so still more work to do on them, current structs are on Dev SVN

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Fri Jan 25, 2013 1:27 am

I fixed messages to match live for both channel and text as well as the level up effect. I also fixed (hopefully) a crash caused by recipe book examines. You can also now scribe recipe books, you just need to make sure the book field in the recipes table matches the items name.

I also got right click recipe examines to work better, will set the recipe icon and id if the recipe is found, this is where I ran into a problem, when mousing over a recipe in that right click examine it should give you the examine for that recipe, it instead gave me a item examine. This was the packet the client sent when mousing over a recipe

Code: Select all

   0: 02 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 FF  | ................
  16: FF FF FF 01 00 00 00 00 - 00                       | .........
A type of 2 is an item link examine, so no clue how we will be able to tell the difference between an item and a recipe.

Zcoretri, I uncommented the DumpPacket at the top of Client::HandleExamineInfoRequest() to get that hex, not sure if that is right, but seeing as you have done the most works with examines do you have any ideas?

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Wed Feb 13, 2013 9:27 pm

Did some research on live and implemented a few features, others need to be discussed. First off on live you can not cast a tradeskill spell if you are not currently crafting.
Image
While crafting you can only cast tradeskill spells with a mastery skill that is the same as the current recipes techinque skill.
Image
Both of these have been implemented and code is on Dev SVN.

I also noticed that tradeskill spells are shaded when when you are not crafting, and when you are crafting normal spells are shaded and only the tradeskill spells you can use are unshaded.
Image
I haven't got around to this as I need to think of a good way to do this without changing how we currently handle shading.

Now the part that needs discussion, we do not have a define for tradeskill stats, I looked through all the #defines and couldn't find them. I looked up a few items that modify the success mod for crafting and it is always listed under the effects part of an item wich makes me believe there is no item_stat value for it. We use those values to apply bonuses in spell scripts so there is no way to add to the tradeskill stats right now, and who knows what else. The only thing I can think of is to add these to the unused values (800+) to only be used in spell scripts and code, never sent to the client. What do you all think about that?

I had planned to put that stat map<> I made for obscure stats to use in here but it relies on the #defines, need to figure that stuff out before I can continue on making tradeskill spells useful.

FInally tradeskill reactions. I was thinking a new table to hold all possible reactions (name, icon), the crafting skill they are for, and the effect you get for successfully/failing to counter them (progress, durability, spell id), then when a tradeskill spell is cast check its icon against the reactions icon, if there is a current reaction, to see if they match and to send the appropriate packet and apply the mods. I say a new table as that is really all the info that is needed for them, adding them to spells seems like there would be a lot of useless fields to fill out as well as other tables to know what spells are reactions and not. I would also like feedback on this before I attempt to implement it.

PS - All pictures are from live.

User avatar
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

Post by John Adams » Thu Feb 14, 2013 10:09 am

Jabantiz wrote:The only thing I can think of is to add these to the unused values (800+) to only be used in spell scripts and code, never sent to the client. What do you all think about that?
I am not opposed to this to get passed this implementation hurdle. Eventually, we'll finish the discussion about stats and how better to define them, but for now this seems fine.
Jabantiz wrote:FInally tradeskill reactions. I was thinking a new table to hold all possible reactions (name, icon), the crafting skill they are for, and the effect you get for successfully/failing to counter them (progress, durability, spell id), then when a tradeskill spell is cast check its icon against the reactions icon, if there is a current reaction, to see if they match and to send the appropriate packet and apply the mods.
Agreed. A new reference table will work, since it is static data that will not change (right?) so it would be considered core data. (edit: is this something I can Parse?)


Note: The DB Patcher script on the portal is undergoing a face-lift and may not work, or be available. If you cannot get to it, submit your table structure to me here and I'll do it manually.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Tradeskills

Post by Jabantiz » Thu Feb 14, 2013 1:59 pm

John Adams wrote: Agreed. A new reference table will work, since it is static data that will not change (right?) so it would be considered core data. (edit: is this something I can Parse?)
It has changed a couple times in the past but usually when there was massive changes to tradeskills overall so it should be mostly static, but you never know with SOE. As for parsing, I think it would be almost impossible to get them all from crafting, there are just to many of them and they don't happen enough as well as some being super rare, however I noticed on live that every tradeskill spell tells you what reaction it counters from the description, I was planning to pull the names and icons from that (manually) and then we would have to come up with the bonus penalties mod somehow.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests