View Single Post
11/09/18, 06:51 PM   #4
ziggr
 
ziggr's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 27
GetSmithingResearchLineTraitInfo()

Call GetSmithingResearchLineTraitInfo(craftingType, researchLine, traitIndex) is probably the API you seek.

GetSmithingResearchLineTraitInfo(number TradeskillType craftingSkillType, number researchLineIndex, number traitIndex)
Returns: number ItemTraitType traitType, string traitDescription, boolean known
Iterate traitIndex 1..9 for each trait, and count the "knowns". That's how many traits the current char has completed research for that specific item.

researchLine is an index into the gear items you can craft at a station, 1..14 for blacksmithing (7 weapons, 7 heavy armor). 1..15 for clothing (8 light including jerkin, 7 medium), 6 for wood, 2 for jewelry.

craftingType is CRAFTING_TYPE_whatever.

I count trait knowledge in WritWorthy_Smithing.lua Parser:ToKnowList(), if you care to wade through pages and pages of not-really-relevant code to get to an example of GetSmithingResearchLineTraitInfo()

--Z
  Reply With Quote