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.