API:GetAbilityRanges
From RoR Wiki
UI Lua API · Ability functions
Version: WAR 1.4.8
Returns the minimum and maximum range of an ability.
minRange, maxRange = GetAbilityRanges(abilityId)
Arguments
- abilityId
number– Id of the ability. It is converted to a 16-bit integer.
Returns
- minRange
number– Minimum range, a whole number.- maxRange
number– Maximum range, a whole number.
Details
- The client divides its internal range values by 12 and rounds to the nearest whole number. The stock tooltip treats the results as feet and converts them to metres for the Korean territory.
- The stock tooltip shows "no range" unless
maxRangeis above 0. - Both values are 0 when there is no player object.
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 minRange, maxRange = GetAbilityRanges (abilityData.id)
if ((minRange > 0) and (maxRange > 0))
then
local stringID = StringTables.Default.LABEL_ABILITY_TOOLTIP_MIN_RANGE_TO_MAX_RANGE
...
elseif (maxRange > 0)
then
local stringID = StringTables.Default.LABEL_ABILITY_TOOLTIP_MAX_RANGE
