testmode DR only with enabled DRs

This commit is contained in:
Sumsebrum 2021-07-29 14:19:13 +02:00
parent d53f89c6d4
commit 0d5b5644a9

View File

@ -257,17 +257,17 @@ end
function Diminishings:Test(unit) function Diminishings:Test(unit)
if Gladdy.db.drEnabled then if Gladdy.db.drEnabled then
local spells = { 33786, 118, 8643, 8983 } local limit = {}
for i = 1, 4 do for spellID,category in pairs(DRData:GetSpells()) do
if i == 1 then if Gladdy.db.drCategories[category].enabled then
self:AuraFade(unit, spells[i]) if not limit[category] then
elseif i == 2 then limit[category] = { count = 1, limit = math.random(1,3) }
self:AuraFade(unit, spells[i])
self:AuraFade(unit, spells[i])
else else
self:AuraFade(unit, spells[i]) limit[category].count = limit[category].count + 1
self:AuraFade(unit, spells[i]) end
self:AuraFade(unit, spells[i]) if limit[category].count <= limit[category].limit then
self:AuraFade(unit, spellID)
end
end end
end end
end end