Revive Unit?

Exide

I am amazingly focused right now!
Reaction score
448
Hi.

Is there a way to revive a dead unit?
I can't find any actions that suggests it would..

I had the idea to try and set the health of the unit to above 0, and see if that revives him. But I haven't had a chance to test this yet. -Think it will work? Could someone please test this for me? :)
 

Adovid

New Member
Reaction score
2
Two ways you can go about it.

Use a "unit don't die" behavior buff that reduces all combat damage that would be fatal to zero and when it does it creates an effect "combat-handled" which you can be used to teleport or do whatever else to your unit.

Or you can go to the properties for your unit and set stats-death time to -1 so your unit will not be erased when they die. Then in a trigger create a custom script and add UnitRevive(*your unit id here*). UnitRevive isn't available as a GUI action for some reason and to get the handle of your unit or the function that would return it you should just use it somewhere in another action and go to data->"view script" from the trigger editor.
 

Exide

I am amazingly focused right now!
Reaction score
448
I wanted to try your second suggestion.
I have the unit in a variable, named Hero[*array*].

If I am not mistaken that variable is called: gv_hero[*number*].
Which means the script should look like this:

JASS:
UnitRevive(gv_hero[*number*])


Yes?


Now for the complicated part:
How do I write a custom script? :confused:


EDIT: I can't find the "hero - death time" stats anywhere, btw.
 

Adovid

New Member
Reaction score
2
It's not hero death time, it's unit stats- death time, any unit can be made to be revivable.

Make sure you have all of the fields visible by having all of the orange buttons at the top right clicked except for the last one or you can just search "death time" and modify it from there.

Custom script is a trigger action, just search for it when you create an action then type or paste your code in the editable area.

Note! If you use the second option your unit will drop their items when they die, blizzard hasn't fixed the no drop on death option yet.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top