Returns information on the spell currently cast by the specified unit. Returns nil if no spell is being cast.
spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, interrupt = UnitCastingInfo("unit")
- String - The UnitId to query (e.g. "player", "party2", "pet", "target" etc.)
- String - The name of the spell, or nil if no spell is being cast.
- String - The string describing the rank of the spell, e.g. "Rank 1".
- String - The name to be displayed.
- String - The texture path associated with the spell.
- Number - Specifies when casting has begun, in milliseconds.
- Number - Specifies when casting will end, in milliseconds.
- Boolean - Specifies if the cast is a tradeskill
- Number - Counts the spellcast(s) since the game has loaded.(added either in or just before 3.2)
- ? (added in 3.2... not sure what this is for, tested against interruptable player spells and gave a false value)
local spell, _, _, _, _, endTime = UnitCastingInfo("player") if spell then local finish = endTime/1000 - GetTime() ChatFrame1:AddMessage(spell .. ' will be finished casting in ' .. finish .. ' seconds.') end
- If you're currently casting Shadowbolt:
Shadowbolt will be finished casting in 1.234 seconds.
For channeled spells, displayName is "Channeling".
Not sure if displayName ever differs from spell in any other contexts.
As of May 10, 2008, this does not return anything while casting Hellfire, Drain Life, or Rain of Fire with my warlock. The correct API for channeled spells is UnitChannelInfo. It takes the same arguments and returns the same values, but is specific to channeled spells.
New in Patch 3.2 (August 2009), returns 'interrupt' as well. Believe this is a boolean value for whether it is interruptable or not, but needs confirmation.
Also, the official WoW 3.2 patch changes page lists the returns as:
name, nameSubtext, text, texture, startTime, endTime, isTradeSkill, castID, interrupt
Didn't see 'castID' in there before, so added it to the returns list above. Assume it's a number, but this and the return type of interrupt need to be confirmed