Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetAbilityRequirements

From RoR Wiki
Revision as of 19:42, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Ability functions
Version: WAR 1.4.8

Returns the requirement texts of an ability, as shown in its tooltip.

requirements = GetAbilityRequirements(abilityId)

Arguments

abilityId
number – Id of the ability. It is converted to a 16-bit integer.

Returns

requirements
table – Array of 5 wstring values, indexed 1 to 5.

Details

  • Each entry is a text from the abilityresults string table. Unused requirement slots, and all slots of an unknown ability, are L"".
  • If there is no player object, or the Lua state is not available, the function returns nothing.
  • The stock tooltip loops from 1 to GameData.ABILITY_REQUIREMENT_COUNT.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From easystem_tooltips/source/abilitytooltips.lua:

local reqs = GetAbilityRequirements( abilityData.id )

for reqsIndex = 1, GameData.ABILITY_REQUIREMENT_COUNT
do
    local reqsLabel = windowName.."Requirements"..reqsIndex

    if ((reqs[reqsIndex] ~= nil) and (DoesWindowExist (reqsLabel)))
    then
        LabelSetText (reqsLabel, reqs[reqsIndex])
    else
        LabelSetText (reqsLabel, L"")
    end
end

See also