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

[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.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
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: 65
Level 37
Joined
Mar 6, 2006
Messages
9,243
^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,243
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