• 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 to resurrect a corpse

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2012
Messages
82
Hello.
I was trying to remake the resurrection spell to resurrect enemy unit too, and I realize I have no idea how to pick a corpse to resurrect it.
Please help.
Thank in advance.
 
Level 3
Joined
Mar 21, 2020
Messages
35
Code:
Event: 
unit has died (generic)

Conditions: 

Actions: 
set dyingUnitType = unit-type of triggering unit
set realVariable1 = convert triggering unit's real value (hit points) (uHoc or smt I believe)
set realVariable2 = convert triggering unit's real value (mana)
etc..
*(remove triggering unit from game) optional, or disable can decay in object editor
create 1 dyingUnitType for triggering player at X and Y position of triggering unit
set lastcreatedunit's hit points to realVariable1
set lastcreatedunit's mana to realVariable2
etc..

If you can't figure it out, let me know and I'll show you in the World Editor!
 
Level 4
Joined
Oct 28, 2012
Messages
82
Thank you.
The similar thread is exactly what I want.


@lil apex
thank
I think I could go with this for less chance for problem to happen.
 
Last edited:
Level 3
Joined
Mar 21, 2020
Messages
35
Thank you.
The similar thread is exactly what I want.


@lil apex
thank
I think I could go with this for less chance for problem to happen.

Yeah it's the most manual way I can think of (and therefore the least buggy).

If you keep everything in one trigger try to use "triggering unit" etc. (in-built variables) as much as you can, they're faster (and less buggy) than storing them to variables. Store it to variables if you want to call on the data in another script or at a later time.

Good luck with your mapmaking!
 
Status
Not open for further replies.
Top