GetTrainerServiceSkillReq

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Patch
Added in 1.0.0 / 1.13.2

Returns the name of the required skill and the amount needed in that skill.

skillName, skillLevel, hasReq = GetTrainerServiceSkillReq(index)

Arguments

index
number - the number of the selection in the trainer window

Returns

skillName
string? - The name of the skill.
skillLevel
number - The required level needed for the skill.
hasReq
boolean - Seems to be true for skills that you cannot learn, nil for skills you have learned already.

Example

 local selection = GetTrainerSelectionIndex()
 local skillName, skillAmt = GetTrainerServiceSkillReq(selection)
 DEFAULT_CHAT_FRAME:AddMessage('Skill Name: ' .. skillName)
 DEFAULT_CHAT_FRAME:AddMessage('Skill Amount Required: ' .. skillLevel)

If you had an engineering trainer open, with a skill you knew already the output would be:

 Skill Name: Engineering
 Skill Amount Required: 375