For exmaple i have for certaine debuff by spell id or name. How i can make it for debuff type?
Lua Code:
debufftimer = function(t, id, filter)
local spellName;
if tonumber(id) ~= nil then
spellName = GetSpellInfo(id);
else
spellName = id
end
local expirationTime = select(7, UnitDebuff(t, spellName, filter))
local duration = select(6, UnitDebuff(t, spellName, filter))
if expirationTime ~= nil then
return duration - (expirationTime - GetTime())
else
return 0
end
end;
Like
Lua Code:
if debufftypetime("player", "Magic") > 3 then
--- do stuff
end