[Trigger] need help with ability trigger

Level 15
Joined
Aug 19, 2007
Messages
1,381
Hi there, could somebody help me to fix the following trigger, it works except it doesn't summon the Spirit of Vengeance, and I'm aware that there are leaks in it and which they are:
  • Dimension Warp
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Dimension Warp
    • Actions
      • Wait 0.20 seconds
      • Unit - Move (Target unit of ability being cast) instantly to ((Position of (Target unit of ability being cast)) offset by 300.00 towards (Random angle) degrees)
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is dead) Equal to True
        • Then - Actions
          • Unit - Create 1 Spirit of Vengeance for (Owner of (Casting unit)) at (Position of (Dying unit)) facing (Facing of (Dying unit)) degrees
          • Wait 0.10 game-time seconds
          • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Spirit of Vengeance) and do (Actions)
            • Loop - Actions
              • Unit - Set level of Power for (Picked unit) to (2 x (Level of Dimension Warp for (Casting unit)))
        • Else - Actions
          • Do nothing
, thanks for taking the time.
 
Level 8
Joined
Apr 30, 2009
Messages
338
try triggering unit instead of casting unit.

And if you use "starts the effect of an ability" for the event rather than "begins casting an ability," then you don't need the 0.2 wait. When you use "begins casting" it's also exploitable by letting the trigger run without the spell actually being cast, if the player does a stop order.

So always use "a unit starts the effect of an ability" instead of "a unit begins casting an ability"
 
Level 15
Joined
Aug 19, 2007
Messages
1,381
try to save the caster and target of cast into a variable...
the event response of casting unit and target unit of ability being cast won't work after a wait, so it need to be saved into variable.
, yeah it :D worked, thanks so much, I would +rep you if I could.

And if you use "starts the effect of an ability" for the event rather than "begins casting an ability," then you don't need the 0.2 wait. When you use "begins casting" it's also exploitable by letting the trigger run without the spell actually being cast, if the player does a stop order.

So always use "a unit starts the effect of an ability" instead of "a unit begins casting an ability"
, thanks for the tip, +rep

I think the 0.10 wait is pointless, so is that do nothing.

I hope you're aware that if two units cast this spell almost at the same time, it will bug.
, thanks for the tip, +rep
 
Last edited:
Top