[Trigger] Immortal?

Status
Not open for further replies.
Ok, I don't really have an idea for how you could make it, but I suspect that it would require a custom damage detection system and the damage to be completely scripted.

That's what I think, I might have overlooked a spell or a trigger that makes it possible.
 
Have you tried detecting damage that brings the units health below 1, then setting that units health to 1? It may fire fast enough to avoid the unit ever dying.
 
Yeah, its pretty simple. It detects how much damage unit gets and heals him for amount of damage taken before he actually gets damage.
 
Have you tried detecting damage that brings the units health below 1, then setting that units health to 1? It may fire fast enough to avoid the unit ever dying.

The damage detecting event (as far as I know) kicks in before the unit takes damage, so it would set it to 1 before the damage is taken and kill the unit. D:
EDIT: Nvm, the damage detecting event does it before, and the unit attacked one fires at the actual time. =P

Perhaps you could give him some sort of divine shield. =P I haven't played DotA though, so I don't really know how the spell works.

EDIT: Tested the methods mentioned above and yeah, it works:
JASS:
function Trig_Immune_Actions takes nothing returns nothing
    local real damage = GetEventDamage()
    call SetWidgetLife(GetTriggerUnit(),(1+damage))
endfunction

But only problem is if he takes damage equal to more than his maximum health. Also, this is a specific unit event, not a generic unit event.

EDIT: @Watermelon: Thanks, fixed. =D
 
Last edited:
Justify's idea along with some of the above posts works:
Make a trigger that can detect the damage the unit will take.
If the damage it takes is greater than the unit's life, add an ability that can raise the unit's max hp by some big number. Then create a timer that will expire in 0 seconds to remove the ability and set the unit's life to 1.
(BTW, you should use SetWidgetLife instead of SetUnitState)
 
If you wanted to do it with a system, I advise using an updated version: http://www.wc3c.net/showthread.php?t=107451

Edit: Here's a crummy test map of what I was talking about. It's just to show you a general idea of what I meant.
How much damage the unit can sustain before it will get damaged regardless of the trigger is limited by the amount of max life that the ability gives.
Hopefully, you will use TimerUtils or some timer recycling system if you decide to use this method.
 

Attachments

Simple damage detection system. If a unit has your buff, and they receive damage, check:

Will the damage do more than their total hp? If not, ignore this damage.

If so, heal for (Damage - CurrentHP + 1) points of health.
 
In additon, when you are able to cast the spell, then there is normaly no sourge of damage nearby which could onehit you:grin:
What if there is? That's really up to the map maker though.
Simple damage detection system. If a unit has your buff, and they receive damage, check:

Will the damage do more than their total hp? If not, ignore this damage.

If so, heal for (Damage - CurrentHP + 1) points of health.
Example of why something like that will not work:
Unit A has only 10 max life. Unit A takes 20 damage.
The healing will come before the damage is actually dealt, thus resulting in Unit A's death.
 
Thats why your damage system to heal should be capable of adding a temp buiff of +9999999 hp, then removing it a split second later.

The damage system I made does that anyways. Don't know what other people use, so I can't comment.
 
Status
Not open for further replies.
Back
Top