Как вызывать
Conditions.talent.treeExists(value, cache)
Запишите зависимость Conditions.talent.treeExists и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
Checks that a talent condition's tree index exists on this client, using the cached platform talent tree count.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
value | table | Condition settings with a numeric tree field. |
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
Возвращает
| 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. |
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
- Основная ветка талантов (evaluate)
local exists,why=treeExists(value,cache);if not exists then return nil,why end - Очки в ветке талантов (evaluate)
local exists,why=treeExists(value,cache);if not exists then return nil,why end
Зависимости
platform(builtin:Conditions/talent.lua:platform)
Исходный код
Conditions/talent.lua, строка 652. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
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