Getting required profession levels for Recipes/Patterns/Plans/Schematics etc.?
I know that for items in general it is possilbe to get the required minimum player level with GetItemInfo().
But is there a similarly easy way to get the minimum profession skill level for a Recipe/Pattern/Plan/Schematic etc.? E.g. that you need "Cooking (120)" to learn a certain recipe? Or is scanning the item's tooltip the only way here? If so, how do I get the localized term to search for "Required ..."? Thanks. |
I assumed that C_TradeSkill would have something, but I don't see it. The closest is C_TradeSkillUI.GetRecipeSourceText which would probably be faster than tooltip scanning, but I'm pretty sure it would only work for Trainer-learned recipes.
LibPeriodicTable would have helped before Blizzard split the Tradeskills into the different expansion-based categories. So from what I can see, scanning tooltips is the best option. I'm not positive, but I think the global ITEM_MIN_SKILL is what you want to look for. It's equal to "Requires %s (%d)" in enUS. |
I haven't played with it myself but these functions look like they may prove useful.
local recipeIDs = C_TradeSkillUI.GetAllRecipeIDs(); for i, recipeID in ipairs(recipeIDs) do local recipeInfo = C_TradeSkillUI.GetRecipeInfo(recipeID); end These were found in this file: https://www.townlong-yak.com/framexm...RecipeList.lua But looking at : https://wow.gamepedia.com/API_C_Trad....GetRecipeInfo There is no level check in the recipe info table So the question is where they are getting the level reference from. Possibly behind the scene database if not in one of the api commands. The API Documentation looks to be incomplete for the tradeskills so there may be other functions/variables/data that they haven't used themselves. |
Thanks for your replies.
I guess I have to go for scanning the tooltip then. But more questions arise. Maybe you can help me again? What I am working on is an addon that will color the item icons of all recipes red, if the player character does not fulfill the required skill level to learn it. So 1.) How can I get the current player skill level for a profession? How can I differentiate between the different expansions? 2.) When I scan the recipe tooltip, ITEM_MIN_SKILL = "Requires %s (%d)" seems to be the right global to scan for (thanks @MuffinManKen). But when I want to know what expansion it is about, I would need the globals for the expansion names (Outland, Northrend, Cataclysm, Pandaria, Legion, Zandalari/Kul Tiras) as well, right? What would these globals be? Thanks again! |
I haven't looked at tradeskills since before Legion so the changes added then and in BfA have changed that knowledge. But, they did have a way of getting that information but I can't locate it in the blizzard code at https://www.townlong-yak.com/framexml/live/. You may want to see if another addon does something similar and see how theirs is doing it.
|
Blizzard has the values EXPANSION_NAME0 through EXPANSION_NAME7 at the moment.
|
I have not converted Grail to using the new profession system, but in general you get the professions the user has with:
Code:
local prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions() Code:
GetProfessionInfo(professionId) |
Ah yeah that's the one I played with before.
It may be that the nth item will be the nth expansion. How does the profession name display per n item, seeing as for the most part the name includes the expansion name so should help confirm if that is the case. ? If it is the case, export to an indexed table and use that table for ease of use. Thanks Nimh, |
Quote:
Code:
0 "Classic" Code:
0 "" But it is getting more complicated. See e.g. the follwing tooltip line in different languages: Code:
English: Requires Outland Jewelcrafting (25) ITEM_MIN_SKILL = "Requires %s (%d)" only has one placeholder %s for both. So even if I knew the localised version of the profession and expansion names, I would still have to trial and error in which order they occur, right? Or is there a way that does not require scanning the tooltip? |
The EXPANSIONx values are localised...
Work out which index you need from the localised names and display that instead. Here is how I do it in my mageports addon. Code:
addonData.Expansion = Hmm, you would use the following line but none of it shows an ID unless skillLine returns something useful. Code:
local name, icon, skillLevel, maxSkillLevel, numAbilities, spelloffset, skillLine, skillModifier, specializationIndex, specializationOffset = GetProfessionInfo(index) |
Quote:
The expansion names of EXPANSIONx are no use to me. I do not need to display anything yet, I first of all need to identify the expansion of a recipe by scanning its tooltip (because there seems to be no other way...). And I cannot derive e.g. "Outland" (English), "der Scherbenwelt" (German), "de Terrallende" (Spanish), "delle Terre Esterne" (Italian), "de l’Outreterre" (Frensh) etc. just from EXPANSION1 = "The Burning Crusade"... |
Quote:
Apparently, GetProfessionInfo() only gives you the values for the one skill bar, WoW deems appropriate for your character level. So when I am a lvl 100 demon hunter that has just learned cooking, GetProfessionInfo() will only give me the values of my "Legion Cooking" skill bar. :-( Any idea how I can access the values for the other skill bars? But for my addon I only need to know if my character's skill level is high enough to learn a recipe. I don't care how far I am from reaching it. So I am thinking about simply using GetTextColor() in the tooltip scan. If the "Requires ... Cooking (...)" line is red, I know that my character cannot learn the recipe yet. A little cumbersome, but this would do the trick I guess. |
That actually sounds easier than trying to figure out how to do it the less cumbersome way. You can always change how it finds out the info when you figure out a way to do it, if any.
And yes, with Burning Crusade I can see the problem and it further enforces the decision to use the color value of the text. Although, I just noticed something on RecipeInfo function returns. Maybe the recipe is disabled if it is unlearnable by the player. Also, categoryID, if you haven't checked already, may be the expansion it is for. The learned value to see if it is already learned, obviously. Just a thought. Code:
categoryID Number ID of the category the recipe belongs to. |
Quote:
Quote:
Quote:
Thanks again! |
This might help you. It details how to understand the parts of the itemstring. Recipe strings should be very similar so a similar set of code should result in what you want.
https://wow.gamepedia.com/ItemLink EG. item links include the value item:xxxx which is the type of link followed by its id Give it a test run as it doesn't specify that it has been updated for BfA so there may be some additional info that they haven't documented. |
Quote:
Hm, the ItemLink does not seem to include the recipeID. E.g. the reicpeID of "Savory Deviate Delight" is 8238 But string.match(itemLink, "item[%-?%d:]+") for "Savory Deviate Delight" returns item:6661::::::::::56:71::::::: Also the category of a recipe does not seem to have anything to do with the expansion it belongs to. E.g. the category of "Savory Deviate Delight" is "Unusual Delights", and there is no further parent category... |
Hmm
https://www.wowhead.com/item=6657/sa...eviate-delight https://www.wowhead.com/item=6661/re...eviate-delight https://www.wowhead.com/spell=8238/s...eviate-delight One seems to be the recipe after it is learned (8238) and one (6661) the recipe scroll that is picked up and the other (6657) is the resulting food stack item. So, unless there is something in the recipe list that points to the sourceID ( recipe scroll ) you might not be able to tie them together to guarantee a match. Also, have you looked at all the returns for the GetItemInfo on the recipe scroll ? https://wow.gamepedia.com/API_GetItemInfo Code:
1. itemName Darn it, they use a special Auction related function that returns 'canUse' in one of its returns and GetItemInfo doesn't. |
You can try from Blizzard_TradeSkillUI.lua:
Code:
--[[ Parent categories ]]-- |
Thanks for your further suggestions, but I am doing it completely with tooltip scannning now.
Once finished, I shall post my solution here. |
Quote:
The Blizzard TradeSkillUI addon is loaded on demand so you can either open the trade skill frame or simply load the addon. Best time to load the addon is when your addon is loaded. Lua Code:
|
All times are GMT -6. The time now is 11:37 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI