I have some prototype code. Right now, it reports everyone.
Lua Code:
local DeathCounter,DeathData,PlayerGUID=CreateFrame("Frame"),{},UnitGUID("player");
DeathCounter:RegisterEvent("GROUP_ROSTER_UPDATE");
DeathCounter:SetScript("OnEvent",function(self,event,unit)
if event=="GROUP_ROSTER_UPDATE" then
if IsInRaid(LE_PARTY_CATEGORY_HOME) and not IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then-- Check for raid, but not battleground
for guid in next,DeathData do-- Remove members when they leave
if guid~=PlayerGUID and not IsGUIDInGroup(guid) then
DeathData[guid]=nil;-- Cleanup if no longer in group
end
end
self:RegisterEvent("UNIT_HEALTH");-- Activate death watch (doesn't matter if it's already active)
else-- No longer in a valid group
table.wipe(DeathData);-- Clear all raid members
self:UnregisterEvent("UNIT_HEALTH");-- Deactivate death watch (saves performance)
end
elseif event=="UNIT_HEALTH" then
local guid,dead=UnitGUID(unit),UnitIsDead(unit);
if guid==PlayerGUID or IsGUIDInGroup(guid) then
local data=DeathData[guid]; if data then
if dead and not data.WasDead then-- TLDR: Did unit just die?
data.Deaths=data.Deaths+1;-- Increment deaths
if UnitIsGroupLeader("player") or UnitIsGroupAssistant("player") then-- Can't send RAID_WARNING if not either of these
SendChatMessage(("DeathCounter: %s has died %d time(s) so far."):format(UnitName(unit),data.Deaths),"RAID_WARNING");
end
end
data.WasDead=dead;-- Update living state
else DeathData[guid]={WasDead=dead,Deaths=0}; end-- Using the first health update to initialize data (if they join while dead, it doesn't count)
end
end
end);
PS: I may be one of those.
All I can say is I make the other casters go...