• 🏆 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] Life steal help

Status
Not open for further replies.
Level 26
Joined
Dec 3, 2018
Messages
873
Hi I want to make a custom life steal spell from the dark range's one. I went into an issue. Idk how to make it to work only on friendly units. Like the death knight's sacrifice.
Another similar problem is with the death knit's sacrifice. Idk how to make it to work on living units too.(It works only on undead).
 
Level 39
Joined
Feb 27, 2007
Messages
5,012
Change the "targets allowed" field (remove undead for death pact, add friendly/player-units and remove enemy for life drain). Death Pact might be hardcoded only to work on undead, not sure on that one. Try changing the targets and see if it works.
 
Level 39
Joined
Feb 27, 2007
Messages
5,012
You can use the spell Steal instead as a substitute for Death Pact, as outlined in this thread.

Life drain cannot be made to target allies. Ever. None of the other life/mana drain variants can either. If you want this you will have to trigger it. Here is an example solution for something similar. The only way around this (definitely not recommended) is to use a dummy spell with the correct targets and then when it's cast temporarily change the owner of the caster or the target to neutral hostile and order it to use the real life drain. Its owner can be changed back once the spell has started and it will continue to drain just fine. It will interrupt unit orders and will remove it from the selection UI if it was selected (unless you re-add it with a trigger).
 
Level 8
Joined
May 21, 2019
Messages
435
Hi I want to make a custom life steal spell from the dark range's one. I went into an issue. Idk how to make it to work only on friendly units. Like the death knight's sacrifice.
Another similar problem is with the death knit's sacrifice. Idk how to make it to work on living units too.(It works only on undead).
There's no easy way to make this ability work as a friendly target Life Drain.
However, I can think of 2 ways that this "might" be possible to do through triggers and dummy spells.

The first one is using a Channel ability that can only target friendly units, and the other one, is using the Blood Mage's mana drain spell, which CAN actually target allies by default, which usually transfers mana to them instead of stealing it, you can just set this to 0 and you should have a working dummy. I don't know if the ladder can be made to ONLY work on friendly units, and it has the inherent issue of needing the target to have mana, so you'd need to give every eligible unit a mana pool to be able to use it I guess. This isn't necessarily an issue, but it could involve a bit of labor to implement without issues, if your map is fragile on this point.

Either way, both of the spells would simply start a trigger based life transfer between the 2 units. You'd run a periodic event, transfering hp from the target to to the caster, and end the event if the channel is broken. Even if targeting options are an issue, you can easily nullify the effect of the ability when used on an enemy through trigger conditions, so it's definitely an option to do it this way, albeit less satisfying than a non-trigger based solution.
 
Status
Not open for further replies.
Top