function Trig_Set_Snow_Terrain_Conditions takes nothing returns boolean
return TimerGetElapsed(udg_TimeGame) <= 60.00
endfunction
function Trig_Set_Snow_Terrain_Func008002002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit()) == 'n01L' or GetUnitTypeId(GetFilterUnit()) == 'n01M' or GetUnitTypeId(GetFilterUnit()) == 'n001' or GetUnitTypeId(GetFilterUnit()) == 'n01C' or GetUnitTypeId(GetFilterUnit()) == 'n01H')
endfunction
function Trig_Set_Snow_Terrain_Func009A takes nothing returns nothing
call ReplaceUnitBJ( GetEnumUnit(), 'n019', bj_UNIT_STATE_METHOD_RELATIVE )
endfunction
function Trig_Set_Snow_Terrain_Func011002002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit()) == 'n01K' or GetUnitTypeId(GetFilterUnit()) == 'n000' or GetUnitTypeId(GetFilterUnit()) == 'n01B' or GetUnitTypeId(GetFilterUnit()) == 'n01I' or GetUnitTypeId(GetFilterUnit()) == 'n01J')
endfunction
function Trig_Set_Snow_Terrain_Func012A takes nothing returns nothing
call ReplaceUnitBJ( GetEnumUnit(), 'n01A', bj_UNIT_STATE_METHOD_RELATIVE )
endfunction
function Trig_Set_Snow_Terrain_Actions takes nothing returns nothing
// Declaring ground types
set udg_TerraNoise = 'Isnw'
set udg_TerraNoise2 = 'Nsnr'
set udg_TerraPath = 'Idtr'
set udg_TerraRock = 'Nrck'
set udg_TerraSnow = 'Nsnw'
// Replacing trees
set udg_TempGroup = GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_PASSIVE), Condition(function Trig_Set_Snow_Terrain_Func008002002))
call ForGroup( udg_TempGroup, function Trig_Set_Snow_Terrain_Func009A )
call DestroyGroup(udg_TempGroup)
// Replacing rocks
set udg_TempGroup = GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_PASSIVE), Condition(function Trig_Set_Snow_Terrain_Func011002002))
call ForGroup( udg_TempGroup, function Trig_Set_Snow_Terrain_Func012A )
call DestroyGroup(udg_TempGroup)
set udg_TempPoint = Location(GetRectCenterX(gg_rct_TD_Map), GetRectCenterY(gg_rct_TD_Map))
call SetTerrainType(GetLocationX(udg_TempPoint), GetLocationY(udg_TempPoint), udg_TerraRock, -1, 80, 1 )
call SetTerrainType(GetLocationX(udg_TempPoint), GetLocationY(udg_TempPoint), udg_TerraSnow, -1, 17, 1 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 90
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = Location(GetLocationX(udg_TempPoint) + GetRandomReal(-2000.00, 2000.00), GetLocationY(udg_TempPoint) + GetRandomReal(-2000.00, 2000.00))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraNoise, -1, 1, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = Location(GetLocationX(udg_TempPoint) + GetRandomReal(-2000.00, 2000.00), GetLocationY(udg_TempPoint) + GetRandomReal(-2000.00, 2000.00))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraNoise2, -1, 1, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(GetRectCenterX(gg_rct_TerraFormat), GetRectCenterY(gg_rct_TerraFormat))
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 14
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = Location(GetLocationX(udg_TempPoint) + 10.00, GetLocationY(udg_TempPoint) + ( ( -300.00 * I2R(bj_forLoopAIndex) ) + 300.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraRock, -1, 3, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(GetRectCenterX(gg_rct_TD_Map), GetRectCenterY(gg_rct_TD_Map))
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = Location(GetLocationX(udg_TempPoint) + ( 200.00 + ( 200.00 * I2R(bj_forLoopAIndex) ) ), GetLocationY(udg_TempPoint) + 100.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = Location(GetLocationX(udg_TempPoint) + ( 200.00 + ( 200.00 * I2R(bj_forLoopAIndex) ) ), GetLocationY(udg_TempPoint) - 75.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 9
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, 400.00, ( ( 200.00 * I2R(bj_forLoopAIndex) ) - 100.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, 600.00, ( ( 200.00 * I2R(bj_forLoopAIndex) ) - 100.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, ( ( -300.00 * I2R(bj_forLoopAIndex) ) + 300.00 ), 1700.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, ( ( -300.00 * I2R(bj_forLoopAIndex) ) + 300.00 ), 1525.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -1500.00, ( ( -325.00 * I2R(bj_forLoopAIndex) ) + 2025.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -1425.00, ( ( -325.00 * I2R(bj_forLoopAIndex) ) + 2025.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -1500.00, 100.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -1425.00, 100.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 4
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, ( ( 300.00 * I2R(bj_forLoopAIndex) ) - 1800.00 ), 225.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, ( ( 300.00 * I2R(bj_forLoopAIndex) ) - 1800.00 ), 100.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -600.00, ( ( -300.00 * I2R(bj_forLoopAIndex) ) + 400.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -800.00, ( ( -300.00 * I2R(bj_forLoopAIndex) ) + 400.00 ))
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -600.00, -1300.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, -800.00, -1300.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, ( ( -300.00 * I2R(bj_forLoopAIndex) ) - 500.00 ), -1300.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set udg_TempPoint2 = OffsetLocation(udg_TempPoint, ( ( -300.00 * I2R(bj_forLoopAIndex) ) - 500.00 ), -1175.00)
call SetTerrainType(GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), udg_TerraPath, -1, 2, 1 )
call RemoveLocation(udg_TempPoint2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(udg_TempPoint)
call DestroyTrigger(gg_trg_Set_Forest_Terrain)
call DestroyTrigger(gg_trg_Set_Desert_Terrain)
call DestroyTrigger(gg_trg_Set_Lava_Terrain)
call DestroyTrigger(gg_trg_Set_City_Terrain)
call DestroyTrigger(gg_trg_Set_Snow_Terrain)
endfunction
function InitTrig_Set_Snow_Terrain takes nothing returns nothing
set gg_trg_Set_Snow_Terrain = CreateTrigger()
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Snow_Terrain, Player(0), "-snow", true )
call TriggerAddCondition( gg_trg_Set_Snow_Terrain, Condition( function Trig_Set_Snow_Terrain_Conditions ) )
call TriggerAddAction( gg_trg_Set_Snow_Terrain, function Trig_Set_Snow_Terrain_Actions )
endfunction