• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 16
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