Skip to content

Repository files navigation

LibDispel

Worlf of Warcraft library to help track dispelable auras

Usage

localLibDispel=LibStub("LibDispel")
assert(LibDispel, "Addon requires LibDispel")
localframe=CreateFrame("Frame")
frame:RegisterEvent("UNIT_AURA")
frame:SetScript("OnEvent", function (self, event, ...)
ifevent=="UNIT_AURA" thenlocalunit, updateInfo=...localisFullUpdate=notupdateInfoorupdateInfo.isFullUpdateifisFullUpdatethenself.all=table.wipe(self.allor {})
self.actives=table.wipe(self.activesor {})
changed=truelocalslots= { C_UnitAuras.GetAuraSlots(unit, self.filter) }
fori=2, #slotsdo-- #1 return is continuationToken, we don't care about itlocalaura=C_UnitAuras.GetAuraDataBySlot(unit, slots[i])
-- dispelType will be equal to aura.dispelName, if the aura is "Magic", "Poison", "Curse" or "Disease"-- but dispelType can return "Bleed" or "Enrage" toolocaldispelType=LibDispel:GetDispelType(aura.spellId, aura.dispelName)
-- check if you can dispel this auralocalisDispelable=LibDispel:IsDispelable(unit, aura.spellId, dispelType, true)
endendendend)

License

Please, read LICENSE file.

About

a library to help track dispelable auras

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages