Don't know if I understand what you mean... Anyway:
Trigger:
- Image spell
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- Actions
- Set Images = (Units owned by Player 1 (Red) matching (((Matching unit) is an illusion) Equal to True))
- Set ImagesCount = (Number of units in Images)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ImagesCount Less than 9
- Then - Actions
- Do something
- Else - Actions
- Do something
Needs to be adjusted to your spell I guess...
Automatic Replication
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has buff Automatic Replication ) Equal to True
(Random integer number between 1 and 100) Less than or equal to (8 x (Level of Automatic Replication Display for (Attacking unit)))
Actions
Set Replicators = (Units owned by Player 1 (Red) matching (((Matching unit) is an illusion) Equal to True))
Set ReplicatorCount = (Number of units in Replicators)
Set TempPoint = (Position of (Attacking unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ReplicatorCount Less than 8
Then - Actions
Unit - Create 1 dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
Unit - Add autoreplicate to (Last created unit)
Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Attack (Attacking unit)
Custom script: call RemoveLocation (udg_TempPoint)
Else - Actions
Do nothing