Originally Posted by Phanx
You can't detect when a specific sound is played (unless it was played by the UI code or an addon) but you can detect when a spell is cast.
Try this:
|
Hi Phanx,
Just tried your approach and seems like this particular spell cannot be tracked that way :/
I also attempted printing all those succeeded spells' name and id, but no luck...
Lua Code:
local f = CreateFrame("Frame")
f:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
f:SetScript("OnEvent", function(self, event, unit, spellName, _, lineID, spellID)
print(spellName, spellID); -- Still not printing for Bag of Tricks (192657) nor for Poison Bomb (192660)
--if spellID == 192657 then
-- DEFAULT_CHAT_FRAME:AddMessage(string.format("%s was cast!", GetSpellLink(spellID)))
--end
end)