# C_SpecializationInfo: World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/C_SpecializationInfo

## Functions

### C_SpecializationInfo.CanPlayerUsePVPTalentUI

```lua
canUse, failureReason = C_SpecializationInfo.CanPlayerUsePVPTalentUI()
```

Returns:
- `canUse`: bool
- `failureReason`: string

### C_SpecializationInfo.CanPlayerUseTalentSpecUI

```lua
canUse, failureReason = C_SpecializationInfo.CanPlayerUseTalentSpecUI()
```

Returns:
- `canUse`: bool
- `failureReason`: string

### C_SpecializationInfo.CanPlayerUseTalentUI

```lua
canUse, failureReason = C_SpecializationInfo.CanPlayerUseTalentUI()
```

Returns:
- `canUse`: bool
- `failureReason`: string

### C_SpecializationInfo.GetActiveSpecGroup

```lua
groupIndex = C_SpecializationInfo.GetActiveSpecGroup([isInspect], [isPet])
```

Arguments:
- `isInspect`: bool, may be nil
- `isPet`: bool, may be nil

Returns:
- `groupIndex`: luaIndex

### C_SpecializationInfo.GetAllClassIDs

```lua
allClassIDs = C_SpecializationInfo.GetAllClassIDs()
```

Returns:
- `allClassIDs`: number[]

### C_SpecializationInfo.GetAllSelectedPvpTalentIDs

```lua
selectedPvpTalentIDs = C_SpecializationInfo.GetAllSelectedPvpTalentIDs()
```

Returns:
- `selectedPvpTalentIDs`: number[]

### C_SpecializationInfo.GetClassIDFromSpecID

```lua
classID = C_SpecializationInfo.GetClassIDFromSpecID(specID)
```

Arguments:
- `specID`: number

Returns:
- `classID`: number, may be nil

### C_SpecializationInfo.GetCombatConfigIDForSpecGroup

```lua
configID = C_SpecializationInfo.GetCombatConfigIDForSpecGroup(groupIndex)
```

Arguments:
- `groupIndex`: luaIndex

Returns:
- `configID`: number, may be nil

### C_SpecializationInfo.GetInspectSelectedPvpTalent

```lua
selectedTalentID = C_SpecializationInfo.GetInspectSelectedPvpTalent(inspectedUnit, talentIndex)
```

Arguments:
- `inspectedUnit`: UnitToken
- `talentIndex`: number

Returns:
- `selectedTalentID`: number, may be nil

### C_SpecializationInfo.GetInspectSpecialization

