Thread Tools Display Modes
10-21-09, 08:22 AM   #1
greegree
A Murloc Raider
 
greegree's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 9
Wink who is targeting

Hello.

I have the request from my arena mate to write an addon that announce if one of the our teammates are targeted more then two enemy players.

so i understand that i can get tagets throw arenaXtarget, but i cant understand in what event do this check?
Is it some event that fires when player becomes targeted?

If you have other ideas/examples/expirience how to do it, plz tell me =)

thx.
  Reply With Quote
10-21-09, 08:30 AM   #2
Soulofsin_007
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 125
PLAYER_TARGET_CHANGED will fire when you target or change targets.
  Reply With Quote
10-21-09, 12:00 PM   #3
greegree
A Murloc Raider
 
greegree's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 9
may be i told something wrong, but i dont need MY target.

i want to know when 2 or more enemy target one of my arena party member.
  Reply With Quote
10-21-09, 02:48 PM   #4
zero-kill
A Firelord
 
zero-kill's Avatar
Join Date: Aug 2009
Posts: 497
TARGET_TARGET_CHANGED then
  Reply With Quote
10-21-09, 03:57 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
UNIT_TARGET: http://wowprogramming.com/docs/events/UNIT_TARGET

Though I'm not sure if it fires for arena1target, etc.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
10-21-09, 04:49 PM   #6
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
I'm pretty sure UNIT_TARGET doesn't fire for anything other than primary units ("player" "pet" and the like)

I think target scanning with an onupdate timer would be needed and assuming
all enemy players will be targeted of focused by someone in your team.
  Reply With Quote
10-21-09, 05:14 PM   #7
greegree
A Murloc Raider
 
greegree's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 9
Thx. Will try
  Reply With Quote
10-21-09, 06:50 PM   #8
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Originally Posted by Seerah View Post
UNIT_TARGET: http://wowprogramming.com/docs/events/UNIT_TARGET

Though I'm not sure if it fires for arena1target, etc.
UNIT_TARGET definitely fires for friendly grouped units (including pets). dunno if it fires for "arena1" through "arena5", though i would not be surprised either way (after all, Blizzard went to the trouble of putting those unitids into the API/etc). it definitely does not fire for "targets" (i.e. targets of the base unitids), though that won't be relevant to your application (you want UNIT_TARGET events for "arena1" through "arena5").

event-driven would be nice, but if it turns out not to be possible, as Dridzt says, you are stuck with "polling" (waking up 3 times a second, or whatever, and checking to see if "arena1target" through "arena5target" have changed). for 5 unitids, this should not be too onerous.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"

Last edited by acapela : 10-21-09 at 06:57 PM.
  Reply With Quote
10-21-09, 11:19 PM   #9
greegree
A Murloc Raider
 
greegree's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 9
as i understand you mean that UNIT_TARGET will not work for "enemy" units. So i have to check "target changing" of my arena opponents.

and you wrote:
you are stuck with "polling" (waking up 3 times a second, or whatever, and checking to see if "arena1target" through "arena5target" have changed). for 5 unitids, this should not be too onerous.

but i still couldn't understand in what event i have to do "polling"? can u show me example?

sry, english is not my native so time to time it is heavy for me to fully understand "complex" phrases.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » who is targeting


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