Llamar como
Core.creature_conditions.configuredID(key)
Registra la dependencia Core.creature_conditions.configuredID y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.
Qué hace
Maps a stored CREATURE condition key to its numeric creature type, from BEAST (1) to GAS_CLUUD (13). GAS_CLUUD is the stored key's existing spelling, kept on purpose; any other key returns nil.
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
key | string | Stored creature type key, such as "UNDEAD". |
Retornos
| 1 | number | nil | Creature type number, or nil for an unknown key. |
|---|
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.
No lee directamente ninguna API del juego.
Cómo la llama el addon
Core.creature_conditions.GetConditionCreatureTypeMatchlocal expected=configuredID(key)
Código fuente
Core/creature_conditions.lua, línea 17. Solo lectura en el juego; Duplicar crea una copia editable.
Core.creature_conditions.configuredID(key)
if key=='BEAST' then return 1
elseif key=='DRAGONKIN' then return 2
elseif key=='DEMON' then return 3
elseif key=='ELEMENTAL' then return 4
elseif key=='GIANT' then return 5
elseif key=='UNDEAD' then return 6
elseif key=='HUMANOID' then return 7
elseif key=='CRITTER' then return 8
elseif key=='MECHANICAL' then return 9
elseif key=='OTHER' then return 10
elseif key=='TOTEM' then return 11
elseif key=='NONCOMBAT_PET' then return 12
elseif key=='GAS_CLUUD' then return 13 end