-
Notifications
You must be signed in to change notification settings - Fork 3
API Methods
Phanx edited this page Nov 17, 2014
·
1 revision
Returns information about the resurrection available to the specified unit, or the resurrection spell that is currently being cast on the specified unit.
status, endTime, casterUnit, casterGUID = lib:UnitHasIncomingRes(unit)
-
unit
- string: unitID or unitGUID of the unit to query
-
status
- string: the type of resurrection the unit has incoming, one of:-
"SELFRES"
if the unit has a soulstone available, -
"PENDING"
if the unit has a resurrection waiting to be accepted, -
"CASTING"
if the first resurrection that will land on the unit is a single-target resurrection spell, or -
"MASSRES"
if the first resurrection that will land on the unit is from Mass Resurrection.
-
-
endTime
- number: the time when the unit's available resurrection will expire, or when the first casting resurrection spell targeting the unit will finish, comparable toGetTime()
-
casterUnit
- string: the unitID of the unit casting the resurrection spell that will finish before any other resurrection spells targeting the same unit -
casterGUID
- string: the GUID of the unit casting the resurrection spell that will finish before any other resurrection spells targeting the same unit
All returns are nil
if the unit does not have a resurrection available and is not the target of any casting resurrection spells.
Returns information about the resurrection spell being cast by the specified unit.
endTime, targetUnit, targetGUID, isFirst = lib:UnitIsCastingRes(unit)
-
unit
- string: unitID or unitGUID of the unit to query
-
endTime
- number: the time when the resurrection spell being cast by the unit will finish casting, comparable toGetTime()
-
targetUnit
- string/nil: the unitID of the target of spell being cast by the unit, ornil
if the unit is casting Mass Resurrection -
targetGUID
- string/nil: the GUID of the target of spell being cast by the unit, ornil
if the unit is casting Mass Resurrection -
isFirst
- boolean:true
if the unit's single-target spell will finish casting before any other resurrection spells targeting the same unit, or if the unit's Mass Resurrection will finish casting before any other Mass Resurrections
All returns are nil if the unit is not casting a resurrection spell.
Registers a function to handle the specified callback.
lib.RegisterCallback(handler, callback, method, arg)
-
handler
- table/string: your addon object or another table containing a function athandler[method]
, or a string identifying your addon -
callback
- string: the name of the callback you wish to register for; see the callbacks API documentation for a full list -
method
- string/function/nil: a key name containing the desired handler function in themethod
table, or a function to be called, ornil
ifhandler
is a table and a function exists athandler[callback]
-
arg
- a value to be passed to the specified handler as its first argument
- Note that this function must be called with a dot, not a colon.
- If
handler
is a table,method
is a string, andhandler[method]
is a function, then that function will be called withhandler
as its first argument, followed by the callback name and the callback-specific arguments. - If
handler
is a table,method
is nil, andhandler[callback]
is a function, then that function will be called withhandler
as its first argument, followed by the callback name and the callback-specific arguments. - If
handler
is a string andmethod
is a function, then that function will be called with the callback name as its first argument, followed by the callback-specific arguments. - If
arg
is non-nil, then it will be passed to the specified function. Ifhandler
is a table, thenarg
will be passed as the second argument, pushing the callback name to the third position. Otherwise,arg
will be passed as the first argument. - Other cases will probably raise an error; see CallbackHandler-1.0 for more details.
Registers all callbacks at once, either with a single handler function for all, or individual handlers for each.
lib.RegisterAllCallbacks(handler, method, includeMassRes)
-
handler
- table/string: your addon object or another table containing a function athandler[method]
, or a string identifying your addon -
method
- string/function/nil: a key name containing the desired handler function in themethod
table, or a function to be called, ornil
ifhandler
is a table and a function exists athandler[callback]
for every callback -
includeMassRes
- boolean: true to register Mass Resurrection callbacks
- Note that this function must be called with a dot, not a colon.
- The
handler
andmethod
parameters are identical to those passed to the ordinaryRegisterCallback
method. - Mass Resurrection callbacks are excluded by default for backwards compatibility with previous revisions, since they pass different arguments than ordinary resurrection callbacks.
Unregisters all callbacks for the specified handler.
lib.UnregisterAllCallbacks(handler)
-
handler
- table/string: your addon object or another table containing your callback functions, or a string identifying your addon
- Note that this function must be called with a dot, not a colon.
- The
handler
value passed to this function should be the same table or string you passed when registering callbacks.