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

[Solved] preventing deadly damage?

Status
Not open for further replies.
Level 7
Joined
Jan 30, 2011
Messages
267
this has been asked a thousand times allready i guess, but i didnt find a proper answer between the millions of posts about damage prevention

so ill just take the freedom to ask it for the 1001st time

how do i prevent damage that would kill a unit?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Event: Unit takes damage (the event is only for a specific unit, so if you want it to work for many units, you have to add a new event for each one)
Condition: (damage taken) greater than or equal to (current health of triggering unit)
Action: make unit invulnerable, or set health to health + damage taken, or whatever

EDIT: You've posted 3 threads in quick succession, maybe you should rather ask all the questions in one thread next time :)
 
Level 7
Joined
Jan 30, 2011
Messages
267
i had 2 issues with your way:
1. if the inflicted damage is higher than the units total health then it still dies
2. if the inflicted damage is higher than (Max health minus current health), then the remaing health of the unit is lower than before, so damage hasnt been prevented completely
 
Status
Not open for further replies.
Top