Preventing Lethal Damage (1hp)

bYo

New Member
Reaction score
5
I did several hundred searches to try and find this, but to no avail. Basically I want a unit to stay at 1hp for a certain amount of time. Any damage from spells/other sources won't kill the unit, but keep it at 1hp.

If anyone has played DotA, this is pretty much similar to Dazzle's Shallow Grave ability. Annoyingly, a few days ago I somehow managed to make this happen by accident (in some other trigger), so I know it's possible. The unit would just not die, staying at 1hp no matter what.

So is there a really simple solution?
 

jig7c

Stop reading me...-statement
Reaction score
123
when it gets to 1 hp, give it invunerablility...

or

a unit is attacked

attacked unit equal to <your unit>
or
attacked unit has <your buff
>
set the life of attacked unit to (life of attacked unit - (damage taken - 1)
set the life of attacked unit to 1

depends on how your game is...
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
1) Create a hp bonus ability(eg item bonus hp)
2) first trigger -> register unit damage event
3) second trigger ->
Event - unit damaged
Condition - life of triggering unit < 0.405
Action - Add the hp bonus ability
set the hp to 1
remove the hp bonus ability
4) enjoy it!
 

bYo

New Member
Reaction score
5
Do I need to detect how much damage is being dealt though? Should I discover whether the damage is 'lethal' before setting it to 1hp. Thanks for the replies too.

With Life of Attacked Unit (- Damage taken -1), won't that only decrease the damage by 1? Sorry, a little confused.
 

jig7c

Stop reading me...-statement
Reaction score
123
Do I need to detect how much damage is being dealt though? Should I discover whether the damage is 'lethal' before setting it to 1hp. Thanks for the replies too.

With Life of Attacked Unit (- Damage taken -1), won't that only decrease the damage by 1? Sorry, a little confused.

it'll decrease the damage by 1, leaving 1 hp for the attacked unit
what exactly is "lethal?" do you mean like the last hit?
well hopefully it's a spell, like Shallow Grave, which gives out a buff... just detect if that unit has that buff or not
 

cleeezzz

The Undead Ranger.
Reaction score
268
a unit is attacked

attacked unit equal to <your unit>
or
attacked unit has <your buff
>
set the life of attacked unit to (life of attacked unit - (damage taken - 1)
set the life of attacked unit to 1

depends on how your game is...

no, definitely wont work, do king's way
 

bYo

New Member
Reaction score
5
King's post gave me an idea. Event - Damage taken. Condition - Damage Taken > Unit's Current Health. Bla bla.

Thanks all, going to test it now.

EDIT: Since I want this to be a channeling spell, what should I base it off? I'm currently using the aptly named Channel ability, but I'm not sure which section defines that it IS actually channeling.

Basically the skill is called Reverse Fate. You target a unit and continue to channel until you cancel. Whenever the targeted unit takes damage, you gain health. When the unit reaches 1 health, it gains life instead and you take the damage.
 

bYo

New Member
Reaction score
5
Yes thanks I do have that system (its very useful).

Could someone tell me if this looks like it would work?

Trigger:
  • Reverse Fate Initiate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reverse Fate
    • Actions
      • Set Reverse_Fate_Target = (Target unit of ability being cast)
      • Countdown Timer - Start Reverse_Faith_Timer as a One-shot timer that will expire in 30.00 seconds


Trigger:
  • Reverse Fate
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • GDD_Damage Greater than or equal to (Life of GDD_DamagedUnit)
      • GDD_DamagedUnit Equal to Reverse_Fate_Target
    • Actions
      • Unit - Add HP Boost (Greater) to GDD_DamagedUnit
      • Unit - Set life of GDD_DamagedUnit to 1.00
      • Unit - Remove HP Boost (Greater) from GDD_DamagedUnit


And another trigger ending this effect when the timer expires.
 

Grymlax

Probably not around
Reaction score
138
Here is a simple version of shallow grave (dota)

just base the spell on an ability that gives the unit you cast it on a buff.
the make these 2 triggers:

Trigger:
  • Shallow Grave cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shallow Grave
      • ((Target unit of ability being cast) is in ShallowGraveTargetCheck) Equal to False
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to ShallowGraveTargetCheck
      • Trigger - Add to Shallow Grave proc &lt;gen&gt; the event (Unit - (Target unit of ability being cast) Takes damage)


Trigger:
  • Shallow Grave proc
    • Events
    • Conditions
      • ((Triggering unit) has buff Shallow Grave ) Equal to True
      • (Life of (Triggering unit)) Less than or equal to (Damage taken)
    • Actions
      • Unit - Set life of (Triggering unit) to ((Damage taken) + 1.00)


here is a test map if you are to lazy to set it up yourself
 

Attachments

  • Shallow Grave.w3x
    19.8 KB · Views: 190

bYo

New Member
Reaction score
5
Wow thanks for that. I'll add it in tomorrow - bit late now. +rep for the time anyways.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Just make sure you don't have spells that deal more damage than the actual unit's health. Otherwise it will bug out and kill the unit anyway. But even then, the unit deserves to die for being hit so hard. :p
 

bYo

New Member
Reaction score
5
Hmm, trying to convert Grymlax's handy triggers to work on my channeling ability, but the target unit never gets the buff.

I've tried changing Unit starts Effect of an Ability to Unit Begins Channeling an Ability, but to no avail. I'm still using Channel as the base ability with a follow-through time of 10s.

EDIT: Found that 'Unit begins Casting an Ability' works.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
For the hp bonus ability, set the hp bonus amount to as much as possible. eg : 1000000000
 

Mythes

Member
Reaction score
7
Watch out for "Unit begins casting an ability" because of the "start the skill, cancel the order and still get the effect" bug...
As I guess you have some exp with WE, you know what I'm talking about...
Although, because it's a channeling ability, I guess you won't have a problem with this bug...
 

Ayanami

칼리
Reaction score
288
Basically, use a ability that gives a buff on the target. Then, use Weep's GDD to detect damage taken.

Trigger:
  • Detect
    • Events
      • GDD_Event becomes Equal to 0.00
    • Conditions
      • ((GDD_DamagedUnit) has buff MyBuff) Equal to True
      • GDD_Damage Greater than or equal to (Life of GDD_DamagedUnit)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_Damage + (Life of GDD_DamagedUnit)) Less than or equal to (Max life of GDD_DamagedUnit)
        • Then - Actions
          • Unit - Set life of GDD_DamagedUnit to (1.00 + GDD_Damage)
        • Else - Actions
          • Unit - Add MaxLife to GDD_DamagedUnit
          • Unit Group - Add GDD_DamagedUnit to DamageGroup
          • Countdown Timer - Start DamageTimer as a One-shot timer that will expire in 0.00 seconds


Trigger:
  • Fatal Block
    • Events
      • Time - DamageTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DamageGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove MaxLife from (Picked unit)
          • Unit - Set life of (Picked unit) to 1.00
          • Unit Group - Remove (Picked unit) from DamageGroup


The 0.00 timer is used in cases where damage + your current health is greater than your maximum health. If you don't use a 0.00 timer for that, it'll cause the unit to die, if the damage + current health is greater than or equal to your max health. MaxLife is basically "Item - Life Bonus" ability with a high health bonus, something like 99999.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top