B
bio-zombie
Guest
im trying to make a spell that hexes multiple units, but it doesn't work...
Is there any problem?
Code:
Event
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Dark Curse
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Dark Curse for (Casting unit)) Equal to 1
Then - Actions
Set Caster = (Casting unit)
Set TargetUnitBeingCast = (Target unit of ability being cast)
Wait until (((TargetUnitBeingCast has buff Dark Curse ) Equal to True) or (((Target unit of ability being cast) is dead) Equal to True)), checking every 0.10 seconds
Set Target = (Random unit from (Units within 1000.00 of (Position of TargetUnitBeingCast) matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Dark Curse ) Equal to False)) and ((((Owner of (Matching unit)) is an enemy of (Owner of Caster))
Unit - Create 1 Spirit for (Owner of Caster) at (Position of TargetUnitBeingCast) facing (Random angle) degrees
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Orc Shadow Hunter - Hex Target
Wait until (((TargetUnitBeingCast has buff Dark Curse ) Equal to True) or (((Target unit of ability being cast) is dead) Equal to True)), checking every 0.10 seconds
Set TargetUnitBeingCast = Target
Set Target = (Random unit from (Units within 1000.00 of (Position of TargetUnitBeingCast) matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Dark Curse ) Equal to False)) and ((((Owner of (Matching unit)) is an enemy of (Owner of Caster))
Unit - Create 1 Spirit for (Owner of Caster) at (Position of TargetUnitBeingCast) facing (Random angle) degrees
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Orc Shadow Hunter - Hex Target
Else - Actions


