Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API GetTrainerServiceInfo
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} 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 [[API_GetTrainerServiceTypeFilter|GetTrainerServiceTypeFilter]] and [[API_SetTrainerServiceTypeFilter|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 [[API_CollapseTrainerSkillLine|CollapseTrainerSkillLine]] and [[API_ExpandTrainerSkillLine|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 == Patch changes == {{Patch 4.0.1|note=New return values: name (String), subType (String), category (String), texture (String), requiredLevel (Number), topServiceLine (Number).}}
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Cata-inline
(
edit
)
Template:Editlink
(
edit
)
Template:Patch
(
edit
)
Template:Patch 4.0.1
(
edit
)
Template:Tocright
(
edit
)
Template:WoW/patch
(
edit
)
Template:WoW/patch 4.0.1
(
edit
)
Template:Wotlk-inline
(
edit
)
Template:Wowapi
(
edit
)