Reference › Function reference › Conditions

Conditions.talent.treeExists

dependency

Call as

Conditions.talent.treeExists(value, cache)

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

Checks that a talent condition's tree index exists on this client, using the cached platform talent tree count.

Arguments

NameTypeWhat it does
valuetableCondition settings with a numeric tree field.
cachetable | nilEvaluation-pass cache passed to getCached, or nil to read directly.

Returns

1boolean | nilTrue when value.tree is within the tree count, otherwise nil.
2string | nilReason for nil: the tree count's reason, or talent-tree-unavailable.

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

  • Primary Talent Tree (evaluate)
    local exists,why=treeExists(value,cache);if not exists then return nil,why end
  • Talent Tree Points (evaluate)
    local exists,why=treeExists(value,cache);if not exists then return nil,why end

Dependencies

Source

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

Conditions.talent.treeExists(value, cache)
    local count,reason=addon.getCached(cache,platform.GetTalentTreeCount,platform)
    if count==nil then return nil,reason end
    if value.tree>count then return nil,'talent-tree-unavailable' end
    return true

Back to Function reference