mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- extracted some functionality from the lacerate and sunder count modules to IceHUD for determining spell/ability buffs/debuffs on units. also fixed a small 3.0 bug in said modules for determining if the buff/debuff belonged to the player or not
This commit is contained in:
24
IceHUD.lua
24
IceHUD.lua
@ -561,3 +561,27 @@ function IceHUD:MathRound(num, idp)
|
||||
local mult = 10^(idp or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
function IceHUD:GetBuffCount(unit, ability, onlyMine)
|
||||
return IceHUD:GetAuraCount("HELPFUL"..(onlyMine and "|PLAYER" or ""), unit, ability)
|
||||
end
|
||||
|
||||
function IceHUD:GetDebuffCount(unit, ability, onlyMine)
|
||||
return IceHUD:GetAuraCount("HARMFUL"..(onlyMine and "|PLAYER" or ""), unit, ability)
|
||||
end
|
||||
|
||||
function IceHUD:GetAuraCount(auraType, unit, ability, onlyMine)
|
||||
for i = 1, 40 do
|
||||
local _, _, texture, applications = UnitAura(unit, i, auraType..(onlyMine and "|PLAYER" or ""))
|
||||
|
||||
if not texture then
|
||||
break
|
||||
end
|
||||
|
||||
if string.match(texture, ability) then
|
||||
return applications
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
Reference in New Issue
Block a user