- -- Get all unit debuffs
- i = 1;
- while true do
- auraName, _, icon, count, debuffType, _, expires, caster, _, _, spellId = UnitDebuff(unit, i);
- if not spellId then break end
- -- TODO debuffType check better
- if watchedAuras[auraName] or watchedAuras[spellId] or watchedAuras[debuffType] then
- unitDebuffs[i] = {};
- unitDebuffs[i].auraName = auraName;
- unitDebuffs[i].spellId = spellId;
- unitDebuffs[i].count = count;
- unitDebuffs[i].expires = expires;
- unitDebuffs[i].mine = UnitIsUnit(caster, "player");
- unitDebuffs[i].icon = icon;
- unitDebuffs[i].debuffType = debuffType;
+ for _, filter in ipairs(auraFilters) do
+ local i = 1;
+ while true do
+ auraName, _, icon, count, debuffType, _, expires, caster, _, _, spellId = UnitAura(unit, i, filter);
+ if not spellId then break end
+ if watchedAuras[auraName] or watchedAuras[spellId] or watchedAuras[debuffType] then
+ local aura = {};
+ aura.auraName = auraName;
+ aura.spellId = spellId;
+ aura.count = count;
+ aura.expires = expires;
+ aura.mine = UnitIsUnit(caster, "player");
+ aura.icon = icon;
+ aura.debuffType = debuffType;
+ table.insert(unitAuras, aura);
+ end
+ i = i + 1;