Thread Tools Display Modes
10-05-06, 10:45 AM   #1
sid67
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 78
How do I compare last target to current target

Is there any way to check if your last target is your current target? This is for mobs, not other players, so using UnitName won't work because the mobs often have the same name.

I suspect the answer is 'no', but I thought I would ask before trying to think up a work around. I wish it were as simple as UnitIsUnit("lasttarget","target").
  Reply With Quote
10-05-06, 03:03 PM   #2
Aule
A Fallenroot Satyr
 
Aule's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 20
I believe not...

Although I've never seen it formally stated anywhere (I'm sure it is...I'm just too dense to find it), I believe Blizzard purposefully makes it impossible to store unique references to mobs or players because it'd be possible to make some uber-unfair addons with that ability.
__________________
"Any society that would trade liberty for security will lose both and deserve neither."
- Benjamin Franklin
  Reply With Quote
10-06-06, 10:00 AM   #3
sid67
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 78
Originally Posted by Aule
Although I've never seen it formally stated anywhere (I'm sure it is...I'm just too dense to find it), I believe Blizzard purposefully makes it impossible to store unique references to mobs or players because it'd be possible to make some uber-unfair addons with that ability.
Ya--I didn't think it was possible. I knew there was no way to get a unique ID off a mob, but I was hoping they at least had a check available for your last target. I can think of some really clumsy work arounds, but it will be ugly as all get out.
  Reply With Quote
10-16-06, 02:08 AM   #4
Zeksie
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 24
Originally Posted by sid67
Is there any way to check if your last target is your current target? This is for mobs, not other players, so using UnitName won't work because the mobs often have the same name.

I suspect the answer is 'no', but I thought I would ask before trying to think up a work around. I wish it were as simple as UnitIsUnit("lasttarget","target").
If you receive a PLAYER_TARGET_CHANGED event, then your target has changed. But I suspect this is not what you mean.

You're probably refering to losing a target, then re-selecting the same target again? In which case, the best you can do is check it's name.

If you were really desperate, you could check your raid for who has the same target as you. Scan for UnitIsUnit("raidXXtarget", "target") (XX = 1 to 40). Store their id "raidXX", then re-check this when you pickup a target again.

But this is ugly and time-consuming, and you can't guarentee that they'll keep their target. So don't do this. It's just an indication of the nearest possible answer to your question
  Reply With Quote
10-16-06, 05:37 AM   #5
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
you could give your target a raid icon and then determine that way.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How do I compare last target to current target


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