 Joined
 Apr 1, 2019
 Messages
 156
I've seen this asked before and it seems not possible to detect a block through triggers in a large mazing area without a lag spike. But it has been asked soo long ago, I don't know if anyone had any breakthroughs?
I mean Warcraft 3 itself has to run A* code everytime a movement order is issued and that doesn't lag.
I've been trying to get it to work myself using Hashtables representing a grid of stored integers X and Y. I save 1 as unwalkable squares and 2 as waypoints. 0 is walkable. Below is my triggers, Idk if anyone knows a way to optimize it?
Initialization Grid Defaults
Grid Player 1 Red Build
Test
Test Loop
I mean Warcraft 3 itself has to run A* code everytime a movement order is issued and that doesn't lag.
I've been trying to get it to work myself using Hashtables representing a grid of stored integers X and Y. I save 1 as unwalkable squares and 2 as waypoints. 0 is walkable. Below is my triggers, Idk if anyone knows a way to optimize it?
Initialization Grid Defaults

Events
 Map initialization
 Conditions

Actions
  Resets all values to defaults and 0's 
 Set BlockGrid_Int_OpenClosed1 = 0
 Set BlockGrid_Int_OpenClosed2 = 0
 Set BlockGrid_Int_WaypointTotal = 0
 Set BlockGrid_Boolean_Finish = False
 Set BlockGrid_Unit_TempUnit = No unit

For each (Integer A) from 5 to 40, do (Actions)

Loop  Actions
 Hashtable  Save 3 as (Integer A) of 72 in BlockGrid_Hashtable_Grid[1]

Loop  Actions

For each (Integer A) from 2 to 71, do (Actions)

Loop  Actions

For each (Integer B) from 1 to 44, do (Actions)

Loop  Actions

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

If  Conditions
 (Load (Integer B) of (Integer A) from BlockGrid_Hashtable_Grid[1]) Equal to 100

Then  Actions
 Hashtable  Save 0 as (Integer B) of (Integer A) in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (Integer B) of (Integer A) from BlockGrid_Hashtable_Grid[1]) Equal to 102

Then  Actions
 Hashtable  Save 2 as (Integer B) of (Integer A) in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

Loop  Actions

For each (Integer B) from 1 to 44, do (Actions)

Loop  Actions
Grid Player 1 Red Build

Events
 Unit  A unit Begins construction

Conditions
 (Unittype of (Triggering unit)) Not equal to Blacksmith
 (Unittype of (Triggering unit)) Not equal to Arcane Vault
 (Owner of (Triggering unit)) Equal to Player 1 (Red)

Actions
  Stores the 4 X and Y locations of each square the tower blocks, uses some math to store them as integers in a hashtable 
 Set BlockGrid_Unit_TempUnit = (Triggering unit)
 Set TempPointSpell = (Position of (Triggering unit))
 Set BockGrid_Int_TempX = (((X of TempPointSpell)  (X of PointRockGen[1])) / 64.00)
 Set BockGrid_Int_TempY = (((Y of TempPointSpell)  (Y of PointRockGen[1])) / 64.00)
 Hashtable  Save 1 as (Integer((BockGrid_Int_TempX + 1.00))) of (Integer((BockGrid_Int_TempY + 2.00))) in BlockGrid_Hashtable_Grid[1]
 Hashtable  Save 1 as (Integer((BockGrid_Int_TempX + 2.00))) of (Integer((BockGrid_Int_TempY + 2.00))) in BlockGrid_Hashtable_Grid[1]
 Hashtable  Save 1 as (Integer((BockGrid_Int_TempX + 1.00))) of (Integer((BockGrid_Int_TempY + 3.00))) in BlockGrid_Hashtable_Grid[1]
 Hashtable  Save 1 as (Integer((BockGrid_Int_TempX + 2.00))) of (Integer((BockGrid_Int_TempY + 3.00))) in BlockGrid_Hashtable_Grid[1]
 Game  Display to (All players) the text: ((String((BockGrid_Int_TempX + 1.00))) + (X + ((String((BockGrid_Int_TempY + 2.00))) + y)))
 Game  Display to (All players) the text: ((String((BockGrid_Int_TempX + 2.00))) + (X + ((String((BockGrid_Int_TempY + 2.00))) + y)))
 Game  Display to (All players) the text: ((String((BockGrid_Int_TempX + 1.00))) + (X + ((String((BockGrid_Int_TempY + 3.00))) + y)))
 Game  Display to (All players) the text: ((String((BockGrid_Int_TempX + 2.00))) + (X + ((String((BockGrid_Int_TempY + 3.00))) + y)))
 Custom script: call RemoveLocation(udg_TempPointSpell)
 Trigger  Run Test <gen> (checking conditions)
Test
 Events
 Conditions

Actions
  Checks start of mazing area for 0s and 2s and changes them to 100 and 102 
  Adds the Coordinance of the 100 and 102 to a integer array to be looped through in next trigger 

For each (Integer A) from 5 to 40, do (Actions)

Loop  Actions

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

