LibDispellable-1.0

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

Test if the player can dispel the given aura on the given unit.

Parameters

unit
(string) The unit id.
isBuff
(boolean) True if the spell is a buff.
dispelType
(string) The dispel mechanism, as returned by UnitAura.
spellID
(number) The aura spell ID, as returned by UnitAura, used to test enrage effects.

Return values

  1. boolean true if the player knows a spell to dispel the aura.
  2. number The spell ID of the spell to dispel, or nil.


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:GetDispelSpell(dispelType, spellID, isBuff)

Check which player spell can be used to dispel an aura.

Parameters

dispelType
(string) The dispel mechanism as returned by UnitAura
spellID
(number) The spell ID
isBuff
(boolean) True if the spell is a buff, false if it is a debuff.

Return value

number The spell ID of the dispel, or nil if the player cannot dispel it.


LibDispellable:GetDispelType(dispelType, spellID)

Get the actual dispel mechanism of an aura, including special cases.

Parameters

dispelType
(string) The dispel mechanism as returned by UnitAura
spellID
(number) The spell ID

Return value

dispelType (string) The actual dispel mechanism


LibDispellable:HasDispel()

Test if player can dispel anything.

Return value

boolean true if the player has any spell that can be used to dispel something.


LibDispellable:IsDispellable(dispelType, spellID)

Check if an aura can be dispelled by anyone.

Parameters

dispelType
(string) The dispel mechanism as returned by UnitAura
spellID
(number) The spell ID

Return value

boolean True if the aura can be dispelled in some way


LibDispellable:IterateDispelSpells()

Get an iterator of the dispel spells.

Return value

a (iterator, data, index) triplet usable in for .. in loops. Each iteration returns a spell id and the general dispel type: "offensive" or "debuff"


LibDispellable:IterateDispellableAuras(unit, buffs, allDispellable)

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

Parameters

unit
(string) The unit to scan.
buffs
(boolean) true to test buffs instead of debuffs (offensive dispel).
allDispellable
(boolean) Include auras that can be dispelled even if the player cannot.

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!