Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Tag: WoW API docs
Tag: WoW API docs
Line 12: Line 12:
 
;texture : <font color="#ecbc2a">string</font>- The texture path associated with the spell icon.
 
;texture : <font color="#ecbc2a">string</font>- The texture path associated with the spell icon.
 
;startTimeMS : <font color="#ecbc2a">number</font> - Specifies when casting began in milliseconds (corresponds to [[API GetTime|GetTime()]]*1000).
 
;startTimeMS : <font color="#ecbc2a">number</font> - Specifies when casting began in milliseconds (corresponds to [[API GetTime|GetTime()]]*1000).
;endTimeMS : <font color="#ecbc2a">number</font>- Specifies when casting will end in milliseconds (corresponds to [[API GetTime|GetTime()]]*1000).
+
;endTimeMS : <font color="#ecbc2a">number</font> - Specifies when casting will end in milliseconds (corresponds to [[API GetTime|GetTime()]]*1000).
 
;isTradeSkill : <font color="#ecbc2a">boolean</font> - Specifies if the cast is a tradeskill
 
;isTradeSkill : <font color="#ecbc2a">boolean</font> - Specifies if the cast is a tradeskill
 
;castID : <font color="#ecbc2a">string</font> ([[GUID]]) - The unique identifier for this spell cast, for example <code>Cast-3-3890-1159-21205-8936-00014B7E7F</code>.
 
;castID : <font color="#ecbc2a">string</font> ([[GUID]]) - The unique identifier for this spell cast, for example <code>Cast-3-3890-1159-21205-8936-00014B7E7F</code>.

Revision as of 08:00, 9 June 2021

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

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

Arguments

unit
string : UnitId

Returns

name
string - The name of the spell, or nil if no spell is being cast.
text
string - The name to be displayed.
texture
string- The texture path associated with the spell icon.
startTimeMS
number - Specifies when casting began in milliseconds (corresponds to GetTime()*1000).
endTimeMS
number - Specifies when casting will end in milliseconds (corresponds to GetTime()*1000).
isTradeSkill
boolean - Specifies if the cast is a tradeskill
castID
string (GUID) - The unique identifier for this spell cast, for example Cast-3-3890-1159-21205-8936-00014B7E7F.
notInterruptible
boolean - if true, indicates that this cast cannot be interrupted with abilities like Ability kick [Kick] or Ability warrior shieldbash [Shield Bash]. In default UI those spells have shield frame around their icons on enemy cast bars. This return value is omitted in BCC Bc icon.
spellId
number - The spell's unique identifier. (Added in 7.2.5)

Example

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

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

Details

  • For channeled spells, displayName is "Channeling". So far displayName is observed to be the same as name in any other contexts.
  • This function may not return anything when the target is channeling spell post it warm-up period, you should use UnitChannelInfo in that case. It takes the same arguments and returns similar values specific to channeling spells.
  • WoW Icon update In Classic, the alternative CastingInfo() is similar to UnitCastingInfo("player")

Patch changes

  • Battle for Azeroth Patch 8.0.1 (2018-07-17): Removed the second parameter, "nameSubtext". Second parameter is now "text" (former third parameter).
  • Legion Patch 7.2.5 (2017-06-13): The castID return value is now a GUID. Previously it represented the number of spell casts since the game was started.
  • Bc icon Patch 2.0.1 (2006-12-05): Added.[1]

References