API GetSpecialization

104,545pages on
this wiki
Add New Page
Add New Page Talk0
WoW API < GetSpecialization

Returns the index of the player's current specialization.

local currentSpec = GetSpecialization( [ isInspect [, isPet] [, specGroup] ] )

Arguments Edit

Boolean - if true, return information for the inspected player
Boolean - if true, return information for the player's pet.
Number - The index of a given specialization/talent/glyph group (1 for primary / 2 for secondary).

Returns Edit

Number - index of the current specialization (ascending from 1), or nil if no specialization is currently learned.

Example Edit

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 Edit

  • 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 Edit

0500Mists-Logo-Small Patch 5.0.4 (28-August-2012): Replaced GetPrimaryTalentTree.

See also Edit

Also on Fandom

Random Wiki