How can i make a trigger wherein an AOE spell will make a unit attack each barricade destructible caught inside the spell???
You could try this
Have an area targeted ability
Set all units in range to a target group indexed by caster
Check they are baricades
Then add to the target group
Add hero to caster group
Order unit to attack random unit in the target group
Create a dummy to cast a dummy buff on hero
When a unit dies
if unit = baricade
Remove the unit from the target group
check if there are still units in the target group
check is units in caster group still have the buff
Order the unit to attack random unit in the group
Clear leaks when buff runs out or no units left in target group.
Unit is issued an order
Unit is in caster group
Unit has buff ____
Removed unit from caster group
Remove specific buff
This should allow the caster to attack until the buff runs out or the all the baricades die. You can also have a check distance instead of random unit so you will attack the nearest baricade first.