Thread Tools Display Modes
10-10-14, 03:34 AM   #1
cremor
A Murloc Raider
Join Date: Jun 2008
Posts: 9
API/Addon for new combat resurrection mechanic available?

So the new combat resurrection mechanic starts with 1 available combat resurrection and you get an additional combat resurrection every 90/<raid members> minutes. The current available count is visible like charges on the combat resurrection spell buttons, but what about classes that don't have a combat resurrection spell?

Is there an API to get the current count of available combat resurrections from the new system? If yes, is there already an addon that uses it? Something like a LDB display? This would be very helpful for raid leaders.
 
10-10-14, 04:22 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
You don't need an API for gathering this information, just track the combatlog and do the math yourself.
Since this is fairly new, I doubt any addon has been made for this specific purpose yet, but I'm sure there will be.
 
10-10-14, 04:57 AM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You don't need the combat log, you only need to track how many players have come back to life over the course of the current boss fight.

If I understand this correctly, you get 1 charge at the start of a boss fight, and gain another every 90/GetNumGroupMembers() minutes (no rounding?).

Should be fairly easy to write, assuming those parameters are accurate.
 
10-10-14, 05:49 AM   #4
cremor
A Murloc Raider
Join Date: Jun 2008
Posts: 9
Is it really just 90/GetNumGroupMembers()? I'd assume it's more like the flex scaling, where only group members participating in the boss fight (e.g. not outside of the instance) are counted.

And how do you track resurrection without combat log events? Is there a specific event for that? I could only find one for the player itself.
 
10-10-14, 06:46 AM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Here's a dry-coded example, so I have no idea if it works.
Lua Code:
  1. -- todo: Track that someone in the raid is actually capable of battle rezzing and alive
  2. local WhoDead, SecondsPerRez, ElapsedTime, NumRezzed = {}, 1, 0, 0
  3. local f = CreateFrame('frame') f:Hide()
  4. f:SetScript('OnEvent', function(self, event, ...) return self[event] and self[event](self, ...) end)
  5.  
  6. function f:ENCOUNTER_START(encounterID, encounterName, difficultyID, raidSize)
  7.     if difficultyID < 3 then return end
  8.     wipe(WhoDead)
  9.     SecondsPerRez, ElapsedTime, NumRezzed = 5400 / raidSize, 0, 0
  10.     self:RegisterEvent('INCOMING_RESURRECT_CHANGED')
  11.     self:Show()
  12. end
  13. f:RegisterEvent('ENCOUNTER_START')
  14.  
  15. function f:ENCOUNTER_END()
  16.     self:Hide()
  17.     self:UnregisterEvent('INCOMING_RESURRECT_CHANGED')
  18. end
  19. f:RegisterEvent('ENCOUNTER_END')
  20.  
  21. function f:INCOMING_RESURRECT_CHANGED(unit) -- Track who has received a rez within range
  22.     local name = UnitName(unit)
  23.     if name and not WhoDead[name] and UnitHasIncomingResurrection(unit) then
  24.         WhoDead[name] = true
  25.     end
  26. end
  27.  
  28. f:SetScript('OnUpdate', function(self, elapsed)
  29.     ElapsedTime = ElapsedTime + elapsed
  30.    
  31.     for name in pairs(WhoDead) do
  32.         if not UnitIsDeadOrGhost(name) and UnitIsConnected(name) then -- Dead unit is no longer dead
  33.             WhoDead[name] = nil
  34.             NumRezzed = NumRezzed + 1
  35.         end
  36.     end
  37.    
  38.     local availableRezzes = 1 + floor(ElapsedTime / SecondsPerRez) - NumRezzed
  39.     -- Do something to display this number somewhere..
  40. end)
It doesn't actually do anything with the "availableRezzes" number, so if you want this for an LDB display or something you'll need to add the appropriate code for that.

I have no idea how reincarnation is factored into the new rules, and I don't know if reincarnation or soulstones trigger an incoming rez event, so it might just be simpler to check UNIT_HEALTH to track when they've died or rezzed.

Last edited by semlar : 10-10-14 at 07:55 AM.
 
10-10-14, 11:01 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by semlar View Post
I don't know if reincarnation or soulstones trigger an incoming rez event, ...
They don't. The event only indicates that a res spell started or stopped being cast on someone; there's no event that specifically notifies you when (or if) they actually ressurect, so you have to watch UNIT_HEALTH or just poll OnUpdate as in your example. The event also doesn't fire for Mass Res, though I suppose that's not relevant if you're only tracking in combat.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » API/Addon for new combat resurrection mechanic available?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off