```lua
specializationID = C_SpecializationInfo.GetInspectSpecialization(unit)
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `unit`: UnitToken

Returns:
- `specializationID`: number

### C_SpecializationInfo.GetNumSpecializationsForClassID

```lua
specCount = C_SpecializationInfo.GetNumSpecializationsForClassID(classID)
```

Arguments:
- `classID`: number

Returns:
- `specCount`: number

### C_SpecializationInfo.GetPvpTalentAlertStatus

```lua
hasUnspentSlot, hasNewTalent = C_SpecializationInfo.GetPvpTalentAlertStatus()
```

Returns:
- `hasUnspentSlot`: bool
- `hasNewTalent`: bool

### C_SpecializationInfo.GetPvpTalentInfo

```lua
talentInfo = C_SpecializationInfo.GetPvpTalentInfo(talentID)
```

Arguments:
- `talentID`: number

Returns:
- `talentInfo`: PvpTalentInfo, may be nil

### C_SpecializationInfo.GetPvpTalentSlotInfo

```lua
slotInfo = C_SpecializationInfo.GetPvpTalentSlotInfo(talentIndex)
```

Arguments:
- `talentIndex`: number

Returns:
- `slotInfo`: PvpTalentSlotInfo, may be nil

### C_SpecializationInfo.GetPvpTalentSlotUnlockLevel

```lua
requiredLevel = C_SpecializationInfo.GetPvpTalentSlotUnlockLevel(talentIndex)
```

Arguments:
- `talentIndex`: number

Returns:
- `requiredLevel`: number, may be nil

### C_SpecializationInfo.GetPvpTalentUnlockLevel

```lua
requiredLevel = C_SpecializationInfo.GetPvpTalentUnlockLevel(talentID)
```

Arguments:
- `talentID`: number

Returns:
- `requiredLevel`: number, may be nil

### C_SpecializationInfo.GetSpecIDs

```lua
specIDs = C_SpecializationInfo.GetSpecIDs(specSetID)
```

Arguments:
- `specSetID`: number

Returns:
- `specIDs`: number[]

### C_SpecializationInfo.GetSpecialization

```lua
specializationIndex = C_SpecializationInfo.GetSpecialization([isInspect], [isPet], [specGroupIndex])
```

Arguments:
- `isInspect`: bool, may be nil
- `isPet`: bool, may be nil
- `specGroupIndex`: luaIndex, may be nil

Returns:
- `specializationIndex`: luaIndex

### C_SpecializationInfo.GetSpecializationInfo

```lua
specId, name, description, icon, role, primaryStat, pointsSpent, background, previewPointsSpent, isUnlocked = C_SpecializationInfo.GetSpecializationInfo(specializationIndex, [isInspect], [isPet], [inspectTarget], [sex], [groupIndex], [classID])
```

Arguments:
- `specializationIndex`: luaIndex
- `isInspect`: bool, default false
- `isPet`: bool, default false
- `inspectTarget`: string, may be nil
- `sex`: number, may be nil
- `groupIndex`: luaIndex, may be nil
- `classID`: number, may be nil

Returns:
- `specId`: number, default 0
- `name`: string, may be nil
- `description`: string, may be nil
- `icon`: fileID, may be nil
- `role`: string, may be nil
- `primaryStat`: luaIndex, may be nil
- `pointsSpent`: number, default 0
- `background`: string, may be nil
- `previewPointsSpent`: number, default 0
- `isUnlocked`: bool, default true

### C_SpecializationInfo.GetSpecializationMasterySpells

```lua
spellIDs = C_SpecializationInfo.GetSpecializationMasterySpells(specializationIndex, [isInspect], [isPet])
```

Arguments:
- `specializationIndex`: luaIndex
- `isInspect`: bool, may be nil
- `isPet`: bool, may be nil

Returns:
- `spellIDs`: number[]

### C_SpecializationInfo.GetSpellsDisplay

```lua
spellID = C_SpecializationInfo.GetSpellsDisplay(specializationID)
```

Arguments:
- `specializationID`: number

Returns:
- `spellID`: number[]

### C_SpecializationInfo.GetTalentInfo

```lua
result = C_SpecializationInfo.GetTalentInfo(query)
```

Arguments:
- `query`: TalentInfoQuery

Returns:
- `result`: TalentInfoResult, may be nil

### C_SpecializationInfo.HasPlayerEarnedATalentPoint

```lua
hasEarned = C_SpecializationInfo.HasPlayerEarnedATalentPoint()
```

Returns:
- `hasEarned`: bool

### C_SpecializationInfo.IsInitialized

```lua
isSpecializationDataInitialized = C_SpecializationInfo.IsInitialized()
```

Returns:
- `isSpecializationDataInitialized`: bool

### C_SpecializationInfo.IsPvpTalentLocked

```lua
locked = C_SpecializationInfo.IsPvpTalentLocked(talentID)
```

Arguments:
- `talentID`: number

Returns:
- `locked`: bool

### C_SpecializationInfo.IsSpecSelectionEnabled

```lua
enabled = C_SpecializationInfo.IsSpecSelectionEnabled(classID)
```

Arguments:
- `classID`: number

Returns:
- `enabled`: bool

### C_SpecializationInfo.MatchesCurrentSpecSet

```lua
matches = C_SpecializationInfo.MatchesCurrentSpecSet(specSetID)
```

Arguments:
- `specSetID`: number

Returns:
- `matches`: bool

### C_SpecializationInfo.SetActiveSpecGroup

```lua
C_SpecializationInfo.SetActiveSpecGroup(groupIndex)
```

Arguments:
- `groupIndex`: luaIndex

### C_SpecializationInfo.SetPetSpecialization

```lua
C_SpecializationInfo.SetPetSpecialization(specIndex, [petNumber])
```

Arguments:
- `specIndex`: luaIndex
- `petNumber`: number, may be nil

### C_SpecializationInfo.SetPvpTalentLocked

```lua
C_SpecializationInfo.SetPvpTalentLocked(talentID, locked)
```

Arguments:
- `talentID`: number
- `locked`: bool

### C_SpecializationInfo.SetSpecialization

```lua
success = C_SpecializationInfo.SetSpecialization(specIndex)
```

Arguments:
- `specIndex`: luaIndex

Returns:
- `success`: bool

## Events

### ACTIVE_TALENT_GROUP_CHANGED

Payload, after the event's name:
- `curr`: number
- `prev`: number

### CONFIRM_PET_UNLEARN

Payload, after the event's name:
- `cost`: number

### CONFIRM_TALENT_WIPE

Payload, after the event's name:
- `cost`: number
- `respecType`: number

### PET_SPECIALIZATION_CHANGED

No payload.

### PLAYER_LEARN_PVP_TALENT_FAILED

No payload.

### PLAYER_LEARN_TALENT_FAILED

No payload.

### PLAYER_PVP_TALENT_UPDATE

No payload.

### PLAYER_TALENT_UPDATE

No payload.

### SPEC_INVOLUNTARILY_CHANGED

Payload, after the event's name:
- `isPet`: bool

### TALENTS_INVOLUNTARILY_RESET

Payload, after the event's name:
- `isPetTalents`: bool

## Tables

### PvpTalentInfo (structure)

- `talentID`: number
- `name`: string
- `icon`: number
- `selected`: bool
- `available`: bool
- `spellID`: number
- `unlocked`: bool
- `known`: bool
- `grantedByAura`: bool
- `dependenciesUnmet`: bool
- `dependenciesUnmetReason`: string, may be nil

### PvpTalentSlotInfo (structure)

- `enabled`: bool
- `level`: number
- `selectedTalentID`: number, may be nil
- `availableTalentIDs`: number[]

### SpecializationInfoOutput (structure)

- `specId`: number, default 0
- `name`: string, may be nil
- `description`: string, may be nil
- `icon`: fileID, may be nil
- `role`: string, may be nil
- `primaryStat`: luaIndex, may be nil
- `pointsSpent`: number, default 0
- `background`: string, may be nil
- `previewPointsSpent`: number, default 0
- `isUnlocked`: bool, default true

### SpecializationInfoQuery (structure)

- `specializationIndex`: luaIndex
- `isInspect`: bool, default false
- `isPet`: bool, default false
- `inspectTarget`: string, may be nil
- `sex`: number, may be nil
- `groupIndex`: luaIndex, may be nil
- `classID`: number, may be nil

### TalentInfoQuery (structure)

- `groupIndex`: luaIndex, may be nil
- `isInspect`: bool, default false
- `tier`: luaIndex, may be nil
- `column`: luaIndex, may be nil
- `target`: UnitToken, may be nil
- `specializationIndex`: luaIndex, may be nil
- `talentIndex`: luaIndex, may be nil
- `isPet`: bool, default false

### TalentInfoResult (structure)

- `talentID`: number, default 0
- `name`: string
- `icon`: fileID
- `tier`: luaIndex
- `column`: luaIndex
- `selected`: bool, default false
- `available`: bool, default false
- `spellID`: number, default 0
- `isPVPTalentUnlocked`: bool, default false
- `known`: bool, default false
- `grantedByAura`: bool, default false
- `rank`: luaIndex
- `maxRank`: luaIndex
- `meetsPrereq`: bool, default false
- `previewRank`: luaIndex
- `meetsPreviewPrereq`: bool, default false
- `isExceptional`: bool, default false
- `hasGoldBorder`: bool, default false

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
