Quantcast
Download
(5 Kb)
Download
Updated: 03/07/16 08:22 AM
Compatibility:
Thieves Guild (2.3)
Updated:03/07/16 08:22 AM
Created:03/07/16 08:22 AM
Monthly downloads:10
Total downloads:453
Favorites:2
MD5:
LibResurrection
Version: r2
by: sirinsidiator [More]
LibResurrection provides a unified interface for handling player resurrection events via callbacks.
It separates the resurrection into a channeling stage and a confirmation stage.
The channeling part is only available when resurrecting other players, because the API does not give any information on incoming resurrections in this stage.

Special thanks to Randactyl for helping me test everything.

API Reference

PlayerResurrectionCancelledReson
These specify why the resurrection was cancelled before it could get to the second stage.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_UNKNOWN: The resurrection was cancelled for an unknown reason.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_ALREADY_CONSIDERING: Another player finished faster than us.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_SOUL_GEM_IN_USE: There is still a resurrection pending on a different target.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_NO_SOUL_GEM: There are no valid soul gems available.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_IN_KILLZONE: New ingame reason added in 100014. No idea what it is yet.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_PLAYER: Resurrection was stopped voluntarily. Not detected yet.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_INTERRUPTED: An enemy interrupted the resurrection with an attack. Not detected yet.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_RESPAWNED: The target player respawned by himself. Not detected yet.
lib.PLAYER_RESURRECTION_CANCELLED_REASON_DISCONNECTED: The target player disconnected. Not detected yet.


PlayerResurrectionFailedReason
These specify why the resurrection failed in the second stage.
lib.PLAYER_RESURRECTION_FAILED_REASON_UNKNOWN: The resurrection failed for an unknown reason.
lib.PLAYER_RESURRECTION_FAILED_REASON_DECLINED: The target player declined the resurrection.
lib.PLAYER_RESURRECTION_FAILED_REASON_TIMEOUT: The target player waited to long and the resurrection timed out.
lib.PLAYER_RESURRECTION_FAILED_REASON_RESPAWNED: The target player respawned by himself. Not detected yet.
lib.PLAYER_RESURRECTION_FAILED_REASON_DISCONNECTED: The target player disconnected. Not detected yet.


GetIncomingPendingResurrectInfo
Code:
string characterName, string displayName, number timeLeft = lib:GetIncomingPendingResurrectInfo()
Returns the character name, display name and time left on an incoming resurrection in milliseconds during the second stage.

GetOutgoingPendingResurrectInfo
Code:
string characterName, string displayName, number timeLeft = lib:GetOutgoingPendingResurrectInfo()
Returns the character name, display name and time left on an outgoing resurrection in milliseconds during the second stage.

RegisterCallback
Code:
lib:RegisterCallback(string eventName, function callback)
Register to callbacks from the library.
Valid callbacks are PlayerResurrectionPending, PlayerResurrectionPending and PlayerResurrectionFailed for incoming resurrections and TargetResurrectionStarted, TargetResurrectionCancelled, TargetResurrectionPending, TargetResurrectionAccepted and TargetResurrectionFailed for outgoing resurrections.
They provide the player name and some additional information about the progress.

UnregisterCallback
Code:
lib:UnregisterCallback(string eventName, function callback)
Unregister from callbacks. See RegisterCallback().

PlayerResurrectionPending
Code:
PlayerResurrectionPending(string incomingCharacterName, string incomingPlayerName, number timeLeft)
Fired when the first stage succeeded. Passes the characterName and displayName of the resurrecting player and timeLeft before it fails in milliseconds.

PlayerResurrectionAccepted
Code:
PlayerResurrectionAccepted(string incomingCharacterName, string incomingPlayerName)
Fired when the player accepted the resurrection. Passes the characterName and displayName of the resurrecting player.

PlayerResurrectionFailed
Code:
PlayerResurrectionFailed(string incomingCharacterName, string incomingPlayerName, PlayerResurrectionFailedReason reason)
Fired when the resurrection failed after completing the first stage. Passes the characterName and displayName of the resurrecting player and the PlayerResurrectionFailedReason.

TargetResurrectionStarted
Code:
TargetResurrectionStarted(string targetCharacterName, string targetPlayerName, number duration)
Fired when the player starts resurrecting another player. Passes the characterName and displayName of the target player and duration of the channeling in milliseconds.

TargetResurrectionCancelled
Code:
TargetResurrectionCancelled(string targetCharacterName, string targetPlayerName, PlayerResurrectionCancelledReason reason)
Fired when the resurrection stopped before reaching the second stage. Passes the characterName and displayName of the target player and the PlayerResurrectionCancelledReason.

TargetResurrectionPending
Code:
TargetResurrectionPending(string targetCharacterName, string targetPlayerName, number timeLeft)
Fired when the first stage succeeded. Passes the characterName and displayName of the target player and the timeLeft before it fails in milliseconds.

TargetResurrectionAccepted
Code:
TargetResurrectionAccepted(string targetCharacterName, string targetPlayerName)
Fired when the target player accepts the resurrection. Passes the characterName and displayName of the target player.

TargetResurrectionFailed
Code:
TargetResurrectionFailed(string targetCharacterName, string targetPlayerName, PlayerResurrectionFailedReason reason)
Fired when the resurrection failed after completing the first stage. Passes the characterName and displayName of the target player and the PlayerResurrectionFailedReason.
Optional Files (0)


There have been no comments posted to this file.
Be the first to add one.



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.