API GetTrainerServiceSkillReq

Revision as of 16:53, November 18, 2008 by Ackis (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)
103,874pages on
this wiki
WoW API < GetTrainerServiceSkillReq

Returns the name of the skill required, and the amount needed in that skill. Index is the selection index obtained by GetTrainerSelectionIndex().

 skillName, skillLevel, hasReq = GetTrainerServiceSkillReq(index)

Arguments Edit

the number of the selection in the trainer window

Returns Edit

The name of the skill.
The required level needed for the skill.
1 or nil. Seems to be 1 for skills that you cannot learn, nil for skills you have learned already.

Example Edit

 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

Around Wikia's network

Random Wiki