If  Conditions
 (Load (Integer A) of 2 from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Hashtable  Save 100 as (Integer A) of 2 in BlockGrid_Hashtable_Grid[1]
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (Integer A)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = 2
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (Integer A) of 2 from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Hashtable  Save 102 as (Integer A) of 2 in BlockGrid_Hashtable_Grid[1]
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (Integer A)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = 2
 Else  Actions

If  Conditions

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

Loop  Actions
 Trigger  Run Test Loop <gen> (checking conditions)
Test Loop
 Events
 Conditions

Actions
  Loops through each saved 100 and 102 finding all nearby 0's and 2's then adding them to a new integer array 
  Every 2 thats hit increases waypoint total integer 
  3s are at the end of the maze, they tick the Block_Grid_Finish Boolean 
  This trigger reruns until all reachable 0s and 2s have been changed to 100s and 102s OR if waypoint total and boolean condition is met 

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

Loop  Actions
  Up 

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

If  Conditions
 (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1) Less than or equal to 72

Then  Actions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX1[(Integer A)] of (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1) from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedX1[(Integer A)]
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1)
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX1[(Integer A)] of (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1) from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedX1[(Integer A)]
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1)
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX1[(Integer A)] of (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1) from BlockGrid_Hashtable_Grid[1]) Equal to 3

Then  Actions
 Set BlockGrid_Boolean_Finish = True
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedX1[(Integer A)]
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedY1[(Integer A)] + 1)
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
  Down 

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

If  Conditions
 (BlockGrid_Int_OpenClosedY1[(Integer A)]  1) Greater than or equal to 1

Then  Actions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX1[(Integer A)] of (BlockGrid_Int_OpenClosedY1[(Integer A)]  1) from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedX1[(Integer A)]
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedY1[(Integer A)]  1)
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX1[(Integer A)] of (BlockGrid_Int_OpenClosedY1[(Integer A)]  1) from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedX1[(Integer A)]
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedY1[(Integer A)]  1)
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
  Left 

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

If  Conditions
 (BlockGrid_Int_OpenClosedX1[(Integer A)]  1) Greater than or equal to 1

Then  Actions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX1[(Integer A)]  1) of BlockGrid_Int_OpenClosedY1[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedX1[(Integer A)]  1)
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedY1[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX1[(Integer A)]  1) of BlockGrid_Int_OpenClosedY1[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedX1[(Integer A)]  1)
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedY1[(Integer A)]
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX1[(Integer A)]  1) of BlockGrid_Int_OpenClosedY1[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 3

Then  Actions
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedX1[(Integer A)]  1)
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedY1[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
  Right 

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

If  Conditions
 (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1) Less than or equal to 44

Then  Actions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1) of BlockGrid_Int_OpenClosedY1[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1)
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedY1[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1) of BlockGrid_Int_OpenClosedY1[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1)
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedY1[(Integer A)]
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1) of BlockGrid_Int_OpenClosedY1[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 3

Then  Actions
 Set BlockGrid_Int_OpenClosed2 = (BlockGrid_Int_OpenClosed2 + 1)
 Set BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] = (BlockGrid_Int_OpenClosedX1[(Integer A)] + 1)
 Set BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] = BlockGrid_Int_OpenClosedY1[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX2[BlockGrid_Int_OpenClosed2] of BlockGrid_Int_OpenClosedY2[BlockGrid_Int_OpenClosed2] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions

Loop  Actions
 Set BlockGrid_Int_OpenClosed1 = 0
  Contains a second loop to alternate between integers and integer arrays 

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

Loop  Actions
  Up 

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

If  Conditions
 (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1) Less than or equal to 72

Then  Actions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX2[(Integer A)] of (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1) from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedX2[(Integer A)]
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1)
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX2[(Integer A)] of (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1) from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedX2[(Integer A)]
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1)
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX2[(Integer A)] of (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1) from BlockGrid_Hashtable_Grid[1]) Equal to 3

Then  Actions
 Set BlockGrid_Boolean_Finish = True
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedX2[(Integer A)]
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedY2[(Integer A)] + 1)
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
  Down 

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

If  Conditions
 (BlockGrid_Int_OpenClosedY2[(Integer A)]  1) Greater than or equal to 1

Then  Actions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX2[(Integer A)] of (BlockGrid_Int_OpenClosedY2[(Integer A)]  1) from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedX2[(Integer A)]
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedY2[(Integer A)]  1)
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load BlockGrid_Int_OpenClosedX2[(Integer A)] of BlockGrid_Int_OpenClosedY2[((Integer A)  1)] from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedX2[(Integer A)]
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedY2[(Integer A)]  1)
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
  Left 

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

If  Conditions
 (BlockGrid_Int_OpenClosedX2[(Integer A)]  1) Greater than or equal to 1

