11/27/15, 07:47 PM | #1 |
[outdated] Improvements to player resurrection
Before I state my wish I try to describe the current state of the API.
Player resurrection has 2 stages. The active stage where a player has to press a key and shoots his weird beam at another player and the passive stage where the resurrection is pending and the receiving player has to react. The API currently only has parts of this covered: When I start resurrecting someone, EVENT_START_SOUL_GEM_RESURRECTION is fired. It does give me a duration, but not who I am resurrecting. The information about the player can be collected by hooking into TryShowingResurrectLabel on the PLAYER_TO_PLAYER object. Then we have EVENT_END_SOUL_GEM_RESURRECTION which is fired whenever the beam stops. This can be for a number of reasons, but the event does not provide us with any information about it. There is also no way I know of to get this reason via other means. Once the resurrection got through the target player can either accept, decline or wait until the timeout occurs. The failure cases are covered by EVENT_RESURRECT_FAILURE which gives a good amount of details (targetChar, reason, targetDisplayName). There are several reasons for it to fail:
When the player accepts the resurrection we don't get any direct indication that it happened. Only thing we could potentially try is infer that it happened by looking at the soul gem count in EVENT_INVENTORY_SINGLE_SLOT_UPDATE. But that is error prone as the count could change for any reason. On the receiving end we have no events when the player is getting resurrected, but we could potentially track it via IsUnitBeingResurrected("player") in an update handler. We also don't get any info when it gets interrupted. As soon as the resurrection succeeds we get EVENT_RESURRECT_REQUEST and can access the information about it via GetPendingResurrectInfo. Finally we get EVENT_RESURRECT_REQUEST_REMOVED when we press accept, decline or the timeout happens, but again have no information which of the 3 cases caused the event to fire. It's possible to hook into AcceptResurrect and DeclineResurrect to differentiate them though. My wish for the wishlist is that we get events and functions that provide us with all the details for each stage on both ends. I would also like to see a new unit group for resurrections (e.g. resurrect1 ... n) that gives us access to players that are resurrecting us or that we are resurrecting. The unit would live from when the resurrection starts to when it is over. Events:
Functions: More than one player can try to resurrect us, so we need to be able to access them all:
We can give one resurrect at a time and we can also receive one at the same time, so we will need two different functions.
PlayerResurrectionCancelledReason
PlayerResurrectionFailedReason
This idealized version is probably not feasible any time soon, but at least an event that provides the missing information about accepted resurrections by other players would be good to have as it is something I would like to use in one of my addons. |
|
ESOUI » Developer Discussions » Wish List » [outdated] Improvements to player resurrection |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Switch to Hybrid Mode |
Threaded Mode |
|
|