Talk:Events/U

I don't think UNIT_MAX*** events work. They don't trigger in my addon tests. --Voidvector 19:24, 17 Feb 2005 (EST)

UNIT_SPELLCAST EVENTS
I recently added a change on cast events. I think there is a real confusion about it. UNIT_SPELLCAST_SENT and UNIT_SPELLCAST_START are both client binded. You can try GetTime in both of this event to see that both of them are fired in the same frame. The reason of it is that it is not a Client Question - Server Answer mechanic. They each have their own different Fire case.

UNIT_SPELLCAST_SENT is fired when a unit attempt a spell cast. No matter if spell is instant or not, no matter if you can actually cast it (except it will not be fired when on cooldown or When trying to cast a spell you can't cast because you are already casting another) Typically this event will be fired in all the cases where the character will start casting animation, even if something will prevent to cast. more precisely, it is Fired when casting circumstances require a server validation. Any condition preventing cast that is known on your client will result in not sending any cast attempt at all, as your client will reject it by itself. Hooked code for this event is executed BEFORE the event is sent to the server.

UNIT_SPELLCAST_START is fired when successfully starting to cast non-instant and non-channel spell. It is not fired when you are unable to cast (silenced, moving, etc...). All checkings are computed locally, depending of your client game state. Hooked code for this event is executed BEFORE the event is sent to the server, and in the same frame, right after UNIT_SPELLCAST_SENT, if it is assumed we are in a non-instant cast spell. If the server state is different and result in a cast rejecting, it will be interrupted thereafter.--Floorent1993 (talk) 12:22, 13 September 2017 (UTC)

RECTIFICATION
It seems that all events are fired AFTER server validation. But they are all still sent in the same frame. The essential is that you understand that there is not time diff between SENT and START. It means that there is NO way to calculate real time lag.--Floorent1993 (talk) 18:38, 16 September 2017 (UTC)