Reply
Thread Tools Display Modes
Unread 08-07-13, 08:03 PM   #1
launchcodemexico
A Defias Bandit
Join Date: Aug 2013
Posts: 2
announce for casts in progress on the player

i want to write an addon that performs the following:

if ([Ability1, Ability2,... AbilityX] is being cast upon you from any NPC's or players) -> announce

for example, if a warlock somewhere/anywhere has targeted you and has begun to cast Chaos Bolt, and it's an ability you've selected to parse, an announcement will be made on screen.

does the API allow for such calls?
launchcodemexico is offline   Reply With Quote
Unread 08-07-13, 09:09 PM   #2
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 534
The combat log doesn't provide a target for SPELL_CAST_START events so the only way you could guess at a target would be if someone was targeting the warlock and you got which unit the warlock was targeting when they started casting, which isn't necessarily the target of the spell since they could be using mouseover or focus macros.
semlar is online now   Reply With Quote
Unread 08-07-13, 09:11 PM   #3
Nibelheim
local roygbi-
 
Nibelheim's Avatar
Featured
Join Date: Jan 2010
Posts: 1,506
Originally Posted by semlar View Post
The combat log doesn't provide a target for SPELL_CAST_START events so the only way you could guess at a target would be if someone was targeting the warlock and you got which unit the warlock was targeting when they started casting, which isn't necessarily the target of the spell since they could be using mouseover or focus macros, but I think that would be the best you could do.
With the re-introduction of cast bars on nameplates, would using Nameplates as a reference work? Not sure if you can get target info from Nameplates, though.
__________________
Nibelheim is offline   Reply With Quote
Unread 08-07-13, 10:07 PM   #4
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,231
Nope. Watching nameplate castbars will still only tell you that someone, somewhere, is casting the spell, not who they're casting it on. You can only find out who they're targeting if you target them or mouse over them (or their nameplate) so they get a unit token.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 08-07-13, 10:14 PM   #5
Nibelheim
local roygbi-
 
Nibelheim's Avatar
Featured
Join Date: Jan 2010
Posts: 1,506
Originally Posted by Phanx View Post
Nope. Watching nameplate castbars will still only tell you that someone, somewhere, is casting the spell, not who they're casting it on. You can only find out who they're targeting if you target them or mouse over them (or their nameplate) so they get a unit token.
Ah well, was a bit much to hope for
__________________
Nibelheim is offline   Reply With Quote
Unread 08-08-13, 05:11 AM   #6
ravagernl
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,145
Kollektiv's SpellAlerter used to be able to do this, but I have no idea if it works for MoP.

[EDIT] There's a fan update of spellalerter for 5.1.

Last edited by ravagernl : 08-08-13 at 05:14 AM.
ravagernl is offline   Reply With Quote
Unread 08-09-13, 04:51 PM   #7
launchcodemexico
A Defias Bandit
Join Date: Aug 2013
Posts: 2
so Kollektiv's Spellcaster seems to be at odds with what Semlar and Phanx mentioned. did this event used to exist? and has it been removed since MOP?

or does the old Spellcaster use some elaborate workaround to search targeted enemies within your group for hostiles targeting you?
launchcodemexico is offline   Reply With Quote
Unread 08-09-13, 04:54 PM   #8
ravagernl
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,145
Originally Posted by launchcodemexico View Post
so Kollektiv's Spellcaster seems to be at odds with what Semlar and Phanx mentioned. did this event used to exist? and has it been removed since MOP?

or does the old Spellcaster use some elaborate workaround to search targeted enemies within your group for hostiles targeting you?
Spellalerter looks at the unit's target at the moment of casting. If the target can't be detected, it's not displayed.
ravagernl is offline   Reply With Quote
Unread 08-09-13, 05:54 PM   #9
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 534
If someone in your group is targeting the unit when it starts casting, you can detect that they started casting and you can get what unit they're currently targeting.

This is fine for most spells that mobs cast, although a handful of abilities can be cast on another unit without the mob switching targets.

Players, on the other hand, do not require targeting a unit to cast on it. In the majority of cases this won't matter. HOWEVER, in the arena you will run into a huge number of players who use macros to cast on either their mouseover target or a specific arena member not only because it's faster but it also prevents YOU from knowing who they're casting on.

Almost all healers will also be using either mouseover macros or click casting on unit frames which will also prevent you from detecting who they're casting on.
semlar is online now   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » General Authoring Discussion » announce for casts in progress on the 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