function Trig_mapGeneration takes nothing returns nothing
local real h = GetRectMinX(GetPlayableMapRect())+36
local real v = GetRectMinY(GetPlayableMapRect())+36
local location array bossplaces
local integer i = GetRandomInt(1,7)
local integer j = 0
local unit u
call DisplayTextToForce(GetForceOfPlayer(Player(0)), "Please Wait While Generating Dungeon"
loop
exitwhen v == GetRectMaxY(GetPlayableMapRect())
loop
exitwhen h == GetRectMaxX(GetPlayableMapRect())
call CreateUnitAtLoc(Player(7), 'h001', Location(h, v), GetRandomReal(0,360))
set h = h + 72
endloop
set v = v + 72
endloop
loop
exitwhen j>i
set bossplaces[j] = Location(GetRandomReal(GetRectMinX(GetPlayableMapRect()), GetRectMaxX(GetPlayableMapRect())), GetRandomReal(GetRectMinY(GetPlayableMapRect()), GetRectMaxY(GetPlayableMapRect()))'
set j = 1 + j
endloop
call MeleeClearNearbyUnits(GetLocationX(bossplaces[0]), GetLocationY(bossplaces[1]), 36)
set u = CreateUnitAtLoc(Player(7), 'h002', bossplaces[0], GetRandomReal(0, 360))
set j = 1
loop
exitwhen j>i
call IssuePointOrderLocBJ(u, "move", bossplaces[j])
set j = j + 1
endloop
endfunction
//===========================================================================
function InitTrig_mapGeneration takes nothing returns nothing
set gg_trg_mapGeneration = CreateTrigger( )
call TriggerAddAction( gg_trg_mapGeneration, function Trig_mapGeneration )
endfunction