Code:
Horrifying Possession
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Horrifing Possession (LOA)
Actions
Set TempLoc[1] = (Position of (Triggering unit))
Set TempGroup[1] = (Random 10 units from (Units within 1000.00 of TempLoc[1] matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))))
Unit - Create 1 Dummy Caster (Common) for (Owner of (Triggering unit)) at TempLoc[1] facing Default building facing degrees
Unit - Add Horrifying Possession to (Last created unit)
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Unit Group - Pick every unit in TempGroup[1] and do (Actions)
Loop - Actions
Unit - Order (Last created unit) to Orc Shadow Hunter - Hex (Picked unit)
Custom script: call DestroyGroup(udg_TempGroup[1])
Custom script: call RemoveLocation(udg_TempLoc[1])
it only can hex 1 unit