[trigger=Gui]Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in GroupVault and do (Actions)
Loop - Actions
Set TempUnitA = (Picked unit)
Set TempPointA = (Position of TempUnitA)
Custom script: set udg_TempIntegerA = GetHandleId( udg_TempUnitA )
Set TempUnitB = (Load 0 of TempIntegerA in HashtableVault)
Set TempPlayer = (Owner of TempUnitB)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(1 is stored as a Real of TempIntegerA in HashtableVault) Equal to True
Then - Actions
Custom script: set udg_TempDestA = null
Set TempPointB = (TempPointA offset by (Load 2 of TempIntegerA from HashtableVault) towards (Load 1 of TempIntegerA from HashtableVault) degrees)
Destructible - Pick every destructible within 80.00 of TempPointB and do (Actions)
Loop - Actions
Set TempDestA = (Picked destructible)
Unit - Create 1 Peasant for TempPlayer at TempPointA facing Default building facing degrees
Set TempUnitC = (Last created unit)
Unit - Order TempUnitC to Harvest TempDestA
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of TempUnitC) Not equal to (Order(harvest))
Then - Actions
Custom script: set udg_TempDestA = null
Else - Actions
Unit - Remove TempUnitC from the game
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempDestA Equal to No destructible
(Terrain pathing at TempPointB of type Walkability is off) Equal to False
Then - Actions
Custom script: call SetUnitX(udg_TempUnitA, GetLocationX (udg_TempPointB))
Custom script: call SetUnitY(udg_TempUnitA, GetLocationY (udg_TempPointB))
Else - Actions
Set TempRealA = ((Load 3 of TempIntegerA from HashtableVault) - 8.00)
Set TempRealB = ((Load -3 of TempIntegerA from HashtableVault) + TempRealA)
Animation - Change TempUnitA flying height to TempRealB at 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealB Less than or equal to 0.00
Then - Actions
Unit - Turn collision for TempUnitA On
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitA is A flying unit) Equal to True
Then - Actions
Animation - Change TempUnitA flying height to (Default flying height of TempUnitA) at 200.00
Else - Actions
Special Effect - Create a special effect at TempPointB using (Load 4 of TempIntegerA from HashtableVault)
Special Effect - Destroy (Last created special effect)
Unit Group - Remove TempUnitA from GroupVault
Hashtable - Clear all child hashtables of child TempIntegerA in HashtableVault
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(GroupVault is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Unit - Order TempUnitA to Stop
Unit - Turn collision for TempUnitA Off
Hashtable - Save TempRealA as 3 of TempIntegerA in HashtableVault
Hashtable - Save TempRealB as -3 of TempIntegerA in HashtableVault
Custom script: call RemoveLocation (udg_TempPointB)
Else - Actions
Custom script: set udg_TempUnitC = null
Set TempUnitC = (Load 1 of TempIntegerA in HashtableVault)
Set VaultHeight = (Load 9 of TempIntegerA from HashtableVault)
Set VaultCollision = (Load 11 of TempIntegerA from HashtableVault)
Set VaultDamage = (Load 12 of TempIntegerA from HashtableVault)
Set VaultEffects = (Load 13 of TempIntegerA from HashtableVault)
Set VaultAttachment = (Load 14 of TempIntegerA from HashtableVault)
Set VaultKspeed = (Load 15 of TempIntegerA from HashtableVault)
Set VaultKpower = (Load 16 of TempIntegerA from HashtableVault)
Set VaultKeffects = (Load 17 of TempIntegerA from HashtableVault)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultHeight Greater than 0.00
TempUnitC Not equal to No unit
Then - Actions
Set TempPointB = (Position of TempUnitC)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between TempPointA and TempPointB) Greater than TempRealB
Then - Actions
Set TempPointC = (TempPointA offset by (Load 8 of TempIntegerA from HashtableVault) towards (Angle from TempPointA to TempPointB) degrees)
Custom script: call SetUnitX(udg_TempUnitA, GetLocationX (udg_TempPointC))
Custom script: call SetUnitY(udg_TempUnitA, GetLocationY (udg_TempPointC))
Custom script: call RemoveLocation (udg_TempPointC)
Else - Actions
Custom script: call SetUnitX(udg_TempUnitA, GetUnitX (udg_TempUnitC))
Custom script: call SetUnitY(udg_TempUnitA, GetUnitY (udg_TempUnitC))
Custom script: call RemoveLocation (udg_TempPointB)
Else - Actions
-------- --------
Set TempRealA = (Load 21 of TempIntegerA from HashtableVault)
Set TempRealB = (Load -21 of TempIntegerA from HashtableVault)
Set TempRealC = (Load 22 of TempIntegerA from HashtableVault)
Set TempRealD = (Load -22 of TempIntegerA from HashtableVault)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealA Equal to TempRealB
TempRealC Equal to TempRealD
Then - Actions
Set TempItemA = (Load 2 of TempIntegerA in HashtableVault)
Set VaultSize = (Load 3 of TempIntegerA from HashtableVault)
Set VaultItemSize = (Load 4 of TempIntegerA from HashtableVault)
Set VaultCapacity = (Load -6 of TempIntegerA from HashtableVault)
Set TempIntegerB = (Load -1 of TempIntegerA from HashtableVault)
-------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
Custom script: if ( udg_TempIntegerB == 0 ) then
Set TempRealA = ((Load -9 of TempIntegerA from HashtableVault) + 5.00)
Set VaultHeight = (VaultHeight - TempRealA)
Animation - Change TempUnitA flying height to VaultHeight at 0.00
Hashtable - Save VaultHeight as 9 of TempIntegerA in HashtableVault
Hashtable - Save TempRealA as -9 of TempIntegerA in HashtableVault
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultHeight Greater than 0.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultHeight Less than or equal to 100.00
Then - Actions
Destructible - Pick every destructible within VaultCollision of TempPointA and do (Actions)
Loop - Actions
Set TempDestA = (Picked destructible)
Unit - Create 1 Peasant for TempPlayer at TempPointA facing Default building facing degrees
Set TempUnitC = (Last created unit)
Unit - Order TempUnitC to Harvest TempDestA
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of TempUnitC) Equal to (Order(harvest))
Then - Actions
Destructible - Kill TempDestA
Else - Actions
Unit - Remove TempUnitC from the game
Else - Actions
Set TempGroupA = (Units within VaultCollision of TempPointA matching (((Matching unit) is alive) Equal to True))
Unit Group - Pick every unit in TempGroupA and do (Actions)
Loop - Actions
Set TempUnitC = (Picked unit)
Set TempPointB = (Position of TempUnitC)
Set TempRealA = (Current flying height of TempUnitC)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultHeight Greater than or equal to TempRealA
VaultHeight Less than or equal to (TempRealA + 80.00)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempItemA Not equal to No item
VaultCapacity Not equal to (Load 6 of TempIntegerA from HashtableVault)
(Distance between TempPointA and TempPointB) Less than or equal to (Load 5 of TempIntegerA from HashtableVault)
Then - Actions
Unit - Hide TempUnitC
Unit - Pause TempUnitC
Set VaultCapacity = (VaultCapacity + 1)
Hashtable - Save VaultCapacity as -6 of TempIntegerA in HashtableVault
Hashtable - Save Handle OfTempUnitC as (100 + VaultCapacity) of TempIntegerA in HashtableVault
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitC is selected by (Owner of TempUnitC)) Equal to True
Then - Actions
Hashtable - Save True as (200 + VaultCapacity) of TempIntegerA in HashtableVault
Else - Actions
Else - Actions
Unit - Cause TempUnitB to damage TempUnitC, dealing VaultDamage damage of attack type Spells and damage type Normal
Special Effect - Create a special effect attached to the VaultAttachment of TempUnitC using VaultEffects
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitC is A structure) Equal to False
Then - Actions
Unit - Add Crow Form to TempUnitC
Unit - Remove Crow Form from TempUnitC
Set TempRealB = (Angle from TempPointA to TempPointB)
Set TempPointC = (TempPointA offset by VaultCollision towards TempRealB degrees)
Custom script: call SetUnitX(udg_TempUnitC, GetLocationX (udg_TempPointC))
Custom script: call SetUnitY(udg_TempUnitC, GetLocationY (udg_TempPointC))
Custom script: call RemoveLocation (udg_TempPointC)
Custom script: set udg_TempIntegerB = GetHandleId( udg_TempUnitC )
Hashtable - Save Handle OfTempUnitB as 0 of TempIntegerB in HashtableVault
Hashtable - Save TempRealB as 1 of TempIntegerB in HashtableVault
Hashtable - Save TempRealA as -3 of TempIntegerB in HashtableVault
Hashtable - Save VaultKspeed as 2 of TempIntegerB in HashtableVault
Hashtable - Save VaultKpower as 3 of TempIntegerB in HashtableVault
Hashtable - Save VaultKeffects as 4 of TempIntegerB in HashtableVault
Unit Group - Add TempUnitC to GroupVault
Else - Actions
Else - Actions
Custom script: call RemoveLocation (udg_TempPointB)
Custom script: call DestroyGroup (udg_TempGroupA)
Else - Actions
Hashtable - Save 1 as -1 of TempIntegerA in HashtableVault
For each (Integer TempIntegerB) from 1 to 8, do (Actions)
Loop - Actions
Set TempPointB = (TempPointA offset by (VaultCollision - 100.00) towards ((360.00 / 8.00) x (Real(TempIntegerB))) degrees)
Special Effect - Create a special effect at TempPointB using (Load 18 of TempIntegerA from HashtableVault)
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_TempPointB)
Hashtable - Save VaultSize as 20 of TempIntegerA in HashtableVault
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultCapacity Greater than 0
Then - Actions
Hashtable - Save VaultItemSize as 21 of TempIntegerA in HashtableVault
Else - Actions
Hashtable - Save 0.00 as 21 of TempIntegerA in HashtableVault
-------- --------
Hashtable - Save 0.00 as -20 of TempIntegerA in HashtableVault
Hashtable - Save 100.00 as 22 of TempIntegerA in HashtableVault
Custom script: else
-------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
Custom script: if ( udg_TempIntegerB == 1 ) then
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultCapacity Greater than 0
Then - Actions
Hashtable - Save 2 as -1 of TempIntegerA in HashtableVault
Custom script: call UnitRemoveAbility( udg_TempUnitA, 'Aloc' )
Unit - Hide TempUnitA
Item - Show TempItemA
Item - Move TempItemA to TempPointA
Custom script: set udg_TempIntegerB = GetHandleId( udg_TempItemA )
Hashtable - Save Handle OfTempUnitA as 0 of TempIntegerB in HashtableVault
Else - Actions
Item - Remove TempItemA
Unit - Remove TempUnitA from the game
Unit Group - Remove TempUnitA from GroupVault
Hashtable - Clear all child hashtables of child TempIntegerA in HashtableVault
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(GroupVault is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Custom script: else
-------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
Custom script: if ( udg_TempIntegerB == 2 ) then
Custom script: set udg_TempIntegerB = GetHandleId( udg_TempItemA )
Set TempRealA = ((Load 7 of TempIntegerA from HashtableVault) - 0.03)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealA Greater than 0.00
(Current life of TempItemA) Greater than 0.00
Then - Actions
Hashtable - Save TempRealA as 7 of TempIntegerA in HashtableVault
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempItemA is owned) Equal to True
Then - Actions
Set TempUnitC = (Load 1 of TempIntegerB in HashtableVault)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitC is hidden) Equal to False
Then - Actions
Custom script: call SetUnitX(udg_TempUnitA, GetUnitX(udg_TempUnitC))
Custom script: call SetUnitY(udg_TempUnitA, GetUnitY(udg_TempUnitC))
Else - Actions
Hero - Drop TempItemA from TempUnitC
Else - Actions
Custom script: call SetUnitX(udg_TempUnitA, GetItemX(udg_TempItemA))
Custom script: call SetUnitY(udg_TempUnitA, GetItemY(udg_TempItemA))
Else - Actions
Hashtable - Save 3 as -1 of TempIntegerA in HashtableVault
Unit - Unhide TempUnitA
Custom script: call UnitAddAbility( udg_TempUnitA, 'Aloc' )
Custom script: call SetUnitX(udg_TempUnitA, (GetRandomReal(-0.01, 0.01) + GetLocationX(udg_TempPointA)))
Custom script: call SetUnitY(udg_TempUnitA, (GetRandomReal(-0.01, 0.01) + GetLocationY(udg_TempPointA)))
Hashtable - Save VaultSize as 21 of TempIntegerA in HashtableVault
Hashtable - Save VaultItemSize as 20 of TempIntegerA in HashtableVault
Hashtable - Clear all child hashtables of child TempIntegerB in HashtableVault
Item - Remove TempItemA
Custom script: else
-------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
Hashtable - Save 1 as -1 of TempIntegerA in HashtableVault
Hashtable - Save 0 as -6 of TempIntegerA in HashtableVault
For each (Integer TempIntegerB) from 1 to VaultCapacity, do (Actions)
Loop - Actions
Set TempUnitC = (Load (100 + TempIntegerB) of TempIntegerA in HashtableVault)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultCapacity Greater than 1
Then - Actions
Set TempRealA = (VaultCollision / 5.00)
Else - Actions
Set TempRealA = 0.00
Set TempPointB = (TempPointA offset by TempRealA towards ((360.00 / (Real(VaultCapacity))) x (Real(TempIntegerB))) degrees)
Custom script: call SetUnitX(udg_TempUnitC, GetLocationX (udg_TempPointB))
Custom script: call SetUnitY(udg_TempUnitC, GetLocationY (udg_TempPointB))
Custom script: call RemoveLocation (udg_TempPointB)
Unit - Unhide TempUnitC
Unit - Unpause TempUnitC
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (200 + TempIntegerB) of TempIntegerA from HashtableVault) Equal to True
Then - Actions
Selection - Add TempUnitC to selection for (Owner of TempUnitC)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitC is A flying unit) Equal to True
Then - Actions
Animation - Change TempUnitC flying height to 0.00 at 0.00
Animation - Change TempUnitC flying height to (Default flying height of TempUnitC) at 200.00
Else - Actions
Hashtable - Save VaultSize as 20 of TempIntegerA in HashtableVault
Hashtable - Save 0.00 as 21 of TempIntegerA in HashtableVault
Hashtable - Save 0.00 as -20 of TempIntegerA in HashtableVault
Hashtable - Save 100.00 as 22 of TempIntegerA in HashtableVault
Custom script: endif
Custom script: endif
Custom script: endif
Else - Actions
Set VaultReform = (0.03 / (Load 10 of TempIntegerA from HashtableVault))
Set TempRealE = (Load 20 of TempIntegerA from HashtableVault)
Set TempRealF = ((TempRealA - TempRealE) x VaultReform)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealA Not equal to TempRealB
Then - Actions
Set TempRealF = (TempRealB + TempRealF)
Else - Actions
Set TempRealF = TempRealA
Hashtable - Save TempRealF as -21 of TempIntegerA in HashtableVault
Animation - Change TempUnitA's size to (TempRealF%, 0.00%, 0.00%) of its original size
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealA Greater than TempRealE
Then - Actions
Set TempRealE = (VaultCollision / (TempRealA / TempRealF))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VaultHeight Less than or equal to 100.00
Then - Actions
Destructible - Pick every destructible within TempRealE of TempPointA and do (Actions)
Loop - Actions
Set TempDestA = (Picked destructible)
Unit - Create 1 Peasant for TempPlayer at TempPointA facing Default building facing degrees
Set TempUnitC = (Last created unit)
Unit - Order TempUnitC to Harvest TempDestA
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of TempUnitC) Equal to (Order(harvest))
Then - Actions
Destructible - Kill TempDestA
Else - Actions
Unit - Remove TempUnitC from the game
Else - Actions
Set TempGroupA = (Units within TempRealE of TempPointA matching (((Matching unit) is alive) Equal to True))
Unit Group - Pick every unit in TempGroupA and do (Actions)
Loop - Actions
Set TempUnitC = (Picked unit)
Set TempRealA = (Current flying height of TempUnitC)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealA Greater than or equal to VaultHeight
TempRealA Less than or equal to (VaultHeight + 80.00)
Then - Actions
Set TempPointB = (Position of TempUnitC)
Unit - Cause TempUnitB to damage TempUnitC, dealing VaultDamage damage of attack type Spells and damage type Normal
Special Effect - Create a special effect attached to the VaultAttachment of TempUnitC using VaultEffects
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitC is A structure) Equal to False
Then - Actions
Unit - Add Crow Form to TempUnitC
Unit - Remove Crow Form from TempUnitC
Set TempRealB = (Angle from TempPointA to TempPointB)
Set TempPointC = (TempPointA offset by TempRealE towards TempRealB degrees)
Custom script: call SetUnitX(udg_TempUnitC, GetLocationX (udg_TempPointC))
Custom script: call SetUnitY(udg_TempUnitC, GetLocationY (udg_TempPointC))
Custom script: call RemoveLocation (udg_TempPointC)
Custom script: set udg_TempIntegerB = GetHandleId( udg_TempUnitC )
Hashtable - Save Handle OfTempUnitB as 0 of TempIntegerB in HashtableVault
Hashtable - Save TempRealB as 1 of TempIntegerB in HashtableVault
Hashtable - Save TempRealA as -3 of TempIntegerB in HashtableVault
Hashtable - Save VaultKspeed as 2 of TempIntegerB in HashtableVault
Hashtable - Save VaultKpower as 3 of TempIntegerB in HashtableVault
Hashtable - Save VaultKeffects as 4 of TempIntegerB in HashtableVault
Unit Group - Add TempUnitC to GroupVault
Else - Actions
Custom script: call RemoveLocation (udg_TempPointB)
Else - Actions
Custom script: call DestroyGroup (udg_TempGroupA)
Else - Actions
-------- --------
Set TempRealE = (Load -20 of TempIntegerA from HashtableVault)
Set TempRealF = ((TempRealC - TempRealE) x VaultReform)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealC Not equal to TempRealD
Then - Actions
Set TempRealE = (TempRealD + TempRealF)
Else - Actions
Set TempRealE = TempRealC
Hashtable - Save TempRealE as -22 of TempIntegerA in HashtableVault
Animation - Change TempUnitA's vertex coloring to (100.00%, 100.00%, 100.00%) with TempRealE% transparency
Custom script: call RemoveLocation (udg_TempPointA)
[/trigger]