Skip to content

rgd87/LibAbsorbCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibAbsorbCounter

Tracks Shield auras on units and sums up their current absorb values to replicate UnitGetTotalAbsorbs

Currently only works in Cataclysm.

Usage example:

local UnitGetTotalAbsorbs = UnitGetTotalAbsorbs

if isRetail then
    YourAddon:RegisterEvent("UNIT_ABSORB_AMOUNT_CHANGED")
end

if isCataclysm then
    local LAC = LibStub("LibAbsorbCounter")
    UnitGetTotalAbsorbs = function(unit)
        return LAC:UnitGetTotalAbsorbs(unit)
    end
    LAC.RegisterCallback(self, "UNIT_ABSORB_AMOUNT_CHANGED", function(event, unit)
        self:UNIT_ABSORB_AMOUNT_CHANGED(event, unit)
    end)
end


function YouAddon:UNIT_ABSORB_AMOUNT_CHANGED(event, unit)
    local totalAbsorbs = UnitGetTotalAbsorbs(unit)
end

About

Aura total absorb amount counter

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages