Thread Tools Display Modes
05-12-22, 07:26 AM   #1
darhanger
A Fallenroot Satyr
 
darhanger's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2017
Posts: 20
Debufftype timer

For exmaple i have for certaine debuff by spell id or name. How i can make it for debuff type?
Lua Code:
  1. debufftimer = function(t, id, filter)
  2.     local spellName;
  3.     if tonumber(id) ~= nil then
  4.         spellName = GetSpellInfo(id);
  5.     else
  6.         spellName = id
  7.     end
  8.    
  9.     local expirationTime = select(7, UnitDebuff(t, spellName, filter))
  10.     local duration = select(6, UnitDebuff(t, spellName, filter))
  11.     if expirationTime ~= nil then
  12.         return duration - (expirationTime - GetTime())  
  13.     else
  14.         return 0
  15.     end
  16. end;

Like
Lua Code:
  1. if debufftypetime("player", "Magic") > 3 then
  2. --- do stuff
  3. end
  Reply With Quote
05-12-22, 11:36 AM   #2
nonexistentx_x
A Murloc Raider
 
nonexistentx_x's Avatar
Join Date: Mar 2019
Posts: 8
for example:
Lua Code:
  1. local PostUpdateDebuff = function(self, unit, button, index)
  2.     local name, _, _, _, dtype, duration, expTime = UnitAura(unit, index, button.filter)
  3.  
  4.     if dtype == "Magic" and button.debuff then
  5.         button.stealable:Show()
  6.     end
  7. end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Debufftype timer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off