View Single Post
04-10-10, 12:49 PM   #5
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
Originally Posted by obd View Post
Hi.

The title kind of says it all. I need a way to run script before spellcast, before UNIT_SPELLCAST_SENT, but can't find an event to trigger it. Is there one, am I just blind (I did search wowwiki)? If not, is there a workaround besides changing all the spells to macros with /script at the start?
What are you trying to do? You can't easily tell when a spell is being cast, before it is.


Originally Posted by nightcracker View Post
Try this:
Code:
hooksecurefunc("CastSpellByName", function(...)
    -- bla bla bla
end)
And make sure to do the same for all other "CastByXXX" functions.
Pulling my notes from LHC4, this isn't true, because hooksecurefunc are called after the original function is, you end up with this (with auto self cast on): CastSpellByName -> UNIT_SPELLCAST_SENT -> secure hooks.
  Reply With Quote