UnitChannelInfo

From Warcraft Wiki
Jump to navigation Jump to search

Returns information about the spell currently being channeled by the specified unit.

name, displayName, textureID, startTimeMs, endTimeMs, isTradeskill, notInterruptible, spellID, isEmpowered, numEmpowerStages = UnitChannelInfo(unitToken)

Arguments

unitToken
string : UnitId

Returns

name
string - The name of the spell, or nil if no spell is being channeled.
displayName
string - The name to be displayed.
textureID
string - The texture path associated with the spell icon.
startTimeMs
number - Specifies when channeling began, in milliseconds (corresponds to GetTime()*1000).
endTimeMs
number - Specifies when channeling will end, in in milliseconds (corresponds to GetTime()*1000).
isTradeskill
boolean - Specifies if the cast is a tradeskill.
notInterruptible
boolean - if true, indicates that this channeling cannot be interrupted with abilities like [Kick] or [Pummel]. In default UI those spells have shield frame around their icons on enemy channeling bars. Always returns nil in Classic Bc icon.gif.
spellID
number - The spell's unique identifier.
isEmpowered
boolean
numEmpowerStages
number

Details

Related Events UNIT_SPELLCAST_CHANNEL_START
UNIT_SPELLCAST_CHANNEL_STOP
Related API ChannelInfo (Classic)

Example

The following snippet prints the amount of time remaining before the player's current spell finishes channeling.

local spell, _, _, _, endTimeMS = UnitChannelInfo("player")
if spell then 
 local finish = endTimeMS/1000 - GetTime()
 print(spell .. ' will be finished channeling in ' .. finish .. ' seconds.')
end

Patch changes

Retail

Battle for Azeroth Patch 8.0.1 (2018-07-17): Removed the second parameter, "nameSubtext". Second parameter is now "text" (former third parameter).
Bc icon.gif Patch 2.0.1 (2006-12-05): Added.[1]

Classic

Bc icon.gif Patch 2.5.3 (2022-01-18): Added notInterruptible (nil) for api consistency.

References