Thread Tools Display Modes
08-12-18, 03:16 PM   #1
CC_WOW
A Deviate Faerie Dragon
 
CC_WOW's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2016
Posts: 19
Professions API for BFA and the expansion-specific skills?

Greetings,

I'm trying to find out the skill levels for each expansion's profession (Legion Cooking etc.). Before 8.0.1, I simply used GetProfessions() and then GetProfessionInfo(), which would provide me with the desired data. Now, it merely tells me that I have 100/100 in Legion Cooking (or whatever is the highest skill being displayed in the UI), but there's no info whatsoever about the other ones. This doesn't help me very much, unfortunately.

Is there a simple way to do this? I've searched these forums, Google, and FrameXML/Blizzard's UI but I didn't find so much as a hint. I noticed that I could detect the individual expansion-specific spells by ID, but that doesn't help in finding the exact skill level they're at.

Thanks for your time!
  Reply With Quote
08-12-18, 04:11 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
You need to query each category using C_TradeSkillUI.GetCategoryInfo(categoryID).
This returns a table populated with the name of the category, "skillLineCurrentLevel" and "skillLineMaxLevel" for cur/max.
(sidenote: skillLine == profession)

Here's a full list of possible category IDs: https://github.com/p3lim-wow/LibProc....lua#L509-L620

To get the category data the profession data must be loaded, which you can do by registering the "TRADE_SKILL_SHOW" event and calling C_TradeSkillUI.OpenTradeSkill(professionID).
Profession IDs can be found in the same list as above.

The downside of this is that you actually have to open the profession to get the information, which can trigger a boatload of issues for you when users of your addon uses other addons who also do something when the data is loaded or the profession UI is shown.

I've petitioned Blizzard for an alternate way of retrieving the data without opening the profession completely, but the response was "unlikely".

Last edited by p3lim : 08-12-18 at 04:38 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Professions API for BFA and the expansion-specific skills?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off