```
library TerrainPathingHelper
// Note: I have no idea if my math is correct but it seems to work fine in the demo map!
// Used with Pathing Blocker (Air)
function TPH_Disable_Flying takes location p returns nothing
local location p2 = PolarProjectionBJ(p, 36.00, 135.00)
local real x = GetLocationX(p2)
local real y = GetLocationY(p2)
local real newX = x
local integer i = 0
local integer mod = 4
//local effect sfx
loop
set i = i + 1
exitwhen i > 16
// For debugging (enable local effect sfx):
//set sfx = AddSpecialEffect("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl", newX, y)
//call BlzSetSpecialEffectScale(sfx, 0.1)
call SetTerrainPathable(newX, y, PATHING_TYPE_FLYABILITY, false)
set newX = newX + 16.0
// Reset the x and lower the y at the end of a row
if ModuloInteger(i, mod) == 0 then
set y = y - 16.0
set newX = x
endif
endloop
// Clean up memory leaks
call RemoveLocation(p2)
set p2 = null
endfunction
// Used with Pathing Blocker (Large) (Air)
function TPH_Disable_Flying_Large takes location p returns nothing
local location p2 = PolarProjectionBJ(p, 80.00, 135.00)
local real x = GetLocationX(p2)
local real y = GetLocationY(p2)
local real newX = x
local integer i = 0
local integer mod = 8
//local effect sfx
loop
set i = i + 1
exitwhen i > 64
// For debugging (enable local effect sfx):
//set sfx = AddSpecialEffect("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl", newX, y)
//call BlzSetSpecialEffectScale(sfx, 0.1)
call SetTerrainPathable(newX, y, PATHING_TYPE_FLYABILITY, false)
set newX = newX + 16.0
// Reset the x and lower the y at the end of a row
if ModuloInteger(i, mod) == 0 then
set y = y - 16.0
set newX = x
endif
endloop
// Clean up memory leaks
call RemoveLocation(p2)
set p2 = null
endfunction
// Used with Pathing Blocker
function TPH_Disable_Walkability takes location p returns nothing
local location p2 = PolarProjectionBJ(p, 36.00, 135.00)
local real x = GetLocationX(p2)
local real y = GetLocationY(p2)
local real newX = x
local integer i = 0
local integer mod = 4
//local effect sfx
loop
set i = i + 1
exitwhen i > 16
// For debugging (enable local effect sfx):
//set sfx = AddSpecialEffect("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl", newX, y)
//call BlzSetSpecialEffectScale(sfx, 0.1)
call SetTerrainPathable(newX, y, PATHING_TYPE_WALKABILITY, false)
set newX = newX + 16.0
// Reset the x and lower the y at the end of a row
if ModuloInteger(i, mod) == 0 then
set y = y - 16.0
set newX = x
endif
endloop
// Clean up memory leaks
call RemoveLocation(p2)
set p2 = null
endfunction
// Used with Pathing Blocker (Large)
function TPH_Disable_Walkability_Large takes location p returns nothing
local location p2 = PolarProjectionBJ(p, 80.00, 135.00)
local real x = GetLocationX(p2)
local real y = GetLocationY(p2)
local real newX = x
local integer i = 0
local integer mod = 8
//local effect sfx
loop
set i = i + 1
exitwhen i > 64
// For debugging (enable local effect sfx):
//set sfx = AddSpecialEffect("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl", newX, y)
//call BlzSetSpecialEffectScale(sfx, 0.1)
call SetTerrainPathable(newX, y, PATHING_TYPE_WALKABILITY, false)
set newX = newX + 16.0
// Reset the x and lower the y at the end of a row
if ModuloInteger(i, mod) == 0 then
set y = y - 16.0
set newX = x
endif
endloop
// Clean up memory leaks
call RemoveLocation(p2)
set p2 = null
endfunction
endlibrary
```