- Joined
- Feb 13, 2009
- Messages
- 388
Hello. I plan to use this "system" to spawn various units and order them to attack random player heroes. Since I will use it a lot I want to know what should I fix here to prevent leaks and optimize the structure.
So to prevent them hoarding at 1 place and to move those whos target is dead/hidden I use this "re-acquire target" script (via custom value 23).
14.59 seconds: to prevent conflicts with spawning scripts
-
Dogs
-
Events
-

Time - Every 41.00 seconds of game time
-
-
Conditions
-
Actions
-

Set dogloc1 = (Center of desertSpawn <gen>)
-

Set creepTarget = (Position of (Random unit from (Units in outside <gen> owned by (Random player from (All players controlled by User player)))))
-

For each (Integer A) from 1 to 10, do (Actions)
-


Loop - Actions
-



Unit - Create 1 |cffffcc00Wild dog for Player 11 (Dark Green) at dogloc1 facing Default building facing (270.0) degrees
-



Unit - Order (Last created unit) to Attack-Move To creepTarget
-
-
-

Custom script: call RemoveLocation(udg_dogloc1)
-

Custom script: call RenoveLocation(ung_creepTarget)
-
So to prevent them hoarding at 1 place and to move those whos target is dead/hidden I use this "re-acquire target" script (via custom value 23).
14.59 seconds: to prevent conflicts with spawning scripts
-
Send23wave
-
Events
-

Time - Every 14.59 seconds of game time
-
-
Conditions
-
Actions
-

Set creepTarget = (Position of (Random unit from (Units in outside <gen> owned by (Random player from (All players controlled by a User player)))))
-

Unit Group - Pick every unit in (Units in outside <gen> owned by Player 11 (Dark Green)) and do (Actions)
-


Loop - Actions
-



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




If - Conditions
-





(Custom value of (Picked unit)) Equal to 23
-
-




Then - Actions
-





Unit - Order (Picked unit) to Attack-Move To creepTarget
-
-




Else - Actions
-





Do nothing
-
-
-
-
-

Custom script: call RemoveLocation(udg_creepTarget)
-
