Thread Tools Display Modes
04-03-17, 08:54 PM   #1
PJizzle
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 5
Enemies in Combat?

Is there a way to do a scan of all enemies I'm in combat with?

I know there's UnitAffectingCombat("unit")

I am asking because I want to check for debuffs on those enemies. For example, I can use blood boil to apply plaguestrike to enemies around me that doesn't have it. But I'd like to check, is there anyway to do this?
  Reply With Quote
04-05-17, 03:27 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
First of all, you need valid UnitIDs for the targets you'll be checking. For enemies around you, your best bet is scanning nameplates. This isn't exactly reliable as it's largely based on enemies actually being rendered on your screen. It won't target anything behind the camera or off to the side. Also, there's a finite limit on the number of nameplates that can be generated, about 30 or so.
__________________
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)
  Reply With Quote
04-05-17, 08:12 PM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Yeah, nameplates, 30 of them. Then I'd check the threat API and use that to see if you are actually in combat with them. Afterall, if you have threat, then you are in combat.

Of course, you could have a nameplate for a unit and you are not in combat with it, or you have zero threat (using single target spells on its friend, but not on it specificially) yet it is fighting you.
  Reply With Quote
04-06-17, 08:52 PM   #4
PJizzle
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 5
Thanks guys. I feared that would be the route. Oh well, for the addon I'm writing, it isn't worth the effort to do such a scan.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Enemies in Combat?


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