Module unit.Cast

Handles casting of units.

Functions

Unit:CastingInfo ()
Unit:ChannelingInfo ()
Unit:CastName ()
Unit:ChannelName ()
Unit:CastSpellID ()
Unit:ChannelSpellID ()
Unit:CastCost ()
Unit:IsCasting (spell)
Unit:IsChanneling (spell)
Unit:CastStart ()
Unit:ChannelStart ()
Unit:CastEnd ()
Unit:ChannelEnd ()
Unit:CastDuration ()
Unit:ChannelDuration ()
Unit:CastRemains ()
Unit:ChannelRemains ()
Unit:CastPercentage (reverseChannel)
Unit:ChannelPercentage (reverseChannel)
Unit:CastTime ()
Unit:IsInterruptible ()
Unit:IsStunnable ()


Functions

Unit:CastingInfo ()

Returns:

    table|nil Returns a table containing casting information if the unit is casting, otherwise nil.
Unit:ChannelingInfo ()

Returns:

    table|nil Returns a table containing channeling information if the unit is channeling, otherwise nil.
Unit:CastName ()

Returns:

    string|nil The name of the casting spell, or nil if not casting.
Unit:ChannelName ()

Returns:

    string|nil The name of the channeling spell, or nil if not channeling.
Unit:CastSpellID ()

Returns:

    number|nil The spell ID, or nil if not casting.
Unit:ChannelSpellID ()

Returns:

    number|nil The spell ID, or nil if not channeling.
Unit:CastCost ()

Returns:

    number The cost of the spell, or 0 if not casting or cost cannot be determined.
Unit:IsCasting (spell)

Parameters:

  • spell table|nil An optional spell object (e.g., {id = 123}) to check for a specific spell.

Returns:

    boolean True if casting (or casting the specified spell), false otherwise.
Unit:IsChanneling (spell)

Parameters:

  • spell table|nil An optional spell object (e.g., {id = 123}) to check for a specific spell.

Returns:

    boolean True if channeling (or channeling the specified spell), false otherwise.
Unit:CastStart ()

Returns:

    number The start time in seconds (converted from milliseconds), or 0 if not casting/channeling.
Unit:ChannelStart ()

Returns:

    number The start time in seconds, or 0 if not channeling.
Unit:CastEnd ()

Returns:

    number The end time in seconds (converted from milliseconds), or 0 if not casting/channeling.
Unit:ChannelEnd ()

Returns:

    number The end time in seconds, or 0 if not channeling.
Unit:CastDuration ()

Returns:

    number The duration in seconds, or nil if not casting/channeling.
Unit:ChannelDuration ()

Returns:

    number The duration in seconds, or nil if not channeling.
Unit:CastRemains ()

Returns:

    number The remaining time in seconds, or 0 if not casting/channeling or already finished.
Unit:ChannelRemains ()

Returns:

    number The remaining time in seconds, or 0 if not channeling or already finished.
Unit:CastPercentage (reverseChannel)

Parameters:

  • reverseChannel boolean|nil If true, reverses the percentage for channeling spells (e.g., 0% at start, 100% at end).

Returns:

    number The percentage completed (0-100), or 0 if not casting/channeling.
Unit:ChannelPercentage (reverseChannel)

Parameters:

  • reverseChannel boolean|nil If true, reverses the percentage for channeling spells.

Returns:

    number The percentage completed (0-100), or 0 if not channeling.
Unit:CastTime ()

Returns:

    number The elapsed time in seconds, or 0 if not casting/channeling.
Unit:IsInterruptible ()

Returns:

    boolean True if interruptible, false otherwise.
Unit:IsStunnable ()

Returns:

    boolean True if stunnable, false otherwise.
generated by LDoc 1.5.0 Last updated 2025-08-07 15:27:51