Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetMoraleCooldown

From RoR Wiki

UI Lua API · Hotbar functions
Version: WAR 1.4.8

Returns the cooldown of the ability in a morale bar slot.

cooldown, maxCooldown = GetMoraleCooldown(moraleLevel)

Arguments

moraleLevel
number – Morale slot, 1 to GameData.NUM_MORALE_LEVELS (4).

Returns

cooldown
number – Time left, in seconds.
maxCooldown
number – Total length of that cooldown, in seconds.

Details

  • The client takes whichever runs longest of the global cooldown, the morale cooldown and the ability's own cooldown, and returns its time left and length.
  • For an empty slot only the global cooldown is used.
  • For a slot outside 1 to 4 the result is 0, 0.
  • If there is no player object, or the Lua state is not available, the function returns nothing.

Errors

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

Example

From ea_moralewindow/source/moralewindow.lua:

self.m_Cooldown, self.m_MaxCooldown = GetMoraleCooldown (self.m_MoraleLevel)

See also