Unfortunately, damage responses can only modify the damage for incoming attacks, not outgoing ones. So the direct way will not work.
There are several possible workarounds, though: You can apply a 2nd behavior on your attacks when you have your behavior, which will prevent the enemy from dying. You can even specify this to specific effects, which should be affected in the damage response, so you can make him only survive your autoattacks but die from a spell or whatever.
You could also use 2 separate damage effects, one with the Live flag set. Then use validators to execute the standard damage effect, if your behavior is off and the live effect, if it is on.
Isn't it best to just add a behaivor to the unit so it cannot die? if you have traveltime on damage (like a projectile you can add the behaivor direcly before the launch) and if you have instant damage just add the behaivor first. Depending on modes this might seem strange though especially as the nondying part "must" be a behaivor with either being forever on or last microseconds. Also there should be some triggers. If you have problem creating a behaivor to prevent dying check kerrigan char in data editor for her nondying behaivor. You can create such a behaivor that will only take damage from certain damage types (like if you want it to be immune to death from autoattacks it can still be killed from spells). These behaivor solution is on the unit that take damage not the attacking one. There should be something in the triggers also for anyone who want to use them.
If its like a stun crowd control effect your after (like the target gets incapitated when hp is low) use a behaivor with a validator.
Direct idea - ability which lock target kill-ability. Target can be melee. And block some types of damage not so good idea.
I am not sure, if I understand this. Could you describe the effects of the ability a little more specific?
You want to cast an ability, which will make the caster unable to kill enemies? Just by autoattacking, or with spells as well? Should only the caster not be able to kill the target, or should the target become unkillable in general? What do you mean by "allows to deal damage"? Should the unit not be able to deal damage without the behavior?
Is the behavior meant for a specific unit or should it work for every unit you apply it to?
Is it possible to create behavior which allows to deal damage on an attacks, but dont allows to kill attacked enemy?
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!
Unfortunately, damage responses can only modify the damage for incoming attacks, not outgoing ones. So the direct way will not work.
There are several possible workarounds, though: You can apply a 2nd behavior on your attacks when you have your behavior, which will prevent the enemy from dying. You can even specify this to specific effects, which should be affected in the damage response, so you can make him only survive your autoattacks but die from a spell or whatever.
You could also use 2 separate damage effects, one with the Live flag set. Then use validators to execute the standard damage effect, if your behavior is off and the live effect, if it is on.
Isn't it best to just add a behaivor to the unit so it cannot die? if you have traveltime on damage (like a projectile you can add the behaivor direcly before the launch) and if you have instant damage just add the behaivor first. Depending on modes this might seem strange though especially as the nondying part "must" be a behaivor with either being forever on or last microseconds. Also there should be some triggers. If you have problem creating a behaivor to prevent dying check kerrigan char in data editor for her nondying behaivor. You can create such a behaivor that will only take damage from certain damage types (like if you want it to be immune to death from autoattacks it can still be killed from spells). These behaivor solution is on the unit that take damage not the attacking one. There should be something in the triggers also for anyone who want to use them.
If its like a stun crowd control effect your after (like the target gets incapitated when hp is low) use a behaivor with a validator.
Direct idea - ability which lock target kill-ability. Target can be melee. And block some types of damage not so good idea.
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!
I am not sure, if I understand this. Could you describe the effects of the ability a little more specific?
You want to cast an ability, which will make the caster unable to kill enemies? Just by autoattacking, or with spells as well? Should only the caster not be able to kill the target, or should the target become unkillable in general? What do you mean by "allows to deal damage"? Should the unit not be able to deal damage without the behavior?
Is the behavior meant for a specific unit or should it work for every unit you apply it to?
So not the target should become unkillable, but the caster?
So all damage should be blocked?
Target unit of trigger ability must be unkillable and not be able to kill everything by all types of damage.
OMG! New hero in 'Heroes of the Storm' is Dustin Browder. Watch here!