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

Life Steal Interactions

Status
Not open for further replies.
Level 11
Joined
Aug 24, 2012
Messages
429
Does anyone know how does Life Steal (the passive skill, not the Dark Ranger ability) interact with Cleave, Artillery Attacks and Missile Splash attacks?

I suppose that Life Steal would not interact with Poison and other Dots from attacks, but maybe you can heal for more if you hit multiple targets.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Life steals only from the main target. Pretty sure artillery / splash attacks can't even use orb effects of any kind. DOTs from attacks are either going to be triggered (won't life steal unless you make it do so) or from another kind of orb effect (envenomed weapons or whatever it's called). They will either not be placed because they are overridden by the life steal, or they will override the life steal and prevent all life gain.

If you want it to do more, you could try making a custom orb effect or even make it not an orb effect via a damage detection system.
 
Level 30
Joined
Jan 31, 2010
Messages
3,551
Lifesteal works with cleave, but you will not leech more life by hitting more units.
Lifesteal with artillery attacks will cause fatal error (any orb effect in this case).
Lifesteal with envenomed attacks both work, you steal life and poison the target, but you do not cause lifesteal from poison damage.
And finally, lifesteal with multishot (barrage) also works, but you only leech life from attacking original target.
 
Level 12
Joined
Jan 2, 2016
Messages
973
You can trigger life steal if you want it to work with those. You need a damage detecting system tho.
Event: A unit takes damage
Conditions: The damage source has life steal
Actions: Set life of damage source to life of damage source + 0,xx * damage dealt
 
Level 11
Joined
Aug 24, 2012
Messages
429
Is a DDS the only way of doing it?

It's there a way to simply implement this via GUI? Something simple like a unit is attacked - Attacker is X Unit - X unit gets healed by a fixed amount.

Will this detect extra targets from multiple attacks/splash attacks/Cleave?

Basically if the Attacker hits one unit it is healed by 10 HP if it hits two then the heal simply doubles- nothing fancy like based on how much damage is done.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Is a DDS the only way of doing it?

It's there a way to simply implement this via GUI? Something simple like a unit is attacked - Attacker is X Unit - X unit gets healed by a fixed amount.

Will this detect extra targets from multiple attacks/splash attacks/Cleave?

Basically if the Attacker hits one unit it is healed by 10 HP if it hits two then the heal simply doubles- nothing fancy like based on how much damage is done.

That won't work. "unit is attacked" will fire when the unit starts their attack animation. It's not a terrible solution, but it has problems and inaccuracies - it will fire if you repeatedly spam "stop" commands because the unit will start their attack animation. It will also not fire when other units will get hit by the damage.

Even a flat heal like this will be hard / awkward without a DDS. You are better off using one for a few reasons:
- It will make this effect work EXACTLY as intended.
- It is necessary for many unique abilities.
- You will almost guaranteed need one or, at least, want one at some point later in your map development.

There are even GUI-friendly damage detection systems. People will help you out if you ask :)
 
Level 12
Joined
Jan 2, 2016
Messages
973
Nope, DDS is the only efficient way.
There is another way of doing it in GUI, without a DDS, but it's really bad way of doing it.
I will tell it to you however:
Make a trigger with no events, and no conditions (or perhaps you could put conditions like "Triggering unit is a structure equal to false, Triggering unit is mechanical equal to false"
Actions "Set life of Damage source to Life of Damage source + 0.xx * Event Response - Damage Taken"

And make another trigger:
If you want this life steal to be a hero ability, add as event "A unit Learns a skill"
And as condition "Learned hero skill equal to ~the life steal~"
If you want a specific unit type to have this life steal, the event should be "A unit enters Playable Map Area", conditions: "Unit type of Triggering unit equal to ~the unit you want~

and Actions: Trigger add event - "Add to ~the 1-st trigger~ the event (Unit - (Triggering Unit) Takes damage)"
 
Level 12
Joined
May 22, 2015
Messages
1,051
Nope, DDS is the only efficient way.
There is another way of doing it in GUI, without a DDS, but it's really bad way of doing it.
I will tell it to you however:
Make a trigger with no events, and no conditions (or perhaps you could put conditions like "Triggering unit is a structure equal to false, Triggering unit is mechanical equal to false"
Actions "Set life of Damage source to Life of Damage source + 0.xx * Event Response - Damage Taken"

And make another trigger:
If you want this life steal to be a hero ability, add as event "A unit Learns a skill"
And as condition "Learned hero skill equal to ~the life steal~"
If you want a specific unit type to have this life steal, the event should be "A unit enters Playable Map Area", conditions: "Unit type of Triggering unit equal to ~the unit you want~

and Actions: Trigger add event - "Add to ~the 1-st trigger~ the event (Unit - (Triggering Unit) Takes damage)"

IMO that is basically creating a damage detection system (though a very basic one). It is also definitely more efficient to filter the units when adding their events to the trigger. Anyway, the start of a regular DDS is to do exactly this, except you add it at the start of the map. Then you do all your checks in that one trigger (it is possible to add a separate trigger that you can dynamically add actions to, but I don't remember if that is possible without JASS).

The real problem with this kind of thing is this concept called "bunny code". When you want to do something that is roughly like something you've done already, you will almost always just copy-paste the code (triggers) you've already written. The code "breeds" like bunnies because of this process. After doing this, say, in 10 spots, switching it to a more efficient method becomes really painful (redoing these 10 instances entirely - and these are like 2 triggers each).

The "bunny code" is not my concept. I read about it in this article (don't want to be taking credit for it or anything): https://www.nczonline.net/blog/2015/05/14/the-bunny-theory-of-code/
 
Status
Not open for further replies.
Top