Chame como
Conditions.talent.treeExists(value, cache)
Registre a dependência Conditions.talent.treeExists e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.
O que faz
Checks that a talent condition's tree index exists on this client, using the cached platform talent tree count.
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
value | table | Condition settings with a numeric tree field. |
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
Retornos
| 1 | boolean | nil | True when value.tree is within the tree count, otherwise nil. |
|---|---|---|
| 2 | string | nil | Reason for nil: the tree count's reason, or talent-tree-unavailable. |
Edições
As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.
Não lê nenhuma API do jogo diretamente.
Como o addon a chama
- Árvore de talentos principal (evaluate)
local exists,why=treeExists(value,cache);if not exists then return nil,why end - Pontos na árvore de talentos (evaluate)
local exists,why=treeExists(value,cache);if not exists then return nil,why end
Dependências
platform(builtin:Conditions/talent.lua:platform)
Código-fonte
Conditions/talent.lua, linha 652. Somente leitura no jogo; Duplicar cria uma cópia editável.
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