- Joined
- Nov 23, 2006
- Messages
- 592
Hello,
so I am using a squad system. The way it works is that when you select any unit from a squad, a squad leader is automatically selected. There is always only one type of unit in a squad.
When an order is issued to leader it is also given to all units in squad.
The problem comes with using abilities. The way I want it to work is:
1) A player selects a squad
2) squad leader is automaticaly selected (this is handled in different trigger)
3) player uses ability of squad leader (all the other units in squad are same type, therefore they also posses the ability)
4) the trigger stops squad leader from casting the ability and picks random unit from his squad to cast the ability
the first issue is that it is not working
the second issue is that I don't want a unit which has the ability on cooldown to be chosen, I have no idea how to do that
The trigger:
Thanks in advance
so I am using a squad system. The way it works is that when you select any unit from a squad, a squad leader is automatically selected. There is always only one type of unit in a squad.
When an order is issued to leader it is also given to all units in squad.
The problem comes with using abilities. The way I want it to work is:
1) A player selects a squad
2) squad leader is automaticaly selected (this is handled in different trigger)
3) player uses ability of squad leader (all the other units in squad are same type, therefore they also posses the ability)
4) the trigger stops squad leader from casting the ability and picks random unit from his squad to cast the ability
the first issue is that it is not working
the second issue is that I don't want a unit which has the ability on cooldown to be chosen, I have no idea how to do that
The trigger:
-
Events
-
Unit - A unit Is issued an order targeting an object
-
-
Conditions
-
(Issued order) Equal to (Order(heal))
-
(Custom value of (Ordered unit)) Not equal to 0
-
-
Actions
-
Set Target = (Target unit of issued order)
-
Set Unit = (Ordered unit)
-
Set Num = (Custom value of Unit)
-
Unit - Pause Unit
-
Unit - Unpause Unit
-
Unit Group - Pick every unit in (Random 1 units from Squad[Num]) and do (Unit - Order (Picked unit) to Human Priest - Heal Target)
-
Thanks in advance