Vulcansurge
Ultra Cool Member
- Reaction score
- 27
These are the triggers im currently using in my map MOTHERSHIPS, to make small ships and make the fly around you main Mothership (its meant to be sorta like passive locust swarm...). I've decided to either convert it to JASS, and im not sure ever where to start. Im new to JASS as of about a month ago, but im sure you'll be able to throw most ideas at me with me understanding.
I dont expect you to read all of this, but try if you can. There is a breif description at the bottom of each one.
This code creates the ships and sets them to a variable. Player one will get <ship name> [11], <ship name> [21], <ship name> [31]...
This trigger kills all the ships when the corresponding item drops.
This replaces each ship as it dies.
This moves each ship to random locations around the main ship.
Thanks in advance if you can help. Im sure if you read even half of this you've earnt my +rep.
I dont expect you to read all of this, but try if you can. There is a breif description at the bottom of each one.
Code:
ShipAquire
Events
Unit - A unit Acquires an item
Conditions
Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Basically creates the ships whenever unit aquires the items. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Creates variables for the ships so they can fly around the mothership. --------
-------- Variables are player number multiplied by integer A, so Player One gets: --------
-------- 11, 21, 31, 41, 51, 61, 71, 81, 91 and 101 (player 2 gets 12, 22, 32...) --------
-------- There is a maximum of 10 units per squad, to eliminate lag. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Cannot have more than one of the same squad because of this. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to A-Wing Squad
Then - Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 A-Wing Fighter for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitAWing[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitAWingMothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to B-Wing Squad
Then - Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 B-Wing Fighter for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitBWing[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitBWingMothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to ARC-170 Squad
Then - Actions
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 ARC-170 Fighter-Bomber for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitARC170[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitARC170Mothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Jedi Interceptor Squad
Then - Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 Jedi Interceptor for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitJedi[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitJediMothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Y-Wing Squad
Then - Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 Y-Wing Bomber for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitYWing[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitYWingMothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to T-Wing Squad
Then - Actions
For each (Integer A) from 1 to 3, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 T-Wing Bomber for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitTWing[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitTWingMothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Millennium Falcon
Then - Actions
For each (Integer A) from 1 to 1, do (Actions)
Loop - Actions
Set tempPoint[0] = (Position of (Hero manipulating item))
Unit - Create 1 YT-1300 Millennium Falcon for (Owner of (Hero manipulating item)) at tempPoint[0] facing Default building facing degrees
Unit - Set (Last created unit) movement speed to 800.00
Set UnitFalcon[(((Integer A) x 10) + (Player number of (Owner of (Hero manipulating item))))] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Set UnitFalconMothership[(Player number of (Owner of (Hero manipulating item)))] = (Hero manipulating item)
Else - Actions
Do nothing
Code:
ShipDrop
Events
Unit - A unit Loses an item
Conditions
Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Destroys ships when the hero drops the item. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to A-Wing Squad
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitAWing[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((2 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((3 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((4 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((5 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((6 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((7 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((8 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((9 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitAWing[((10 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to B-Wing Squad
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitBWing[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((2 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((3 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((4 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((5 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((6 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((7 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((8 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((9 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitBWing[((10 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to ARC-170 Squad
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitARC170[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((2 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((3 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((4 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((5 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((6 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((7 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitARC170[((8 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Jedi Interceptor Squad
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitJedi[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitJedi[((2 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitJedi[((3 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitJedi[((4 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitJedi[((5 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitJedi[((6 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Y-Wing Squad
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitYWing[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitYWing[((2 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitYWing[((3 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitYWing[((4 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitYWing[((5 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to T-Wing Squad
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitTWing[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitTWing[((2 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Unit - Kill UnitTWing[((3 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Millennium Falcon
Then - Actions
Trigger - Turn off ShipKilled <gen>
Unit - Kill UnitFalcon[((1 x 10) + (Player number of (Owner of (Hero manipulating item))))]
Trigger - Turn on ShipKilled <gen>
Else - Actions
Do nothing
Code:
ShipKilled
Events
Unit - A unit Dies
Conditions
Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- When a ship dies it is respawned at the position of its mothership, --------
-------- and starts flying around again. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- There is an If/Then/Else for each ship type because the code is hard to make --------
-------- without doing this. It tends to make slow computers sluggish in 4v4 or 5v5. --------
-------- This is because each If/Then/Else repeats upto 110 times. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitAWing[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitAWingMothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 A-Wing Fighter for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitAWing[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitBWing[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitBWingMothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 B-Wing Fighter for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitBWing[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitARC170[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitARC170Mothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 ARC-170 Fighter-Bomber for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitARC170[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitJedi[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitJediMothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 Jedi Interceptor for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitJedi[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitYWing[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitYWingMothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 Y-Wing Bomber for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitYWing[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitTWing[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitTWingMothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 T-Wing Bomber for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitTWing[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dying unit) Equal to UnitFalcon[(Integer A)]
Then - Actions
Set tempPoint[0] = (Position of UnitFalconMothership[(Player number of (Owner of (Dying unit)))])
Unit - Create 1 YT-1300 Millennium Falcon for (Owner of (Dying unit)) at tempPoint[0] facing tempPoint[0]
Set UnitFalcon[(Integer A)] = (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[0])
Else - Actions
Do nothing
Code:
ShipFly
Events
Time - Every 1.50 seconds of game time
Conditions
Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Makes the fighter ships fly. --------
-------- This is a monster code and may have bugs or leaks, use at own risk. --------
-------- -------------------------------------------------------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitAWingMothership[(Player number of (Owner of UnitAWing[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitAWingMothership[(Player number of (Owner of UnitAWing[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (2000.00, 2000.00)))
Unit - Order UnitAWing[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitAWing[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitAWing[(Integer A)]))])
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitBWingMothership[(Player number of (Owner of UnitBWing[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitBWingMothership[(Player number of (Owner of UnitBWing[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (2000.00, 2000.00)))
Unit - Order UnitBWing[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitBWing[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitBWing[(Integer A)]))])
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitARC170Mothership[(Player number of (Owner of UnitARC170[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitARC170Mothership[(Player number of (Owner of UnitARC170[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (3000.00, 3000.00)))
Unit - Order UnitARC170[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitARC170[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitARC170[(Integer A)]))])
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitJediMothership[(Player number of (Owner of UnitJedi[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitJediMothership[(Player number of (Owner of UnitJedi[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (3000.00, 3000.00)))
Unit - Order UnitJedi[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitJedi[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitJedi[(Integer A)]))])
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitYWingMothership[(Player number of (Owner of UnitYWing[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitYWingMothership[(Player number of (Owner of UnitYWing[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (3000.00, 3000.00)))
Unit - Order UnitYWing[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitYWing[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitYWing[(Integer A)]))])
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitTWingMothership[(Player number of (Owner of UnitTWing[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitTWingMothership[(Player number of (Owner of UnitTWing[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (3000.00, 3000.00)))
Unit - Order UnitTWing[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitTWing[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitTWing[(Integer A)]))])
For each (Integer A) from 1 to 110, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UnitFalconMothership[(Player number of (Owner of UnitFalcon[(Integer A)]))] is alive) Equal to True
Then - Actions
Set tempPoint[0] = (Position of UnitFalconMothership[(Player number of (Owner of UnitFalcon[(Integer A)]))])
Set tempPoint[1] = (Random point in (Region centered at tempPoint[0] with size (3000.00, 3000.00)))
Unit - Order UnitFalcon[(Integer A)] to Move To tempPoint[1]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call RemoveLocation(udg_tempPoint[1])
Else - Actions
Unit - Move UnitFalcon[(Integer A)] instantly to (Center of RegionSpawn[(Player number of (Owner of UnitTWing[(Integer A)]))])
Thanks in advance if you can help. Im sure if you read even half of this you've earnt my +rep.