When unit dies under the effect of reincarnation, it doesn't actually gets registered by the event via A unit Dies.
Now, you need to understand the threshold for a unit to "die" is its HP to become less than 0.405 (0.404, 0.403,...,0.000).
Use this as condition to detect if the unit actually "die".
So, here's a trick to detect its "death" if the unit has Ankh equipped;
-
Detect Ankh
-
Events
-
Unit - Blood Mage 0001 <gen>'s life becomes Less than 0.41
-
Conditions
-
Actions
-
Game - Display to (All players) the text: detected
But by using that event, it must refer to the pre-defined unit, so how do we refer to non-exist unit yet ?
We add those affected unit via trigger;
-
Ankh Setup
-
Events
-
Conditions
-
Actions
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
-
Loop - Actions
-
Set unit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(unit has an item of type Ankh of Reincarnation) Equal to True
-
Then - Actions
-
Custom script: call TriggerRegisterUnitLifeEvent(gg_trg_Ankh_Detect, udg_unit, LESS_THAN, 0.405)
-
Else - Actions
-
Ankh Detect
-
Events
-
Conditions
-
Actions
-
-------- DO SOMETHING HERE --------
Since I don't know how those units get their Ankh, I just assume that those units get it at the start of the map.
If you could tell me exactly how those units get their Ankh, I might change the Event.
@deathismyfriend
Since dead unit that is not "fully" dies yet (having Ankh), they will not get registered by the Event - A unit Dies.
Therefore, you should use GetWidgetLife(unit) to detect whether the unit truly hits the limit or not.