• 🏆 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!

[Spell] Immortal Unit?

Status
Not open for further replies.
Level 4
Joined
Nov 24, 2010
Messages
61
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.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
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

  • INVULNERABLE.w3x
    16.4 KB · Views: 64
Level 37
Joined
Mar 6, 2006
Messages
9,240
^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:
http://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.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
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.
Top