View Single Post
10-11-14, 03:56 AM   #9
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by cremor View Post
Isn't the raidSize parameter of the ENCOUNTER_START event that value? I assumed so because you used it in your first example instead of GetNumGroupMembers().
Presumably the raid size argument from ENCOUNTER_START tells us how many people are engaged with the boss, but it doesn't tell us who they are.

Since there isn't an event specifically for detecting when someone comes back to life, we have to infer that someone has been resurrected based on the fact that the encounter is still in progress and someone has gone from "dead" to "alive".

The combat log can tell us when someone has died, and if someone has cast a resurrection spell on them, but not whether they've taken it. It also is the least reliable method for tracking that someone has been rezzed, because it can occasionally malfunction, and it would completely fail if you're in a different phase than the person who died.

In the worst-case-scenario we can't detect whether a player has been rezzed, but we can detect that they've come back to life. This is a tricky distinction because there have been fights where players are killed and resurrected as part of the fight itself (eg. the final phase of the lich king), but it's not something we should really worry too much about.

So, ultimately I think the best solution is to make a table of who's in the same zone at the start of the encounter, and either OnUpdate or on UNIT_HEALTH scan for dead and potentially resurrected raid members.

I think it's a toss-up whether UNIT_HEALTH or OnUpdate is more efficient in a raid; either way you're going to be calling a lot of functions. UNIT_HEALTH is probably slightly better, but you have to use OnUpdate anyway because the available number of charges is based on elapsed time, assuming you want to update a display as soon as the number changes.

There is one other aspect that I picked up from the blizzard post on the subject, and it's that dead players with pending resurrections have a debuff. I don't know what that debuff is called, but it could be used to distinguish between people who have died in the boss fight and people who died outside of it, unless it doesn't show for people with self-resurrections, in which case it isn't terribly helpful.

Last edited by semlar : 10-11-14 at 04:03 AM.