Hi guys, I'm learning triggers to create custom spells so I really need some help. I was trying to make the Dark Archon's Confusion ability from SC2, targeting a group of enemy units and causing them to attack each other. Here are my triggers, and they don't seem to work:
-
Confusion
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Confusion
-
-

Actions
-


Set Confusion_Caster = (Triggering unit)
-


Set Confusion_Owner = (Owner of Confusion_Caster)
-


Set Confusion_Ability_Level = (Level of Confusion for Confusion_Caster)
-


Set Confusion_Target_Location = (Target point of ability being cast)
-


Set Confusion_Target_Owner = (Random player from (All enemies of Confusion_Owner))
-


Set Confusion_Dummy_Ability = Confusion (Dummy)
-


-------- --------------------------------- --------
-


Set Confusion_Area_of_Effect = (200.00 + ((Real(Confusion_Ability_Level)) x 50.00))
-


Set Target_Group = (Units within Confusion_Area_of_Effect of Confusion_Target_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is a
-


-------- --------------------------------- --------
-


Unit Group - Pick every unit in (Random ((Number of units in Target_Group) / 2) units from Target_Group) and do (Actions)
-



Loop - Actions
-




Set Confusion_Picked_Location = (Position of (Picked unit))
-




-------- --------------------------------- --------
-




Unit - Create 1 Dummy for Confusion_Owner at Confusion_Picked_Location facing Default building facing degrees
-




Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-




Unit - Add Confusion_Dummy_Ability to (Last created unit)
-




Unit - Set level of Confusion_Dummy_Ability for (Last created unit) to Confusion_Ability_Level
-




Unit - Order (Last created unit) to Neutral Pit Lord - Doom (Picked unit)
-




-------- --------------------------------- --------
-




Wait until (((Picked unit) has buff Confusion (Dummy)) Equal to True), checking every 0.10 seconds
-




-------- --------------------------------- --------
-




Unit Group - Add (Picked unit) to Confused_Group
-




Unit - Set the custom value of (Picked unit) to (Player number of (Owner of (Picked unit)))
-




Unit - Change ownership of (Picked unit) to Neutral Extra and Retain color
-




-------- --------------------------------- --------
-




Player - Make Neutral Extra treat Confusion_Owner as an Ally with shared vision
-




Player - Make Confusion_Owner treat Neutral Extra as an Ally with shared vision
-




Player - Make Neutral Extra treat Confusion_Target_Owner as an Enemy with shared vision
-




Player - Make Confusion_Target_Owner treat Neutral Extra as an Enemy with shared vision
-




-------- --------------------------------- --------
-




Custom script: call RemoveLocation (udg_Confusion_Picked_Location)
-
-
-


Custom script: call RemoveLocation (udg_Confusion_Target_Location)
-


Custom script: call DestroyGroup (udg_Target_Group)
-
-
-
Untitled Trigger 001
-

Events
-


Time - Every 0.10 seconds of game time
-
-

Conditions
-


(Confused_Group is empty) Equal to False
-
-

Actions
-


Unit Group - Pick every unit in Confused_Group and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






((Picked unit) has buff Confusion (Dummy)) Equal to False
-
-





Then - Actions
-






Unit Group - Remove (Picked unit) from Confused_Group
-






Unit - Change ownership of (Picked unit) to (Player((Custom value of (Picked unit)))) and Retain color
-
-





Else - Actions
-
-
-
-
-







