WoW:API GetSpecialization: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{wowapi}} Returns the index of the player's current specialization. local currentSpec = GetSpecialization( [ isInspect [, isPet] [, specGroup] ] ) == Arguments == ; isInspe...") |
m (Move page script moved page API GetSpecialization to API GetSpecialization without leaving a redirect) |
(No difference)
| |
Latest revision as of 04:46, 15 August 2023
Returns the index of the player's current specialization.
local currentSpec = GetSpecialization( [ isInspect [, isPet] [, specGroup] ] )
Arguments
- isInspect
- Boolean - if true, return information for the inspected player
- isPet
- Boolean - if true, return information for the player's pet.
- specGroup
- Number - The index of a given specialization/talent/glyph group (1 for primary / 2 for secondary).
Returns
- currentSpec
- Number - index of the current specialization (ascending from 1), or nil if no specialization is currently learned.
Example
The following snippet prints the name of the player's current specialization if you have one selected.
local currentSpec = GetSpecialization()
local currentSpecName = currentSpec and select(2, GetSpecializationInfo(currentSpec)) or "None"
print("Your current spec:", currentSpecName)
Details
- Despite the argument names, this function does not appear to return valid values for inspected targets; FrameXML uses GetInspectSpecialization("unit") to retrieve a specialization ID instead.
Patch history
Template:Mists-inline <span style="" title="Patch 5.0.4">Patch 5.0.4</span> (patch date::28-August-2012): Replaced GetPrimaryTalentTree.