Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetAbilityDescription

From RoR Wiki

UI Lua API · Ability functions
Version: WAR 1.4.8

Returns the description text of an ability at a given upgrade rank.

description = GetAbilityDescription(abilityId, upgradeRank)

Arguments

abilityId
number – Id of the ability. It is converted to a 16-bit integer.
upgradeRank
number – Upgrade rank to describe. It is converted to an 8-bit integer. The stock UI passes 0 when it has no rank.

Returns

description
wstring – Description text, or L"".

Details

  • The text comes from the abilitydesc string table, with its placeholders filled in by the client. The result is cached per ability and rank.
  • L"" is also returned when the player's ability data is not loaded.
  • If there is no player object, or the Lua state is not available, the function returns nothing.
  • The function needs at least two arguments and only reads the last two.
  • The stock UI wraps it in GetAbilityDesc(id, upgradeRank) (easystem_strings/source/stringutils.lua), which defaults upgradeRank to 0.

Errors

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

Example

From easystem_strings/source/stringutils.lua:

function GetAbilityDesc( id, upgradeRank )
    if( id == nil ) then
        ERROR(L"Invalid params to GetAbilityDesc (id, upgradeRank): id is nil")
        return L""
    end

    upgradeRank = upgradeRank or 0

    return GetAbilityDescription (id, upgradeRank)
end

See also