• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How can i set the life of a just revived unit by Resurrection ability

Status
Not open for further replies.
Level 11
Joined
Jun 2, 2004
Messages
849
This is pretty hard, yeah. Resurrection is the only way to revive a normal unit and it will always come back with full health. There's no easy way to get the revived units in triggers, either.

You could fudge it by triggering your Resurrection ability. You'd base it on channel, have it spawn dummy units that cast their own version of Resurrection that only revives 1 unit, and shortly afterward set the units' health to a percentage.



It's slightly easier if you make all revivable units this way into heroes. There are standard triggers to revive those.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
The moment resurrection is casted, dead units that are revived still have 0 hp, so you can wait 0 seconds (use a timer) and compare the hp to the hp before. Every unit that has now > 0 hp and was at 0 hp before was resurrected.
I do not know if it needs to be MUI, because it is practically impossible, that two units cast at the same time, so a global timer + global group should be enough.
You need to make sure, that no other trigger increases the hp of dead units (in general you should never increase hp of dead units, as then functions like IsUnitAlive would return wrong results).
 
Status
Not open for further replies.
Top