View Single Post
02-16-18, 08:33 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Check out the blizzard function that actually handles emote commands, ChatEdit_ParseText. When you use an emote, it checks the table hash_EmoteTokenList, which has every emote in the game, organized by command (key) and what emote it calls (value). If the command used matches this table, it passes the value of that table to DoEmote().

What you can do is hooksecurefunc DoEmote() and cache the first argument, then when CHAT_MSG_TEXT_EMOTE fires, you now have confirmation a valid emote was fired, what emote was used, and the target without needing to parse the actual text from the event. If there's no target unit, then the emote wasn't used on anyone.

Last edited by Kanegasi : 02-16-18 at 08:35 PM.
  Reply With Quote