- added basic implementation of Druid Eclipse bar for balance druids

This commit is contained in:
Parnic
2010-09-11 19:22:17 +00:00
parent 9d40348b80
commit 912edc3dc3
4 changed files with 295 additions and 51 deletions

View File

@ -923,21 +923,44 @@ function IceHUD:GetAuraCount(auraType, unit, ability, onlyMine, matchByName)
return 0
end
for i = 1, 40 do
local name, _, texture, applications = UnitAura(unit, i, auraType..(onlyMine and "|PLAYER" or ""))
if (not matchByName and not texture) or (matchByName and not name) then
break
end
if (not matchByName and string.match(texture:upper(), ability:upper())) or (matchByName and string.match(name:upper(), ability:upper())) then
local i = 1
local name, _, texture, applications = UnitAura(unit, i, auraType..(onlyMine and "|PLAYER" or ""))
while name do
if (not matchByName and string.match(texture:upper(), ability:upper()))
or (matchByName and string.match(name:upper(), ability:upper())) then
return applications
end
i = i + 1
name, _, texture, applications = UnitAura(unit, i, auraType..(onlyMine and "|PLAYER" or ""))
end
return 0
end
function IceHUD:HasBuffs(unit, spellIDs)
local retval = {}
for i=1, #spellIDs do
retval[i] = false
end
local i = 1
local name, _, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i)
while name do
for i=1, #spellIDs do
if spellIDs[i] == auraID then
retval[i] = applications == 0 and true or applications
break
end
end
i = i + 1
name, _, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i)
end
return retval
end
function IceHUD:OnDisable()
IceHUD.IceCore:Disable()
end