Lore archive · Warcraft Wiki, 2023 dump
API GetTrainerServiceInfo
Last wiki revision 2022-07-21
Returns information about a trainer service.
name, rank, category, expanded = GetTrainerServiceInfo(id)
- Arguments
- id:Index of the trainer service to retrieve information about. Note that indices are affected by the trainer filter. (See GetTrainerServiceTypeFilter and SetTrainerServiceTypeFilter.)
- Returns
- name : (String) Name of the spell or the header (i.e. "Arcane Explosion" or "Fire").
- rank : (String) Rank of the spell, if applicable. Headers return empty strings.
- category : (String) "used" (already have the spell), "unavailable" (can not train this skill), "available" (can train this skill) and "header".
- expanded : (Number) nil if this is a collapsed header (category == "header"), 1 otherwise. (See CollapseTrainerSkillLine and ExpandTrainerSkillLine.)
- Example
Prints the list of trainable spells when interacting with a trainer. local i, name, rank, category; for i=1,GetNumTrainerServices do name, rank, category = GetTrainerServiceInfo(i); if (name == nil) then break; -- GetNumTrainerServices does not check if you're talking to a trainer or not. end if (category == "available") then DEFAULT_CHAT_FRAME:AddMessage(name .. " (" .. rank .. ")"); end end
Source
https://warcraft.wiki.gg/wiki/API_GetTrainerServiceInfo · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.