Skip to content

Commit

Permalink
rules: don't count pets and dead players for missing raid buffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainrider committed Sep 13, 2018
1 parent 6121849 commit ac4465a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 33 deletions.
29 changes: 18 additions & 11 deletions rules/Mage.lua
Expand Up @@ -140,22 +140,29 @@ AdiButtonAuras:RegisterRules(function()
{'GROUP_ROSTER_UPDATE', 'UNIT_AURA'},
function(units, model)
local missing = 0
local shortest = 0
local shortest
for unit in next, units.group do
local found, _, expiration = GetBuff(unit, 1459)
if found then
if shortest == 0 or expiration < shortest then
shortest = expiration
if UnitIsPlayer(unit) and not UnitIsDeadOrGhost(unit) then
local found, _, expiration = GetBuff(unit, 1459)
if found then
if not shortest or expiration < shortest then
shortest = expiration
end
else
missing = missing + 1
end
else
missing = missing + 1
end
end
model.expiration = shortest
model.count = missing
model.hint = missing ~= 0
model.highlight = shortest > 0 and 'good' or nil
if shortest then
model.expiration = shortest
model.highlight = 'good'
end
if missing > 0 then
model.count = missing
model.maxCount = missing
model.hint = true
end
end,
},
}
Expand Down
28 changes: 17 additions & 11 deletions rules/Priest.lua
Expand Up @@ -151,22 +151,28 @@ AdiButtonAuras:RegisterRules(function()
{'GROUP_ROSTER_UPDATE', 'UNIT_AURA'},
function(units, model)
local missing = 0
local shortest = 0
local shortest
for unit in next, units.group do
local found, _, expiration = GetBuff(unit, 21562)
if found then
if shortest == 0 or expiration < shortest then
shortest = expiration
if UnitIsPlayer(unit) and not UnitIsDeadOrGhost(unit) then
local found, _, expiration = GetBuff(unit, 21562)
if found then
if not shortest or expiration < shortest then
shortest = expiration
end
else
missing = missing + 1
end
else
missing = missing + 1
end
end
model.expiration = shortest
model.count = missing
model.hint = missing ~= 0
model.highlight = shortest > 0 and 'good' or nil
if shortest then
model.expiration = shortest
model.highlight = 'good'
end
if missing > 0 then
model.count = missing
model.hint = true
end
end,
},
}
Expand Down
28 changes: 17 additions & 11 deletions rules/Warrior.lua
Expand Up @@ -66,22 +66,28 @@ AdiButtonAuras:RegisterRules(function()
{'GROUP_ROSTER_UPDATE', 'UNIT_AURA'},
function(units, model)
local missing = 0
local shortest = 0
local shortest
for unit in next, units.group do
local found, _, expiration = GetBuff(unit, 6673)
if found then
if shortest == 0 or expiration < shortest then
shortest = expiration
if UnitIsPlayer(unit) and not UnitIsDeadOrGhost(unit) then
local found, _, expiration = GetBuff(unit, 6673)
if found then
if not shortest or expiration < shortest then
shortest = expiration
end
else
missing = missing + 1
end
else
missing = missing + 1
end
end
model.expiration = shortest
model.count = missing
model.hint = missing ~= 0
model.highlight = shortest > 0 and 'good' or nil
if shortest then
model.expiration = shortest
model.highlight = 'good'
end
if missing > 0 then
model.count = missing
model.hint = true
end
end,
},
}
Expand Down

0 comments on commit ac4465a

Please sign in to comment.