API:GetAbilityCooldown
From RoR Wiki
UI Lua API · Ability functions
Version: WAR 1.4.8
Returns the cooldown of an ability for the player, in milliseconds.
cooldown = GetAbilityCooldown(abilityId)
Arguments
- abilityId
number– Id of the ability. It is converted to a 16-bit integer.
Returns
- cooldown
number– Cooldown in milliseconds. 0 for an unknown ability.
Details
- The value is computed by the client for the player. A comment in
easystem_tooltips/source/abilitytooltips.luasays it includes bonuses, unlike thecooldownfield of GetAbilityData, which is in seconds. - 0 is returned when there is no player object.
- This is the length of the cooldown, not the time left. For the time left on a hotbar slot use GetHotbarCooldown.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From easystem_tooltips/source/abilitytooltips.lua:
-- Get the cooldown including potential bonuses from c instead of the value stored in abilityData.cooldown local realCooldown = GetAbilityCooldown( abilityData.id ) / 1000 LabelSetText( windowName.."Cooldown", GetAbilityCooldownText( realCooldown ) )
