API:GetAbilityData
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Returns a table describing one ability.
abilityData = GetAbilityData(abilityId)
Arguments
- abilityId
number– Id of the ability.
Returns
- abilityData
table– An ability data table (see below), plus the fieldisActive.
Ability data table
| Key | Type | Meaning |
|---|---|---|
id |
number |
Ability id. |
name |
wstring |
Ability name from the AbilityNames string table. L"" if that table is not available.
|
iconNum |
number |
Icon id for GetIconData. |
abilityType |
number |
Ability type, compared with GameData.AbilityType values.
|
targetType |
number |
— |
tacticType |
number |
Tactic type; indexes the result of GetNumTacticsSlots. |
numTacticSlots |
number |
Non-zero for tactics. The stock UI uses it to recognise a tactic. |
moraleLevel |
number |
Morale level of a morale ability; 0 for other abilities. |
moraleCost |
number |
— |
hasAPCostPerSecond |
boolean |
— |
abilityCost |
number |
— |
reuseTimer |
number |
Reuse timer, in seconds. |
reuseTimerMax |
number |
Maximum reuse timer, in seconds. |
cooldown |
number |
Same value as reuseTimerMax.
|
specialization |
number |
— |
stanceOrder |
number |
— |
careerID |
number |
— |
abilityImprovementThreshold |
number |
— |
abilityImprovementCap |
number |
— |
requiresPet |
boolean |
— |
isBuff, isDebuff, isDamaging, isHealing, isDefensive, isOffensive, isStatsBuff, isGranted, isPassive |
boolean |
Flags of the ability. Always present. |
isHex, isCurse, isCripple, isAilment, isBolster, isAugmentation, isBlessing, isEnchantment |
boolean |
Effect type flags. Only set (to true) when one of the ability's effects has that type; otherwise the key is absent.
|
typeColorRed, typeColorGreen, typeColorBlue |
number |
Colour of an effect type, 0–255. Only present when an effect type has a colour. |
Details
abilityIdis converted to an integer.isActiveistrueonly for ability 2490 while a particular player state flag is set. For every other ability it isfalse.- The client always returns a table. The stock wrapper
Player.GetAbilityData(easystem_utils/source/player.lua) treats a result whoseidisnilor 0 as "not found". - If there is no player object, or the Lua state is not available, the function returns nothing.
- The same ability data table is used for the entries of GetAbilityTable.
Errors
None.
Example
From easystem_utils/source/player.lua:
local abilityData = GetAbilityData (abilityId)
if (abilityData == nil or abilityData.id == nil or abilityData.id == 0) then
return nil
end
return abilityData
Building a tooltip, from ea_abilitieswindow/source/abilitieswindow.lua:
Tooltips.CreateAbilityTooltip( GetAbilityData(data.id), SystemData.ActiveWindow.name, AbilitiesWindow.TOOLTIP_ANCHOR)
