Reference › Function reference › Conditions

Conditions.talent.info

dependency

Call as

Conditions.talent.info(value, spec)

Record the dependency Conditions.talent.info, 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

Looks up the talent a TALENT condition refers to, according to its layout: a trait node and entry, a grid index, or a tree and talent index. Returns nil for any other shape.

Arguments

NameTypeWhat it does
valuetableSaved TALENT condition settings.
specnumber | nilSpecialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read.

Returns

1table | nilTalent identity from the platform (name, icon and IDs where known), or nil.
2string | nilThe platform's reason for nil, when it gives one.

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.

It reads no game API directly.

How the addon calls it

Dependencies

Source

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

Conditions.talent.info(value, spec)
    if traitShape(value) then return integer(value.node,1,2147483647) and platform:GetTraitTalentIdentity(value.node,value.entry,value.spell) or nil end
    if value.layout=="grid" then return platform:GetGridTalentInfo(value.value,group(spec)) end
    if treeShape(value) then
        -- The game answers for the player's own class only; another class's
        -- talent index would name one of the player's talents instead.
        if not ownTrees() then return nil end
        return platform:GetTreeTalentInfo(value.tree,value.talent,group(spec))
    end

Back to Function reference