Then  Actions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX2[(Integer A)]  1) of BlockGrid_Int_OpenClosedY2[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedX2[(Integer A)]  1)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedY2[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX2[(Integer A)]  1) of BlockGrid_Int_OpenClosedY2[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedX2[(Integer A)]  1)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedY2[(Integer A)]
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX2[(Integer A)]  1) of BlockGrid_Int_OpenClosedY2[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 3

Then  Actions
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedX2[(Integer A)]  1)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedY2[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
  Right 

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

If  Conditions
 (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1) Less than or equal to 44

Then  Actions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1) of BlockGrid_Int_OpenClosedY2[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 0

Then  Actions
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedY2[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1) of BlockGrid_Int_OpenClosedY2[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 2

Then  Actions
 Set BlockGrid_Int_WaypointTotal = (BlockGrid_Int_WaypointTotal + 1)
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedY2[(Integer A)]
 Hashtable  Save 102 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions
 (Load (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1) of BlockGrid_Int_OpenClosedY2[(Integer A)] from BlockGrid_Hashtable_Grid[1]) Equal to 3

Then  Actions
 Set BlockGrid_Int_OpenClosed1 = (BlockGrid_Int_OpenClosed1 + 1)
 Set BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] = (BlockGrid_Int_OpenClosedX2[(Integer A)] + 1)
 Set BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] = BlockGrid_Int_OpenClosedY2[(Integer A)]
 Hashtable  Save 100 as BlockGrid_Int_OpenClosedX1[BlockGrid_Int_OpenClosed1] of BlockGrid_Int_OpenClosedY1[BlockGrid_Int_OpenClosed1] in BlockGrid_Hashtable_Grid[1]
 Else  Actions

If  Conditions

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

If  Conditions

Loop  Actions
 Set BlockGrid_Int_OpenClosed2 = 0
 Game  Display to (All players) the text: yes

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

If  Conditions
 BlockGrid_Int_WaypointTotal Greater than or equal to (WaypointRockGenNumber + PortelGenInt)
 BlockGrid_Boolean_Finish Equal to True

Then  Actions
 Game  Display to (All players) the text: (Block Grid + (String(BlockGrid_Int_WaypointTotal)))
 Game  Display to (All players) the text: (Waypoints + (String(WaypointRockGenNumber)))
 Game  Display to (All players) the text: (Portals + (String(PortelGenInt)))
 Trigger  Run Initialization Grid Defaults <gen> (checking conditions)
 Skip remaining actions
 Else  Actions

If  Conditions

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

If  Conditions
 BlockGrid_Int_OpenClosed1 Equal to 0

Then  Actions
 Game  Display to (All players) the text: (Block Grid + (String(BlockGrid_Int_WaypointTotal)))
 Game  Display to (All players) the text: (Waypoints + (String(WaypointRockGenNumber)))
 Game  Display to (All players) the text: (Portals + (String(PortelGenInt)))
 Set TempPointSpell = (Position of BlockGrid_Unit_TempUnit)
 Set TempPlayerGroup = (Player group((Owner of BlockGrid_Unit_TempUnit)))
 Game  Display to TempPlayerGroup the text: (Blocking Tower Destroyed, + ((cFFFFCC00 + (String((Pointvalue of BlockGrid_Unit_TempUnit)))) + r gold refunded.))
 Unit  Remove BlockGrid_Unit_TempUnit from the game
 Special Effect  Create a special effect at TempPointSpell using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
 Special Effect  Set Scale of (Last created special effect) to 1.50
 Special Effect  Set Time Scale of (Last created special effect) to 0.70
 Special Effect  Destroy (Last created special effect)
 Sound  Play Error <gen> at 100.00% volume, located at TempPointSpell with Z offset 0.00
 Player  Add (Pointvalue of BlockGrid_Unit_TempUnit) to (Owner of BlockGrid_Unit_TempUnit) Current gold
 Hashtable  Save 0 as (Integer((BockGrid_Int_TempX + 1.00))) of (Integer((BockGrid_Int_TempY + 2.00))) in BlockGrid_Hashtable_Grid[1]
 Hashtable  Save 0 as (Integer((BockGrid_Int_TempX + 2.00))) of (Integer((BockGrid_Int_TempY + 2.00))) in BlockGrid_Hashtable_Grid[1]
 Hashtable  Save 0 as (Integer((BockGrid_Int_TempX + 1.00))) of (Integer((BockGrid_Int_TempY + 3.00))) in BlockGrid_Hashtable_Grid[1]
 Hashtable  Save 0 as (Integer((BockGrid_Int_TempX + 2.00))) of (Integer((BockGrid_Int_TempY + 3.00))) in BlockGrid_Hashtable_Grid[1]
 Custom script: call DestroyForce(udg_TempPlayerGroup)
 Custom script: call RemoveLocation(udg_TempPointSpell)
 Trigger  Run Initialization Grid Defaults <gen> (checking conditions)
 Skip remaining actions
 Game  Display to (All players) the text: (Block Grid + (String(BlockGrid_Int_WaypointTotal)))
 Game  Display to (All players) the text: (Waypoints + (String(WaypointRockGenNumber)))
 Game  Display to (All players) the text: (Portals + (String(PortelGenInt)))
 Trigger  Run Initialization Grid Defaults <gen> (checking conditions)

Else  Actions
 Trigger  Run (This trigger) (checking conditions)

If  Conditions