1) The affected units don't attack each other.
2) There is no easy way to tell afflicted units from other enemies. Add a special effect or buff to them.
3) The afflicted units often don't switch back. There's a little something in the editor called
local variables. They're really great. Use them. Here's how:
MindConfusion
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Mind Confusion
Actions
Custom script: local unit udg_Mind_Confusion_Target
Set Mind_Confusion_Target = (Target unit of ability being cast)
Unit - Add Wander (Neutral) to Mind_Confusion_Target
Unit - Set the custom value of Mind_Confusion_Target to (Player number of (Owner of Mind_Confusion_Target))
Unit - Change ownership of Mind_Confusion_Target to Neutral Hostile and Change color
Wait 7.00 seconds
Unit - Remove Wander (Neutral) from Mind_Confusion_Target
Unit - Order Mind_Confusion_Target to Stop
Unit - Change ownership of Mind_Confusion_Target to (Player((Custom value of Mind_Confusion_Target))) and Change color
This retains the previous player by setting it to the custom value of the target. The custom script "local unit udg_Mind_Confusion_Target" sets the target equal to a local variable.
If you want the units to attack anybody, then add them to a unit group and do something like:
Attack Random
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Your unit group) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of (Picked unit)) Not equal to (Order(attack))
Then - Actions
Unit - Order (Picked unit) to Attack (Random unit from (Units within 450.00 of (Position of (Picked unit))))
Else - Actions
My rating as of now: 2/5.
My rating if you make those improvements: 4/5.
P.S. Thanks for the credit.
~The_Raven