Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetAbilityTable

From RoR Wiki

UI Lua API · Game functions
Version: WAR 1.4.8

Returns all abilities of one type that the player knows.

abilities = GetAbilityTable(abilityType)

Arguments

abilityType
number – Ability type, a GameData.AbilityType value from 1 to 7.

Returns

abilities
table – Table keyed by ability id. Each value is an ability data table. It is not a sequence: use pairs.

Details

  • abilityType is converted to an integer.
  • Type 7 returns the guild's tactics instead of the player's abilities.
  • Type 6 does not compare abilityType; it selects abilities by a separate category the client stores for each known ability. For types 1–5 the result holds the known abilities whose abilityType equals the argument.
  • Any other value, or a missing ability list, makes the function return nothing. The stock UI checks the result for nil.
  • If there is no player object, or the Lua state is not available, the function returns nothing.
  • The stock UI caches every type in Player.RefreshAbilityLookups() (easystem_utils/source/player.lua). Its comment asks addons to use Player.GetAbilityTable, which returns the cached table.

Errors

None.

Example

From easystem_utils/source/player.lua:

for i = GameData.AbilityType.FIRST, GameData.AbilityType.NUM_TYPES do
    local abilityTable = GetAbilityTable (i)
    if (nil ~= abilityTable) then
        AbilityLookups[i] = { lookup = abilityTable }
    else
        DEBUG (L"Unable to retrieve ability table: "..i);
    end
end

Guild tactics, from ea_guildwindow/source/guildtacticslist.lua:

GuildTacticsList.tacticsTable = GetAbilityTable (GameData.AbilityType.GUILD)

See also