I'm working on an addon for telling on people taunting mobs away from the tank. So basicly I register CLEU and look for the SPELL_CAST_SUCCESS subevent and upon it I check for a taunt spell and whether the caster is not a tank. I need a way to report only if someone taunts off the tank so I need to know the target of the taunt receiver and check whether it is on my tank list. Just checking for targettarget upon the subevent didn't prove to be fast enough and it always returned the taunting player.
Is there some clever way to keep track of mobs changing targets?
Finding if a non-tank taunts is easy if you already have the GUID of the maintank (and offtank if applicable). However, it's impossible to reference to a mob that isn't being targetted by anyone as a UnitID does not exist for those mobs (other than bosses registered as Boss1, Boss2 ... BossN). Taunts are supposed to force a mob on the user by matching the aggro value of the person with the highest threat. In addition, most if not all taunts guarantee the mob to attack the user for 5 seconds or so. Such check would be unnecessary.