• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Halving damage.

Status
Not open for further replies.
Level 6
Joined
May 11, 2010
Messages
236
Well i'm trying to finish a spell, and this is the part i'm having trouble with. What I'm trying to do is cause any damage that hits the unit while it has the specific buff, to be halved. I've tried setting the units life to it's life, ie

  • Actions
  • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - ((Damage taken) / 2.00))
Doesn't work, it actually doubles the damage he's taking. I'm unsure of how else to half the damage.
 
Level 6
Joined
May 11, 2010
Messages
236
How about trying to put the value as 0.5?

That made him still take double damage it seems, same as having 2.00 : / more than double, had a footman with 50 health and no regen, rifleman with 10 chaos damage. 2 hit the footman.

Originally Posted by Dr.Boom
Moin moin =)

You should use at the end the following action:

Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) / 2.00))


This "heals" the unit by the half of the taken damage.

Edit: You were right Dr.Boom, though I when I tried that before it seemed to be healing the unit for double the damage... I don't know, maybe I missed something as i'm quite sleep deprived currently. Thank you :)

I appreciate both your suggestions and am giving you rep now :) I need to be up for Uni in 4 hours, so i'm going to bed.
 
Status
Not open for further replies.
Top