Quantcast API/Addon for new combat resurrection mechanic available? - WoWInterface
 
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,617
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,014
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,014
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,567
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.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
 
10-10-14, 06:55 PM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
I'm trying to decide how best to determine that the people in the raid are also in the current boss fight and not outside the instance.

You could loop over the raid on ENCOUNTER_START and put everyone who's in the same zone as you into a table to reference throughout the fight, or you could compare their zone (from GetRaidRosterInfo) to yours when they're resurrected.. but I'm not sure if phasing could potentially cause problems with that.

I was thinking something like this..
Lua Code:
  1. for i = 1, GetNumGroupMembers() do
  2.     local name, _, _, _, _, class, zone, online, isDead, _, _, role = GetRaidRosterInfo(i)
  3.     if zone == OurZone and online then
  4.         if not isDead and WhoDead[name] then -- unit no longer dead, presumed rezzed
  5.             WhoDead[name] = nil
  6.             NumRezzed = NumRezzed + 1
  7.         elseif isDead and not WhoDead[name] then -- someone died
  8.             WhoDead[name] = true
  9.         end
  10.     end
  11. end

Last edited by semlar : 10-10-14 at 06:59 PM.
 
10-11-14, 01:58 AM   #8
cremor
A Murloc Raider
Join Date: Jun 2008
Posts: 9
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().
 
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,014
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.
 
10-11-14, 08:32 AM   #10
ykiigor
A Murloc Raider
Join Date: Jun 2014
Posts: 9
CLEU event: SPELL_RESURRECT for start watching
And UNIT_FLAGS event with func UnitIsDead for tracking successful resurrection
Don't know how fast this, but it works
 
10-11-14, 04:11 PM   #11
InKahootz
A Murloc Raider
Join Date: Aug 2014
Posts: 7
Originally Posted by semlar View Post

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.
This is where I come in as I've been trying to solve the battle rez for my addon.
The debuff is called "Resurrecting". Seen here: http://wod.wowhead.com/spell=160029
There is a pretty big bug though, it applies in the CLEU but when raid testing was going on, there was no spell_aura_removed for it. One more big caveat, it doesn't work for warlocks who use soulstone.
Blizz has some big oversights here and we just have to figure out a way to work around them.
 
10-14-14, 01:36 AM   #12
InKahootz
A Murloc Raider
Join Date: Aug 2014
Posts: 7
I logged a dungeon and the time that a battle rez was used, the resurrecting debuff had a CLEU for removal. So there might be hope yet.
 
10-15-14, 12:04 AM   #13
cremor
A Murloc Raider
Join Date: Jun 2008
Posts: 9
Seems like oRA3 now has a BattleRes module that shows the remaining res count and a timer until the next one. It uses a way to get the number of raid members that wasn't discussed here yet: The last return value of GetInstanceInfo().
 
10-15-14, 12:56 PM   #14
InKahootz
A Murloc Raider
Join Date: Aug 2014
Posts: 7
Originally Posted by cremor View Post
Seems like oRA3 now has a BattleRes module that shows the remaining res count and a timer until the next one. It uses a way to get the number of raid members that wasn't discussed here yet: The last return value of GetInstanceInfo().
That's what I used in my very first iteration of my addon. Seems to work quite well for the flex size raids. It only holds the actual raid size for the flexible raid and I think it only returns 20 for Mythic. Not quite sure what will happen if you pull with less than 20 how the timer will react.
 
10-18-14, 05:20 PM   #15
InKahootz
A Murloc Raider
Join Date: Aug 2014
Posts: 7
Little bit of information I found. You can scan the left tooltip line 4 for how many seconds are left before another charge (for < 1 min remaining). You could just adjust your Mythic timer if it was found to be off.
 
10-19-14, 02:33 AM   #16
cremor
A Murloc Raider
Join Date: Jun 2008
Posts: 9
You mean tooltip scanning of a combat resurrection spell? Does that work for spells you don't have with the current class?
 
10-19-14, 08:03 PM   #17
InKahootz
A Murloc Raider
Join Date: Aug 2014
Posts: 7
Originally Posted by cremor View Post
You mean tooltip scanning of a combat resurrection spell? Does that work for spells you don't have with the current class?
Yep. Im a priest and the icons on my addon, which have a tooltip, show the recharge time.
 
10-19-14, 08:22 PM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,567
I don't think you need to scan the tooltip for that... you can just use the GetSpellCharges API function.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
 
10-19-14, 08:30 PM   #19
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,014
If tooltip scanning or calling GetSpellCharges works on a battle rez spell you don't have, then those are the methods to use for this.

There's no point jumping through hoops tracking anything else.
 
10-20-14, 03:28 AM   #20
ywfn
A Kobold Labourer
Join Date: Mar 2008
Posts: 1
Originally Posted by Phanx View Post
I don't think you need to scan the tooltip for that... you can just use the GetSpellCharges API function.
Tested in T16 LFR and it seems to work fine, I can pull current number of charges and time until next charge by looking at GetSpellCharges for Rebirth, Eternal Guardian, Raise Ally, or Soulstone. Outside of combat, charges just show up as nil, but when in combat, it's a number and the cooldown info is also correct. (Same as what you'd see on the button if you had a battle res spell yourself)

Had tested it earlier in T14 LFR and reported that it didn't work. But I just went back in and now it does work. Wonder if I screwed up my test macro earlier (rewrote it since then), or if there are actually some conditions under which it'll break...

(Note: I am playing a mage)

Last edited by ywfn : 10-20-14 at 04:10 AM.
 
 

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

Thread Tools
Display Modes

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