Created
March 2, 2015 00:02
-
-
Save GabeStah/4e1e179b21795b46ad1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local UnitIsCasting = function(spell, unit) | |
unit = unit or 'player' | |
if not UnitExists(unit) then return end | |
local spellName, _, _, _, spellStart, spellEnd, _, spellId = UnitCastingInfo(unit) | |
if not spellName then return end | |
if spell then | |
if type(spell) == 'string' then | |
if spellName == spell then return spellName, spellStart, spellEnd end | |
elseif type(tonumber(spell)) == 'number' then | |
if tonumber(spell) == spellId then return spellName, spellStart, spellEnd end | |
end | |
else | |
return spellName, spellStart, spellEnd | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment