This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Macro - Strange targeting question
Post Reply
Return to board index
Post by
Quest
Is it possible, by clicking on someone (say in Grid) to target a mob that is targeting them (they have aggro), even if the player im clicking on does not have this mob targeted themselves?
Post by
pelf
So, a mob has to have a valid UnitId to be able to be targeted or have information (threat, etc.) queried about it. If anyone in your raid has it targeted, then it has a valid UnitId (raid12target, party2target, target, etc.). However, the only way to know that is to implement something that scans through all the valid grouping UnitIds and look a few levels deep into the ...target units and see if the target of an enemy somewhere in that chain is the target you've clicked.
So, I think it's possible, but I dunno how easy or practical it would be.
Disclaimer
: I know the API far more conceptually than practically, so Neffy is about 50-70% likely to come in here and say I don't know what I'm talking about :).
Post by
409946
This post was from a user who has deleted their account.
Post by
Quest
So, a mob has to have a valid UnitId to be able to be targeted or have information (threat, etc.) queried about it. If anyone in your raid has it targeted, then it has a valid UnitId (raid12target, party2target, target, etc.). However, the only way to know that is to implement something that scans through all the valid grouping UnitIds and look a few levels deep into the ...target units and see if the target of an enemy somewhere in that chain is the target you've clicked.
So, I think it's possible, but I dunno how easy or practical it would be.
Disclaimer
: I know the API far more conceptually than practically, so Neffy is about 50-70% likely to come in here and say I don't know what I'm talking about :).
Well I know its possible through the API even if no one has it targeted, simply because of this spell
Righteous Defense
. What im trying to do, is render the same targeting mechanic to another taunt that is otherwise directly applied on the mob. So far im not thinking I can without some addon if Im lucky, and if im unlucky, the mechanic is not available to us /sadface
Post by
Quest
It would be impossible under most circumstances though. In order to implement such a feature, after scanning all unit-IDs available and potentially finding one, the addon would need to perform actions which it cannot when in combat (actually setting a frame or macro to target said unit-ID).
Yeah I didnt think so, Thanks anyway!
It would be useful to have a feature like this;
/cast Taunt/Pewpew/leggo muh aggro
Post by
pelf
Well I know its possible through the API even if no one has it targeted, simply because of this spell
Righteous Defense
.
Well, the way spells actually work doesn't really execute in the outward-facing API layer, AFAIK. But yeah, Neffy confirmed.
Post by
409946
This post was from a user who has deleted their account.
Post by
pelf
Actually they do. The slash command
/cast
and similar commands all make direct calls to
CastSpellByName(spell)
. Virtually all--if not, all--macro commands are done in Lua using the exposed API. All that's done C-side is the parsing of conditionals.
I don't mean that part, the execution of the spell. I mean the secondary effects, the modifiers, etc. Like, Righteous Defense looks at all the stuff that has your friendly target targeted and picks three of them to taunt to you. Those things.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.