Quantcast How to detect how many enemies are around your current player - WoWInterface
 
Thread Tools Display Modes
01-14-20, 09:28 PM   #1
Damply
A Murloc Raider
Join Date: Jan 2020
Posts: 4
How to detect how many enemies are around your current player

I've been trying to create my own rotation addon just like hekili and its going okay but my only issue is aoe, how do i go about finding out how many enemies are around my player?
  Reply With Quote
01-15-20, 06:20 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,382
Originally Posted by Damply View Post
I've been trying to create my own rotation addon just like hekili and its going okay but my only issue is aoe, how do i go about finding out how many enemies are around my player?
I don't think you can. There are only unit options. target, focus etc .. you will have target and set it as focus, or target for it to be the target. I haven't seen a function that identifies mobs around you. Probably because its a step closer to automation .. just have left click for single target and right click for aoe and have the rotation tool just highlight the button that has the appropriate single/aoe ability.
__________________
  Reply With Quote
01-15-20, 07:48 PM   #3
Damply
A Murloc Raider
Join Date: Jan 2020
Posts: 4
Originally Posted by Xrystal View Post
I don't think you can. There are only unit options. target, focus etc .. you will have target and set it as focus, or target for it to be the target. I haven't seen a function that identifies mobs around you. Probably because its a step closer to automation .. just have left click for single target and right click for aoe and have the rotation tool just highlight the button that has the appropriate single/aoe ability.
So theres no way to count them? Maybe try to read combat log and see how many are attacking you? Dont need names just if theres a certain number
  Reply With Quote
01-15-20, 10:01 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,382
Originally Posted by Damply View Post
So theres no way to count them? Maybe try to read combat log and see how many are attacking you? Dont need names just if theres a certain number
You could try to see who is attacking you but aoe range doesn't mean they are attacking you, just means they are in range of your spells.

Unfortunately I haven't played with the combat log much and definitely not the new way of doing things. You will have to test the functionality yourself. Look at an addon that access the combat log in recent times and test it out with some low powered mobs that won't kill you while you test it out. Or look at an existing rotation helper and see if that does something similar.

How much you will be able to do UI wise once combat starts I don't know but rotation helpers do seem to work during combat, so it may be just how they find the information out. They may be ignoring the combat log and relying on cooldowns and auras on you or the target.
__________________
  Reply With Quote
01-16-20, 04:29 PM   #5
JDoubleU00
A Scalebane Royal Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 439
Have you looked at the code in Hekili? They can display an AOE rotation.
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
01-16-20, 05:09 PM   #6
Damply
A Murloc Raider
Join Date: Jan 2020
Posts: 4
Originally Posted by JDoubleU00 View Post
Have you looked at the code in Hekili? They can display an AOE rotation.
I have, i could not see where it handles the logic for it.
  Reply With Quote
01-16-20, 05:55 PM   #7
Kanegasi
A Scalebane Royal Guard
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 440
Hekili explains what they do to track melee enemies in the settings. It's a heuristic process that combines nameplate counting and a timer of damage. If a melee ability hits an enemy, that enemy's guid is counted for a few seconds. If you don't hit it again and its nameplate can't be found, or it records that unit's death in the combat log, it drops the enemy.

Last edited by Kanegasi : 01-16-20 at 05:57 PM.
  Reply With Quote
01-17-20, 01:50 AM   #8
Damply
A Murloc Raider
Join Date: Jan 2020
Posts: 4
Originally Posted by Kanegasi View Post
Hekili explains what they do to track melee enemies in the settings. It's a heuristic process that combines nameplate counting and a timer of damage. If a melee ability hits an enemy, that enemy's guid is counted for a few seconds. If you don't hit it again and its nameplate can't be found, or it records that unit's death in the combat log, it drops the enemy.
Wow i'll have to keep looking to find where its doing this, thats pretty smart. Thanks for the info, this might work for what im doing.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to detect how many enemies are around your current player

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