Classic profession skill levels?
I'm trying to figure out the best way to find out what my current skill level is for First Aid.
From what I can find, GetProfessions / GetProfessionInfo don't work in Classic, and I'm stuck trying to use GetSkillLineInfo. The problem is that I'm not sure I can rely on this. I'm currently using index 10, because that's what First Aid is for me, right now. I could loop over GetSkillLineInfo using GetNumSkillLines, but then I would have to rely on using the "First Aid" string to identify the right skill line and I don't think that would work in any language other than English. Is there a better way to get the current First Aid skill in Classic? |
Loop through those indexes while comparing the skillname argument with the available global strings, which are locally translated depending on the installed client.
CHARACTER_PROFESSION_ALCHEMY = "Alchemy" CHARACTER_PROFESSION_BLACKSMITHING = "Blacksmithing" CHARACTER_PROFESSION_ENCHANTING = "Enchanting" CHARACTER_PROFESSION_ENGINEERING = "Engineering" CHARACTER_PROFESSION_FIRST_AID = "First Aid" CHARACTER_PROFESSION_HERBALISM = "Herbalism" CHARACTER_PROFESSION_LEATHERWORKING = "Leatherworking" CHARACTER_PROFESSION_MINING = "Mining" CHARACTER_PROFESSION_SKINNING = "Skinning" CHARACTER_PROFESSION_TAILORING = "Tailoring" I'm sure you already have the 4th argument, which is the skill level, but make sure to add it to the 5th argument, which is any temp points, like fishing has with poles and bobbers. I don't know if First Aid has any temp buffs or items but better safe than sorry. |
Thank you. Those global strings are exactly what I need.
|
Quote:
|
Unfortunately, GlobalStrings have not been included in the FrameXML dump for years, so it's understandable that some people miss it. However, there are sites that extract things from the game files:
https://wow.tools/dbc/?dbc=globalstr...search=&page=1 |
I just tried in Classic and it appears CHARACTER_PROFESSION_ENCHANTING, etc. are all nil.
|
Weird, then that means the wow.tools dump is wrong or somehow dumped retail instead. Searching the strings directly ingame for "PROFESSIONS" got me these:
Lua Code:
Looks like there's no global strings at all for the other tradeskills or crafts. It's also possible that the global string dump is correct and this is a case of purposeful coding to emulate vanilla. |
Check the extracted code (you can even extract it yourself) to see how the default UI does it in the skills window.
|
I looked at that before answering originally. The code to set up the SkillFrame tab is just a mindless index loop with headers injected into the data like the ReputationFrame.
local skillName, header, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType, skillDescription = GetSkillLineInfo(skillIndex) It's easy to get info on a single profession in retail, you have to loop through this function in classic. |
Retail also does not have those strings. I wish both had them as it would make my life easier. The interesting thing is the website with the dump has a field with value 1 which appears to be in use by Blizzard clients. However, those strings with the profession names have a 2 in that field instead.
|
Not to hijack a topic but I was wondering about profession with my databar I use and was wondering with the help from this post does the following code look like it will work in Classic?
Code:
proPlugin:SetScript('OnEnter', function() Coke |
GetNumPrimaryProfessions() - won't work
In classic it's just return NUMBER, not args\objects. In Classic you can use GetNumSkillLines() - to get total number of skills and then iterate them through GetSkillLineInfo(index) using profession name |
Slight necro since this pops up in google
The mentioned Globalstrings won't work since those are flagged for gluescreens only You can get the localized names from wow.tools https://github.com/Ketho/WoWtoolsPar...ssionNames.lua Lua Code:
Here is an example for getting localized profession names Lua Code:
and for going through the list of profession skills. Lua Code:
The table structure is not ideal for every situation so consider changing it if needed and/or using enums Lua Code:
|
All times are GMT -6. The time now is 05:53 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI