View Single Post
11/07/15, 11:18 PM   #31
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by ZOS_ChipHilseberg View Post
For the unique ID we're looking at providing a number to identify each instance with the same name. Players will always be 0 (since their name should be unique anyway) and non-players will have an arbitrary number that will be the same as long as that unit exists.
I'm guessing this was changed? Because effects on me or other players (in EFFECT_CHANGED) do not give a unitId of 0.

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:
  1. EVENT_UNITID_DESTROYED
  2. DoesUnitIdExist(unitId)

Also a function to differentiate between different unit types (player, monsters, pets, other players, exc..) using unitId would be very helpful.
Lua Code:
  1. GetUnitIdType(unitId)
For example right now the event EFFECT_CHANGED passes us:
Lua Code:
  1. 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 target/mob dies or 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.

Last edited by circonian : 11/08/15 at 01:16 AM.
  Reply With Quote