[trigger="When a hero dies"]Events
Unit - A unit dies
Conditions
(Dying unit is a hero) Equal to True
Actions
Unit - Set custom value of (Dying unit) to (Player number of (Owner of (Dying unit)))
Unit - Change ownership of (Dying unit) to Neutral Passive, retaining original color[/trigger]
[trigger="Revive"]Events
Unit - A unit is revived
Conditions
(Triggering unit is a hero) equal to True
Actions
Unit - Change ownership of (Triggering unit) to (Player number (Custom value of (Triggering unit))), change color[/trigger]