Thread Tools Display Modes
08-09-05, 07:45 AM   #1
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Issues with SPELLCAST_STOP and other fun

Here's some background. I am in the process of creating a HealTracker which has the primary goal of tracking your healing efficiency overall, as well as per spell/target. I accomplish this by watching the spellcasting and combat events necessary to determine when a spell is going off, and grabbing the current health defecit of the unit, to determine how much "overhealing" we've done. Right now everything is going well and I'm getting lots of data, but I've run into a nasty snag with HoT spells.

I'm a priest, so my primary HoT is renew and I have the following challenges:

A.) Buffs like Renew do not show a source in their event, or in the combat log. It either says "You gain Renew" or "Cladhaire gains Renew".
B.) Probably for the sake of efficiency, CCHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_BUFFS and HAT_MSG_SPELL_PERIODIC_PARTY_BUFFS do not fire when they would heal the player for nothing. This is obviously a big hurdle in measuring efficiency
C.) Without hooking all spell casting and targeting functions, there is no easy way to tell that we've cast a HoT, and who we've cast it on.

Well I ran through some final testing this morning and found the following odd behavior which is preventing me from catching Renew's cast cycle in all cases (I have the majority). At this point I've hooked: CastSpell, CastSpellByName, UseAction, SpellTargetUnit, TargetUnit

When you click on Renew in an ActionBar and then click on something in the 3-D world, SPELLCAST_STOP fires as we'd expect, but it seems to bypass all targeting functions that I was able to find. It's not being targeted in SpellTargetUnit, or TargetUnit, so there is no way to catch that this spell has been successfully cast other than monitoring SPELLCAST_STOP which doesn't give us any information.

In addition, if you click on Renew in an ActionBar and then cancel the spellcasting by pressing ESCAPE, the hand will stop glowing, but SPELLCAST_STOP won't fire until you hit ESCAPE a second time. This is the big problem I have, because other than monitoring each keypress looking for an escape while we're in the process of casting a spell there's no event-driven way to know that we're done.

I'm just looking for a reliable means to tell when I've successfully cast renew, and who I've cast it on. For the most part I have that information, but this odd interaction with targeting in the 3-D world has thrown me off.

I believe I saw a thread about this previously, but I have not found a way to determine the target information when a player targets a spell by clicking in the 3-D world on a unit. I had hoped that this would show up somewhere, but it appears that isn't the case. I can workaround this, but I don't have a reliable way to show that spellcasting has stopped when cancelling the spell as above, due to SPELLCAST_STOP not firing (and the fact that it fires on the cancelled cast instead of SPELLCAST_INTERRUPTED as I had hoped).
  Reply With Quote
08-09-05, 08:43 AM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Yeah instant spells are very tough to track when cast. Healing is doubly tough since a target isn't necessary. Not to mention the game uses many ways to target a spell depending on how you cast it.

This may not be what you're after, but you can reliably tell who you cast spell on from the combat log. If you'd like to know when the spell was cast you could subtract two seconds from the first occurance of the heal. Fortunately, tho the initial casting is ambiguous ("You gain Renew."), the spam when the heals occur will always say who it's from. If not then you can be sure it was from yourself:

The GlobalStrings for healing:
PERIODICAURAHEALOTHERSELF = You gain %d health from %s's %s
PERIODICAURAHEALSELFSELF = You gain %d health from %s
PERIODICAURAHEALSELFOTHER = %s gains %d health from your %s
PERIODICAURAHEALOTHEROTHER = %s gains %d health from %s's %s
HEALEDCRITSELFOTHER = Your %s critically heals %s for %d
HEALEDSELFOTHER = Your %s heals %s for %d
HEALEDCRITOTHEROTHER = %s's %s critically heals %s for %d
HEALEDOTHEROTHER = %s's %s heals %s for %d

If you catch "You gain %d health from %s's %s" first, then a "You gain %d health from %s" means it was from you. And you can set start time from there (or 1-2 seconds before). Not a great solution unfortunately but it's an alternative to catch instant-cast HoTs if all else fails.
  Reply With Quote
08-09-05, 09:01 AM   #3
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Originally Posted by Gello
If you catch "You gain %d health from %s's %s" first, then a "You gain %d health from %s" means it was from you. And you can set start time from there (or 1-2 seconds before). Not a great solution unfortunately but it's an alternative to catch instant-cast HoTs if all else fails.
The issue isn't when I'm casting on myself, I have all of that beautifully. What I need to know is when I cast a Renew on someone else. For some reason, I could have sworn there wasn't a message when you were casting it-- but thinking of it now, that doesn't make sense.

Damn, I wish the servers were up, so I could have someone take a look at this for me.

Last edited by Cladhaire : 08-09-05 at 09:07 AM.
  Reply With Quote
08-09-05, 09:49 AM   #4
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
There's no message Even for spells with a casting time, there's no combat message when we cast spells. But there is when others cast spells. Not that it's needed because of the spellcast events. Just an example that information on casting is very limited.

Unfortunately the UI doesn't use CastSpell or any obvious function to cast. Targetting can be done through several functions. UseAction won't work for mods with non-action buttons.
  Reply With Quote
08-09-05, 09:52 AM   #5
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Aye, that's what I figured. I have everythign I need except for when I'm casting, and target using the 3-D world. Every other case (using WatchDog, any other mod, using the ActionBars on a target, etc) I have full information about the spell and target through function hooking, but I'm unable to get the target when we click on the world.

So damn frustrating :P
  Reply With Quote
09-07-05, 05:55 AM   #6
Thorarin
A Defias Bandit
Join Date: Sep 2005
Posts: 1
Has anyone been able to find a way to handle this yet?
I'm trying to do some tracking of buff spells, but the complete lack of information on SPELLCAST_STOP events and the fact that this event also fires when spell targetting is cancelled by ESC (but not rightclick or any other way) makes it pretty much impossible

Let's just say I'm beginning to understand why so many addons have seemingly unnecessary bugs, with an API as inconsistant, uninformative and plain buggy as this one
  Reply With Quote
09-07-05, 08:03 AM   #7
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
I actually have a full implementation, but it involves hooking the spellcasting functions, as well as the targeting functions in order to glean the information necessary. Then it waits for the next SPELLCAST_STOP and attributes the "being cast" spell to that event. Send me an email at [email protected] if you're interested.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Issues with SPELLCAST_STOP and other fun


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