Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:IsAbilityEnabled

From RoR Wiki

UI Lua API · Ability functions
Version: WAR 1.4.8

Returns whether the player can currently use an ability, not counting the target.

enabled = IsAbilityEnabled(abilityId)

Arguments

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

Returns

enabled
boolean – true if the client's usability check for the player passes.

Details

  • The target is not part of this check; use IsTargetValid for that.
  • false is returned for an unknown ability, and when there is no player object.
  • The stock morale bar polls it to grey out morale abilities. Hotbar buttons get the same kind of flag from GetHotbarData.

Errors

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

Example

From ea_moralewindow/source/moralewindow.lua:

local isBlocked = Player.IsAbilityBlocked( abilityId, GameData.AbilityType.MORALE )
self:SetIcon( self.m_IconNum, IsAbilityEnabled( abilityId ), isBlocked )

See also