Module action.spell.Cooldown
This is the spell cooldown module.
Functions
| Spell:CooldownInfo () | Returns detailed cooldown information for the spell. |
| Spell:ChargesInfo () | Returns detailed charges information for the spell. |
| Spell:Cooldown () | Returns the total cooldown duration of the spell or a single charge. |
| Spell:CooldownRemains (bypassRecovery) | Returns the remaining cooldown time for the spell. |
| Spell:IsOnCooldown (bypassRecovery) | Checks if the spell is currently on cooldown or if a charge is recharging. |
| Spell:IsNotOnCooldown (bypassRecovery) | Checks if the spell is currently not on cooldown or if all charges are available. |
| Spell:Charges (bypassRecovery) | Returns the number of available charges for the spell, considering any active recharge. |
| Spell:MaxCharges () | Returns the maximum number of charges the spell can hold. |
| Spell:Recharge (bypassRecovery) | Returns the remaining time until the next charge is fully recharged. |
| Spell:ChargesFractional (bypassRecovery) | Returns the fractional number of charges, useful for visualizing recharge progress. |
| Spell:FullRechargeTime (bypassRecovery) | Returns the total time required to reach maximum charges from the current state. |
Functions
- Spell:CooldownInfo ()
-
Returns detailed cooldown information for the spell.
Returns:
- boolean isEnabled True if cooldown tracking is enabled for this spell.
- number startTime The time in seconds when the cooldown started. Returns 0 if not on cooldown.
- number modRate The cooldown modification rate.
- number duration The total duration of the cooldown in seconds.
- Spell:ChargesInfo ()
-
Returns detailed charges information for the spell.
Returns:
- number currentCharges The current number of charges available.
- number maxCharges The maximum number of charges the spell can hold.
- number cooldownStartTime The time in seconds when the charge cooldown started. Returns 0 if not recharging.
- number cooldownDuration The total duration of one charge's cooldown in seconds.
- Spell:Cooldown ()
-
Returns the total cooldown duration of the spell or a single charge.
If the spell uses a charge system, this returns the recharge duration for one charge.
Otherwise, it returns the global cooldown duration of the spell.
Returns:
-
number The cooldown duration in seconds.
- Spell:CooldownRemains (bypassRecovery)
-
Returns the remaining cooldown time for the spell.
For spells with charges, this returns the remaining time until the next charge is available.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
number The remaining cooldown time in seconds. Returns 0 if the spell is not on cooldown or all charges are available.
- Spell:IsOnCooldown (bypassRecovery)
-
Checks if the spell is currently on cooldown or if a charge is recharging.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
boolean True if the spell is on cooldown or a charge is recharging, false otherwise.
- Spell:IsNotOnCooldown (bypassRecovery)
-
Checks if the spell is currently not on cooldown or if all charges are available.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
boolean True if the spell is not on cooldown or all charges are available, false otherwise.
- Spell:Charges (bypassRecovery)
-
Returns the number of available charges for the spell, considering any active recharge.
If a charge is currently recharging, and the recharge is complete but not yet updated by the game,
this function will increment the charge count.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
number The effective number of available charges.
- Spell:MaxCharges ()
-
Returns the maximum number of charges the spell can hold.
Returns:
-
number The maximum number of charges.
- Spell:Recharge (bypassRecovery)
-
Returns the remaining time until the next charge is fully recharged.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
number The remaining recharge time in seconds. Returns 0 if all charges are full or no charge is recharging.
- Spell:ChargesFractional (bypassRecovery)
-
Returns the fractional number of charges, useful for visualizing recharge progress.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
number The current charges plus the fraction of the current recharging charge.
- Spell:FullRechargeTime (bypassRecovery)
-
Returns the total time required to reach maximum charges from the current state.
Parameters:
- bypassRecovery boolean Optional. If true, ignores recovery offset in calculation.
Returns:
-
number The total time in seconds to reach full charges. Returns 0 if already at max charges.