Reference › Function reference › Conditions

Conditions.talent.classSpecs

dependency

Call as

Conditions.talent.classSpecs()

Record the dependency Conditions.talent.classSpecs, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

Lists the specializations of the player's class for the Talent condition's Specialization picker, so a rotation can pick the talents of a specialization other than the one being played. Only the Retail client has more than one talent tree per class; everywhere else, and when the class cannot be read, it returns nil and the picker is not shown.

Arguments

None.

Returns

1table | nilThe class's specialization choices (id, name, icon), or nil where there is nothing to choose.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
UnitClassClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

How the addon calls it

Dependencies

Source

Conditions/talent.lua, line 282. Read only in game; Duplicate makes an editable copy.

Conditions.talent.classSpecs()
    if platform:GetClientFamily()~="retail" or not platform.GetClassSpecializationChoices then return nil end
    local ok,_,_,classID=pcall(UnitClass,"player")
    if not ok or not platform:CanReadValue(classID) then return nil end
    local choices=platform:GetClassSpecializationChoices(classID)
    return choices and #choices>1 and choices or nil

Back to Function reference