API:GetAbilityCastTime
From RoR Wiki
UI Lua API · Ability functions
Version: WAR 1.4.8
Returns the cast time of an ability for the player, in seconds.
castTime = GetAbilityCastTime(abilityId)
Arguments
- abilityId
number– Id of the ability. It is converted to a 16-bit integer.
Returns
- castTime
number– Cast time in seconds. Can have a fractional part.
Details
- The client computes the value in milliseconds for the player and divides it by 1000.
- 0 is returned for an unknown ability and when there is no player object. The stock tooltip shows "instant" for 0.
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 castTime = GetAbilityCastTime (abilityData.id)
if (castTime > 0)
then
local _, castTimeFraction = math.modf (castTime)
...
end
return (GetString (StringTables.Default.LABEL_ABILITY_TOOLTIP_INSTANT_CAST))
