• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Immortal Unit?

Status
Not open for further replies.
Level 4
Joined
Nov 24, 2010
Messages
62
Please show me how to make a unit still receive damages but can't dead.
Example: A unit has 100 HP receive 10000 damages but HP just become 1.

I'm not newbie so you can show up Trigger, Custom Script, JASS; but I'm tired of reading too much texts.
 
And here we go. All credits goes to Maker.

  • Untitled Trigger 002
    • Events
      • Unit - Ogre Lord 0003 <gen> Takes damage
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of (Triggering unit)) - (Damage taken)) Less than 0.41
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Damage taken) + 0.41)
        • Else - Actions
 

Attachments

^Actually that will fail if the damage received is more than the max hp of the unit.

One needs to add max hp bonus and then remove it after a timer with 0.00 expiration time ends.

The MK will die if dmg > max life, the BM won't die.

Now I had the time to properly make it:
https://www.hiveworkshop.com/forums/pastebin.php?id=7ei34w

The unit will survive any damage taken up to the value that the Max Life ability gives.
 
No death 2 trigger is there just to demonstrate how it will fail compared to No death 1 when the unit takes more damage than it's maximum hit points. You can delete No death 2 trigger.

The ability is the because I first thought about making it an ability. But you didn't mention anything about an ability. You can delete it.

Units are considered dead when their health drops to 0.405. That's why I add 0.41, to affect the hp as little as possible.
 
Status
Not open for further replies.
Back
Top