- Joined
- May 9, 2009
- Messages
- 735
I am making autocast chain-lightning spell that should only be autocasted by the unit when there are at least 3 enemies nearby. Well 3 part works fine but the trigger also registers all of the nearby allies of the unit even though I tried putting a condition to limit it only to only enemies:
-
Sage Chain Lightning
-

Events
-


Unit - A unit Is attacked
-
-

Conditions
-


(Unit-type of (Attacking unit)) Equal to Sage
-
-

Actions
-


Set AAAPositionSageLightning = (Position of (Attacking unit))
-


Set AAAGroupSageLightning = (Units within 800.00 of AAAPositionSageLightning)
-


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



Loop - Actions
-




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





If - Conditions
-






(Number of units in AAAGroupSageLightning) Greater than or equal to 3
-






((Picked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
-
-





Then - Actions
-






Unit - Order (Attacking unit) to Orc Far Seer - Chain Lightning (Attacked unit)
-
-





Else - Actions
-






Do nothing
-
-
-
-
-


Custom script: call RemoveLocation(udg_AAAPositionSageLightning)
-


Custom script: call DestroyGroup (udg_AAAGroupSageLightning)
-
-

