Any chance we could get something to help us determine when targets, unitId's, no longer exist? An event of some kind that fires when unitId's are destroyed perhaps. That way we know when to clear any data related to that target. Or at least a function to determine if a unitId still exists
(both would be great), like:
Lua Code:
EVENT_UNITID_DESTROYED
DoesUnitIdExist(unitId)
Also a function to differentiate between different unit types (player, monsters, pets, other players, exc..) using unitId would be very helpful.
For example right now EVENT_EFFECT_CHANGED passes us:
Lua Code:
function OnEffectChanged(eventCode, changeType, effectSlot, effectName, unitTag, beginTime, endTime, stackCount, iconName, buffType, effectType, abilityType, statusEffectType, unitName, unitId, abilityId)
The unitId does help us differentiate between different units, but we have no idea what those units are. For example when a unit receives an effect that is not currently targeted the unitTag field is nil so we can't use GetUnitType(unitTag) so we have no way of knowing if the effect was on a mob, pet, or another player.
While I'm at it I would also like to see some unitTags for player pets. I would love to create some pet addons for monitoring pets.