I've made a buff spell you cast on a unit, it's attacks then will apply the Zerg Building Dies (Spawn broodlings) onto unit's it attacks, basically creating broodlings as it kills units.
I did it the easy way with triggers just a unit attacks, it has that behaviour, apply broodling behaviour onto unit being attacked.
The problem is IF the attacker kills the defender in 1 shot, it can't apply the behaviour in time before it dies?
How can I do it better through Data Editor, I can't find a way?
I assume, you want to use this on different units without having to use a set effect for every single attack, correct?
You could use a behavior with a damage response, set the chance to 1, the location to attacker and the handled effect to your apply buff effect.
This will trigger for all damage, you might want to limit it, probably to ranged and melee damage (assuming your damaging spells all cause spell damage), or in another way.
I am not sure, if this will fail in case of a 1 hit kill as well, in this case you could use a 2nd behavior, which spawns the zergling immediately on a fatal damage response.
I've made a buff spell you cast on a unit, it's attacks then will apply the Zerg Building Dies (Spawn broodlings) onto unit's it attacks, basically creating broodlings as it kills units.
I did it the easy way with triggers just a unit attacks, it has that behaviour, apply broodling behaviour onto unit being attacked.
The problem is IF the attacker kills the defender in 1 shot, it can't apply the behaviour in time before it dies?
How can I do it better through Data Editor, I can't find a way?
I assume, you want to use this on different units without having to use a set effect for every single attack, correct?
You could use a behavior with a damage response, set the chance to 1, the location to attacker and the handled effect to your apply buff effect.
This will trigger for all damage, you might want to limit it, probably to ranged and melee damage (assuming your damaging spells all cause spell damage), or in another way.
I am not sure, if this will fail in case of a 1 hit kill as well, in this case you could use a 2nd behavior, which spawns the zergling immediately on a fatal damage response.