• 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.

Make Unit Unkillable

Status
Not open for further replies.
Level 10
Joined
Jun 16, 2007
Messages
415
Hey, I am trying to make a spell like DotA's "Shallow Grave" spell. For those of you who don't know what this spell is, here is a description:

Target allied hero will not be able to die for the next X seconds. Damage taken by this hero will not be able to drop the heroes health below 1, thus any damage taken by the hero will alter his hp but not kill him.

If anyone knows how to achieve this effect, please post.
Thanks in advance and +rep to people who help.
 
Level 10
Joined
Jun 16, 2007
Messages
415
No no, see for I don't want to prevent the unit from taking damage, just from taking lethal damage. So that if it takes 50 damage and has 100hp its health drops to 50. But when it has 30 health and takes 50 damage its health drops to 1 instead of dying.


EDIT: I just tried what you said and stunningly it works. I did not realize that the Damage Taken trigger fires before the damage is actually dealt to the unit. Thanks.
 
Status
Not open for further replies.
Top