Quantcast Finding out what profession a "Book" recipe belongs to? - WoWInterface
Thread Tools Display Modes
03-01-19, 05:24 AM   #1
LudiusMaximus
A Wyrmkin Dreamwalker
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 57
Finding out what profession a "Book" recipe belongs to?

There are certain recipe items that have "Book" as their itemSubType (as returned by GetItemInfo()). For example the Weather-Beaten Journal.

Is there any way of finding out what profession such a "Book" recipe belongs to, other than searching its tooltip for all profession names?

Follow-up question:

If I have to do the tooltip search, where can I get the localised strings for all professions? I only found
PROFESSIONS_ARCHAEOLOGY, PROFESSIONS_COOKING, PROFESSIONS_FISHING.

Where could I get the others?

Last edited by LudiusMaximus : 03-01-19 at 05:34 AM.
  Reply With Quote
03-01-19, 04:26 PM   #2
Kanegasi
A Rage Talon Dragon Guard
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 329
Going back to my reply in one of your previous threads, the 12th and 13th return of GetItemInfo will tell you. For example, Weather-Beaten Journal's 12th and 13th return should be 9 and 9.
  Reply With Quote
03-02-19, 04:39 PM   #3
LudiusMaximus
A Wyrmkin Dreamwalker
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 57
Thanks for your reply!

Unfortunately the 13th return value by GetItemInfo() for a "book" recipe is 0 (corresponding to LE_ITEM_RECIPE_BOOK you provided in the other thread).

So I guess I will have to scan the tooltip?

Any idea where to find the localised profession names?

Thanks again!
  Reply With Quote
03-02-19, 10:27 PM   #4
Kanegasi
A Rage Talon Dragon Guard
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 329
Ah, that's what you meant by "Book". It didn't occur to me that that journal was not a recipe.

Here's the string used by items with a profession requirement:

ITEM_MIN_SKILL = "Requires %s (%d)"

As for localized profession names, those aren't in GlobalStrings, but you can hardcode the spell IDs for each profession and get the localized name from those spells. I gathered the list of spells associated with opening the skill window for each profession:

2259: alchemy
78670: archaeology
2018: blacksmithing
2550: cooking
7411: enchanting
4036: engineering
7731: fishing
265820: herbalism (note: it's 2366, but the profession spell is called "herb gathering")
45357: inscription
25229: jewelcrafting
2108: leatherworking
2575: mining
8613: skinning
3908: tailoring

I got these from wowhead, but if you were to have some code that shows spell IDs in-game, mousing over your professions should show these IDs.
  Reply With Quote
03-04-19, 05:00 AM   #5
LudiusMaximus
A Wyrmkin Dreamwalker
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 57
Hey, thanks a lot! I can continue working with that.

In fact, the Weather-Beaten Journal is a recipe (6th and 12th return value of GetItemInfo()) but its sub type (7th and 13th return value of GetItemInfo()) is "Book" and not the profession name as for all other recipes.

No idea, why this "Book" sub category of recipes has been introduced into the game in the first place. I mean surely there is no recipe not belonging to any profession?

Anyway, I can work around this now. Thanks again!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Finding out what profession a "Book" recipe belongs to?

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