UnitChannelInfo

From Wowpedia
Jump to: navigation, search
Game Flavors
Links
Patch
Added in 2.0.1 / 2.5.1

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

name, text, texture, startTimeMS, endTimeMS, isTradeSkill, notInterruptible, spellId = UnitChannelInfo(unit) -- retail
name, text, texture, startTimeMS, endTimeMS, isTradeSkill, spellId                   = UnitChannelInfo(unit) -- bcc

Arguments

unit 
String : UnitId

Returns

name 
String - The name of the spell, or nil if no spell is being channeled.
text 
String - The name to be displayed.
texture 
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 [Shield Bash]. In default UI those spells have shield frame around their icons on enemy channeling bars. This return value is omitted in BCC Bc icon.gif.
spellId 
Integer - The spell's unique identifier.

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

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

See also

References