The spells I post below are almost equal to each other with the little difference, that the first damages casting units and the second spell damages attacking units. The first spell works - the second doesnt and I dont know why.
Backfire_Owner and Empathy_Owner are both Unit-arrays.
Working triggers:
Flawed triggers:
I want to indicate the unit which has cast the debuff, because in case the target dies it is useful to know who has killed it. It would be much more simple to make the units damage theirselves, of course, but that's not what I want.
Note: I have only one unit per player so there's no error with the arrays.
Greets Bonzo
Backfire_Owner and Empathy_Owner are both Unit-arrays.
Working triggers:
Code:
Backfire Start
Events
Unit - A Unit starts the effect of an ability
Conditions
(Ability being cast) Equal to Backfire
Actions
Set Backfire_Owner[(Player number of (Owner of (Target unit of ability being cast)))] = (Casting unit)
Backfire Do
Events
Unit - A Unit starts the effect of an ability
Conditions
((Casting unit) has buff Backfire ) Equal to True
Actions
Unit - Cause Backfire_Owner[(Player number of (Owner of (Triggering unit)))] to damage (Triggering unit), dealing 150.00 damage of attack type Spells and damage type Normal
Flawed triggers:
Code:
Empathy Start
Events
Unit - A Unit starts the effect of an ability
Conditions
(Ability being cast) Equal to Empathy
Actions
Set Empathy_Owner[(Player number of (Owner of (Target unit of ability being cast)))] = (Casting unit)
Empathy Do
Events
Unit - A unit is attacked
Conditions
((Attacking unit) has buff Empathy ) Equal to True
Actions
Unit - Cause Empathy_Owner[(Player number of (Owner of (Attacked unit)))] to damage (Attacking unit), dealing 75.00 damage of attack type Spells and damage type Normal
I want to indicate the unit which has cast the debuff, because in case the target dies it is useful to know who has killed it. It would be much more simple to make the units damage theirselves, of course, but that's not what I want.
Note: I have only one unit per player so there's no error with the arrays.
Greets Bonzo