WoWInterface - View Single Post - Detecting a spell sound or registering a callback on it
View Single Post
03-07-18, 05:49 PM   #8
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
Originally Posted by semlar View Post
I would be very surprised if UNIT_SPELLCAST_SUCCEEDED didn't fire for this spell.

Try using RegisterEvent instead of RegisterUnitEvent, and then filter by source after you determine if it fires.

RegisterUnitEvent sometimes doesn't behave the way you would expect it to.

Also don't assume you have the spell IDs correct, watch for the spell name if you need to filter it or just don't filter it at all if it isn't too spammy, then once you know you have the right spell ID you can watch for that.

Occasionally scripted spells aren't considered "cast" by the player and can't be tracked directly, but they're relatively uncommon.
Hi semlar,

Just had a shot with RegisterEvent (instead of RegisterUnitEvent) as you've advised, but yeah...... It's still not getting it...

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     local _, spellName, _, _, spellID = ...
  5.     print(spellName, spellID)
  6. end)

In addition to this, I've tried to print all available results from COMBAT_LOG_EVENT_UNFILTERED, but same for this one.

Lua Code:
  1. local f = CreateFrame("Frame")
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     local _, subEvent, _, _, _, _, _, _, _, _, _, spellID = ...
  5.     local spellName = GetSpellInfo(spellID)
  7.     if spellName then
  8.         print(subEvent, spellID, spellName)
  9.     end
  10. end)

The only sub event fired for a poison bomb related spell is SPELL_DAMAGE.

Hm..................... This is so tricky

Last edited by Eungavi : 03-07-18 at 06:00 PM.
  Reply With Quote