LibUnitControl-1.0

LibUnitControl-1.0 API

SetEventHandle(event, func)

Event and Utility Functions

Parameters

event
func


lib:GetEffectMaskByName(...)

Retrieve the bitmask that corresponds to the given effect strings.

Parameters

...
One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.

Return value

An effect bitmask.


lib:GetEffectMaskBySpell(spellID)

Retrieve a spell's effect bitmask.

Parameters

spellID
The spell's global id.

Return value

An effect bitmask.


lib:GetEffectStringByMask(spellMask, effectMask)

Retrieve a spell effect bitmask's associated effect strings.

Parameters

spellMask
effectMask
An effect bitmask.

Return value

One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.


lib:GetSpellEffectString(spellID)

Retrieve a spell's effect strings.

Parameters

spellID
The spell's global id.

Return value

One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.


lib:GetUnitEffectMask(unit)

Retrieve a unit's current effect bitmask.

Parameters

unit
The unit id (player, pet, etc...).

Return value

Bitmask containing effect type flags.


lib:GetUnitEffectString(unit)

Retrieve a unit's current effect strings.

Parameters

unit
The unit id (player, pet, etc...).

Return value

One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.


lib:SpellHasAllEffectStrings(spellID, ...)

Determine if the given spell utilizes all of the specified effect strings.

Parameters

spellID
The spell's global id.
...
One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.

Return value

Boolean indicating if the given spellID is all of the given spell types.


lib:SpellHasEffectString(spellID, ...)

Determine if the given spell utilizes at least one of the specified effect strings.

Parameters

spellID
The spell's global id.
...
One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.

Return value

Boolean indicating if the given spellID is one of the given spell types.


lib:UnitHasAllEffectMasks(unit, ...)

Determine if the given unit is afflicted with all of the specified effect bitmasks.

Parameters

unit
The unit id (player, pet, etc...).
...
A single or series of bitmasks that correspond to a given effect string. (Use lib:GetUnitEffectMask to retrieve an effect's bitmask).

Return value

Boolean indicating if the unit is afflicted with all of the queried effect bitmasks.


lib:UnitHasAllEffectStrings(unit, ...)

Determine if the given unit has all of the specified effect strings.

Parameters

unit
The unit id (player, pet, etc...).
...
One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.

Return value

Boolean indicating if the unit is afflicted with all of the queried effect strings.


lib:UnitHasControl(unit)

Determine if the given unit has complete control of their character.

Parameters

unit
The unit id (player, pet, etc...).

Return value

Boolean indicating whether the unit has complete control of their character.


lib:UnitHasEffectMask(unit, ...)

Determine if the given unit is afflicted with at least one of the specified effect bitmasks.

Parameters

unit
The unit id (player, pet, etc...).
...
A single or series of bitmasks that correspond to a given effect string. (Use lib:GetUnitEffectMask to retrieve an effect's bitmask).

Return value

Boolean indicating if the unit is afflicted with the queried effect bitmasks.


lib:UnitHasEffectString(unit, ...)

Determine if the given unit has at least one of the specified effect strings.

Parameters

unit
The unit id (player, pet, etc...).
...
One or more of the following strings: BANISH, CHARM, CONFUSE, DISARM_MH, DISARM_OH, DISARM_RS, DISORIENT, ENRAGE, FEAR, FREEZE, HORRIFY, INCAPACITATE, PACIFY, POLYMORPH, ROOT, SAP, SHACKLE, SILENCE, SLEEP, SNARE, STUN, TURN, WOUND.

Return value

Boolean indicating if the unit is afflicted with at least one of the queried effect strings.


lib:UnitIs*(unit)

(Banished/Charmed/Confused/Disoriented/Feared/Frozen/Horrified/Incapacitated/ Polymorphed/Sapped/Shackled/Asleep/Stunned/Turned/Disarmed/Pacified/Rooted/Silenced/ Ensnared/Enraged/Wounded).
Determine if the given unit is afflicted with the specified effect.

Parameters

unit
The unit id (player, pet, etc...).

Return value

Boolean indicating whether the unit is currently under the specified effect.

Usage

if lib:UnitIsSilenced(unitID) and lib:UnitIsPacified(unitID) then
	DEFAULT_CHAT_FRAME:AddMessage( UnitName(unitID) .. " is unable to attack!" )
end


lib:UnitSlotIsDisarmed(unit, invSlot)

Determine whether or not the given unit's inventory slot is disarmed.

Parameters

unit
The unit id (player, pet, etc...).
invSlot
The inventory slot id.

Return value

Boolean indicating whether the given slot is disarmed.