Why doesnt this trigger work

Bonzo

New Member
Reaction score
4
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:
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
 

Romek

Super Moderator
Reaction score
963
Can you explain how the spell actually functions?

Is it that a spell is cast on a unit, which gives it a buff, which then makes it that the targeted unit takes damage every time it attacks/casts a spell?

If its a spell which has no target, and simply adds the buff to the caster, you should use:
Code:
Set Backfire_Owner[(Player number of (Owner of (Casting unit)))] = (Casting unit)
instead of
Code:
Set Backfire_Owner[(Player number of (Owner of (Target unit of ability being cast)))] = (Casting unit)
 

Bonzo

New Member
Reaction score
4
Both spells are copied from Guild Wars and are debuffs 'hexes' or 'debuffs' onto enemies.
E.g. my hero casts Backfire on an enemy. Everytimte this enemy casts a spell while he has the Backfire debuff he takes damage.
Empathy is almost the same. My hero casts empathy on an enemy and everytime the enemy attacks while he has the debuff on him he takes damage.

I hope now it is clear how the spells are supposed to work.
The system itself seems to be right, because the Backfire works, but I dont see why Empathy doesnt.
 

Weyrling

New Member
Reaction score
25
Correction: In the second trigger, you use 'EmpathyOwner[(Player number of (Owner of (Attacked unit)))].
Shouldn't that be 'attacking unit'?
 

Bonzo

New Member
Reaction score
4
So simple it can be.. thanks Weyrilng, that was the mistake which made crash the whole trigger.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top