Thread Tools Display Modes
07-14-16, 08:29 PM   #1
Aznamir
A Fallenroot Satyr
 
Aznamir's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 26
Is there a way to get a count of the number of pets/minions assisting me in combat?

I'm talking about warlock pets/minions.
Don't want to count the combat ally assigned from the order hall.
Don't want to count quest NPCs assisting me in combat.

Is there any way count them and get their current heal as well?
 
07-15-16, 10:11 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
I doubt it. The only direct UnitID we have is for your main demon. None of the ones that spawn from your other abilities.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
 
07-15-16, 10:30 AM   #3
Aznamir
A Fallenroot Satyr
 
Aznamir's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 26
Okay, what about these unit frames:


Anyone know the name / events that trigger them?
 
07-15-16, 11:13 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
What does /fstack say about them?
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
 
07-15-16, 11:36 AM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You can track your pets through combat log events (probably SPELL_SUMMON), and mask their flags for ownership to see if they belong to the player.

Insert their GUID into a table when they spawn and remove them when they despawn; if they're on a timer just keep track of the timestamp and remove them after a set amount of time.

Last edited by semlar : 07-15-16 at 11:38 AM.
 
07-15-16, 02:43 PM   #6
Aznamir
A Fallenroot Satyr
 
Aznamir's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 26
Originally Posted by SDPhantom View Post
What does /fstack say about them?
Looks like it is a totem frame

 
07-17-16, 02:33 AM   #7
kokomala
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 29
Anything that is is displayed to the totem frame can be obtained with the totem API and events.

Pseudo code.
Code:
OnEvent(self, event, ...)
   if ( event == "PLAYER_TOTEM_UPDATE" ) then
      local slot = ...;
      local haveTotem, name, startTime, duration, icon = GetTotemInfo(slot)
  
      -- do stuff

   end
end
This API is also used for Death Knights and Druids.

http://wowprogramming.com/docs/api/GetTotemInfo
 
07-17-16, 07:38 PM   #8
Kith
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 9
Originally Posted by kokomala View Post
Anything that is is displayed to the totem frame can be obtained with the totem API and events.

Pseudo code.
Code:
OnEvent(self, event, ...)
   if ( event == "PLAYER_TOTEM_UPDATE" ) then
      local slot = ...;
      local haveTotem, name, startTime, duration, icon = GetTotemInfo(slot)
  
      -- do stuff

   end
end
This API is also used for Death Knights and Druids.

http://wowprogramming.com/docs/api/GetTotemInfo
I'm not sure whether its a bug in beta right now (or how its always been), but while working on the 'special cases' for my aura tracking mod, I found that the Serpent Statue (Mistweaver) triggers TOTEM_UPDATE but the info given by GetTotemInfo refers to the totem itself which doesn't return a valid spellID via GetSpellInfo(<namegiven>). May want to just check whether this is a one off (i'm intending to trial a few) or something that would need to be handled case-by-case.

Edit: Just to follow up, the TOTEM event now fires on several classes for different things that i've played with

Warlock (Demonology): The Wild Imps and the Dreadstalkers both trigger the event but return nothing for GetTotemInfo (i'm faking it by watching the SPELL_SUMMON event in the combat log)

Monk (Mistweaver): The Jade Serpent Statue works the same as Warlocks

Druid (Restoration): Efflorescence is the same

Shaman (Restoration): While they give the proper GetTotemInfo returns, if you take Echo which allows 2 charges of Healing Stream Totem, both have the same spellID and thus need to be handled specially (if using spellID as an indentifier)

Last edited by Kith : 07-18-16 at 03:15 AM.
 
07-20-16, 06:14 AM   #9
kokomala
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 29
You should always be tracking via the slot when using the totem events, and not via the spellID.

I highly doubt classes other than shaman will have a valid spellID, and the tooltips use tooltip:GetTotem(slot) to fill the tooltip information.

With COMBAT_LOG_EVENT_UNFILTERED and SPELL_SUMMON, you should be able to use something like this (untested):

Code:
local summons = {}

function frame:COMBAT_LOG_EVENT_UNFILTERED(timestamp, event,  hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
   if event == 'SPELL_SUMMON' and sourceName == UnitName('player') then
      local spellId, spellName, spellSchool = ...

      -- increment counter
      if not summons[destName] then 
        summons[destName] = {}
      end
        
      summons[destName] = summons[destName][destGUID] = timestamp

      -- demons last 12 seconds, remove from table
     C.Timer.After(12, function() summons[destName][destGUID] = nil end)

   end
end
It's then up to you to have a function that returns the current summons[destName] count, and another function to get the health from the GUID.

Be aware that the above code is untested. I'm also assuming destName/destGUID is used for the summoned demon. You could also store the table as a saved variable, which means you can still get an accurate count after a loading screen.

You could also probably combine them or use some other method to determine how many were summoned.

Last edited by kokomala : 07-20-16 at 07:25 PM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Is there a way to get a count of the number of pets/minions assisting me in combat?

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