LibDispellable-1.0

LibDispellable:CanDispel(unit, offensive, dispelType, spellID)

Test if the player can dispel the given (de)buff on the given unit.

Parameters

unit
(string) The unit id.
offensive
(boolean) True to test offensive dispel, i.e. enemy buffs.
dispelType
(string) The dispel mechanism, as returned by UnitAura.
spellID
(number, optional) The buff spell ID, as returned by UnitAura, used to test enrage effects.

Return value

canDispel, spellID (boolean, number) Whether this kind of spell can be dispelled and the spell to use to do so.


LibDispellable:CanDispelWith(unit, spellID)

Test if the given spell can be used to dispel something on the given unit.

Parameters

unit
(string) The unit to check.
spellID
(number) The spell to use.

Return value

true if the

Usage

  if LibDispellable:CanDispelWith('focus', 4987) then
    -- Tell the user that Cleanse (id 4987) could be used to dispel something from the focus
  end


LibDispellable:IsEnrageEffect(spellID)

Test if the specified spell is an enrage effect

Parameters

spellID
(number) The spell ID

Return value

isEnrage (boolean) true if the passed spell ID


LibDispellable:IterateDispellableAuras(unit, offensive)

Iterate through unit (de)buffs that can be dispelled by the player.

Parameters

unit
(string) The unit to scan.
offensive
(boolean) true to test buffs instead of debuffs (offensive dispel).

Return value

A triplet usable in the "in" part of a for ... in ... do loop.

Usage

  for index, spellID, name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff in LibDispellable:IterateDispellableAuras("target", true) do
    print("Can dispel", name, "on target using", GetSpellInfo(spellID))
  end


You must login to post a comment. Don't have an account? Register to get one!