1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. And she's bought a stairway to heaven. The 6th Special Effect Contest Results are here.
    Dismiss Notice
  3. Seek unity between the elements in the 22nd Terraining Contest Poll.
    Dismiss Notice
  4. Seize the moment! The 18th Mini Mapping Contest has commenced.
    Dismiss Notice
  5. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

DeadLab416-100b.w3x
Variables
Readme
Credits - Models
Credits - Icons etc
Initialization
Map Start
Variables Setup
Terrain Generator
Terrain Gen Init
Terrain Gen Barrels
Terrain Gen Rooms
Terrain Gen Walls
Terrain Gen Doodads Items
Terrain Gen Doors
Terrain Gen Printers Etc
Terrain Gen Store Rooms
Environment
Activate Cameras
Wreck Swarmed Entrance
Highlight Data Nodes
Game
Game Start
Spawn Marine
Game Timer
Level Increase
Bio Bounty
Door Blocking
Scrap Generator Built
Scrap Generator Get Scrap
Toxic Outside
Player Down
Revive Start
Revive Cancel
Revive Finish
Game Over
Spawn Scrap
Player Leave
Prevent Outside Scrap
Missions
Mission 1 Enter Base
Mission 2 Radar
Mission 3 Repair Radar
Mission 4 Data Node Start
Mission 4 Data Node Cancel
Mission 4 Data Node Loop
Mission 4 Data Node Fluff
Mission 5 Upload Data
Mission 6 Evac
Mission 6 Evac Get Player
Victory
Hero Abilities
Leap Spell
Throw Grenade Start
Throw Grenade Finish
Lose Grenade
Sentry Attack
Change Aiming
Items
Setup Bought Items
Buy Item Dummy
Stack Ammo Inventory
Interact Open Close Door
Crate Death
Pickup Scrap
Equip Weapon
Equip Equipment
Drop Ammo
Shield Front Block
Inventory Full Pickup
Inventory Full Loop
---------------------------
Supply Drop Check Location
Supply Drop Setup
Supply Drop Go
Supply Drop Remove
Supply Drop Right Click Smart
Zombies
Zombies Setup
Zombie Spawns
Spawn Horde
Zombie AI Dogs
Zombie AI Shamblers
Zombie AI Stay Inside
Zombie AI Enters House
Zombie AI Leave Entrance
Zombie AI No Leaving
Zombie AI Attack Attacker
Zombie Death
Zombie Abilities
Skeletal Marine Attack
Wight Explode Attack
Wight Explode Get
Bosses
level 10
Abomination Spawn
Abomination Spells Cast
Abomination Throw At Sentries
Abomination Throw Cleaver
Abomination Splatter
Abomination Death
level 20
Skeleton Spawn
Skeleton Attack
Skeleton Reload
Skeleton Death
Weapon Data
Weapon Setup
Sound Setup
Reload Setup
Destructible Types Setup
Unit Types Setup
Weapon System
Reload Start
Reload Loop
Reload Cancel
Reload Repeat Cancel
---------------------------
Fire Once
Full Auto
Weapon Loop
Full Auto Stop
Right Click Ground Stop Auto
Right Click Auto
---------------------------
Gun Hit
Grenade Hit
Rocket Hit
Flamer Hit
Weapon Sounds
Sound SMG
Sound Shotgun
Sound Rifle
Sound Assault Rifle
Sound Sentry
Sound Gatling
Sound Chainsaw
Sound Flamer
System
Damage Engine
Unit Indexer
Get New Unit
Projectile Loop
Movement Loop
Camera Shake System
Readme
CSS Config
CSS New Event
CSS New Player Shake
CSS Loop Shake
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.

		
Name Type Is Array Initial Value
AbominationCage destructable No
AccuracyAngle real No
angle real No
angle1 real No
BreakthroughRegionId integer No
BreakthroughRegions rect Yes
BuyItemActual itemcode Yes
BuyItemId integer No
BuyItemPowerup itemcode Yes
CHANCE_BENCH real No
CHANCE_CEILINGFAN real No
CHANCE_CHAIR real No
CHANCE_CRATES real No
CHANCE_LABBLUE real No
CHANCE_LABGREEN real No
CHANCE_LABLIGHTNING real No
CHANCE_LIGHT real No
CHANCE_SCRAP real No
CHANCE_SCREEN real No
CHANCE_SHELF real No
CHANCE_SHOTAMMO real No
CHANCE_SMGAMMO real No
check boolean No
checkeast boolean No
checknorth boolean No
checkrect120x30 rect No
checkrect30x120 rect No
checkregion128 rect No
checkregion260 rect No
checksouth boolean No
checkwest boolean No
chestEW boolean No
chestNS boolean No
ChopperSound sound No
continue boolean No
count integer No
countDoors integer No
countWall integer No
d1 real No
DamageBlockingAbility abilcode No
DamageEvent real No
DamageEventAmount real No
DamageEventExplodesUnit boolean No
DamageEventOverride boolean No
DamageEventPrevAmt real No
DamageEventSource unit No
DamageEventsWasted integer No
DamageEventTarget unit No
DamageEventTrigger trigger No
DamageEventType integer No
DamageModifierEvent real No
DamageTypeDOT integer No
DamageTypeRanged integer No
DamageTypeSpell integer No
DataNodeDownloadElapsed real No
DataNodeR real Yes
DataNodeRdelta real Yes
DataNodes group No
DataNodeStoryCounter integer No
DataNodeStoryTickEach real No
DIFFICULTY_SPAWNRATE integer No
DIFFICULTY_ZOMBIELIMIT integer No
DmgEvLife real No
DmgEvN integer No
DmgEvStack unit Yes
DmgEvTimer timer No
DmgTypPrev integer No
DOOR_SIZE real No
DoorAngle real Yes
DoorDoorHp real Yes
DoorId integer No
DoorRegion rect Yes
doors integer No
DoorTree destructable Yes
DoorWallHp real Yes
DROP_AMMOSHELLS real No
DROP_AMMOSMG real No
DROP_BARRICADE real No
DROP_CCTV real No
DROP_GRENADES real No
DROP_MEDIKIT real No
DROP_SCRAP real No
DUMMY unitcode No
EvacTimer timer No
EvacuatedPlayers force No
force1 force No
GameTimeMinutes integer No
GameTimeSeconds integer No
GetLocalPlayer player No
GRAVITY real No
GRENADE_AOE real No
GRENADE_DAMAGE real No
GRENADE_KNOCKBACK real No
group1 group No
height1 real No
height2 real No
heightcheck real No
heightd real No
heli unit No
HouseRegion rect No
id integer No
item item No
itemTransfer item Yes
kill boolean No
knockback real No
Level integer No
loc1 location No
loc2 location No
loc3 location No
loc4 location No
locEast location No
locNorth location No
locSouth location No
locWest location No
loop1 integervar No
loop2 integervar No
loopa integer No
loopb integer No
loopc integer No
loopd integer No
loope integer No
MaxCrates integer No
mordor boolean No
MoveDdz real Yes
MoveDx real Yes
MoveDy real Yes
MoveDz real Yes
MoveGroup group No
MoveTestLoc location Yes
MoveTestVelocity real Yes
NodesAmount integer No
NodesDone integer No
pid integer No
pitch real No
pitchid integer No
PlayerAutoOn boolean Yes
PlayerAutoTargetPoint location Yes
PlayerAutoTargetUnit unit Yes
PlayerAutoType integer Yes
PlayerDownloading boolean Yes
PlayerFullInventoryItem item Yes
PlayerGrenadeTarget location Yes
PlayerHeightTargeting real Yes
PlayerHero unit Yes
PlayerHeroesAlive group No
PlayerHeroesEvac group No
PlayerImmune boolean Yes
PlayerNodeTarget unit Yes
PlayerRepeatReload boolean Yes
PlayerReviverBar unit Yes
PlayerReviveTarget unit Yes
Players force No
PlayerSupply unit Yes
PlayerWeaponCooldown real Yes
PlayerWeaponEquipedType itemcode Yes
PlayerWeaponEquippedSFX effect Yes
PlayerWeaponId integer Yes
PlayerWeaponSoundTick integer Yes
Projectile_damage real Yes
Projectile_dx real Yes
Projectile_dy real Yes
Projectile_dz real Yes
Projectile_id integer No
Projectile_knockback real Yes
Projectile_Level integer Yes
Projectile_OnGroundHit boolean Yes
Projectile_OnUnitHit boolean Yes
Projectile_sfx effect Yes
Projectile_Size real Yes
Projectile_ticks integer Yes
Projectile_type integer Yes
Projectile_unit unit Yes
ProjectileType_damage real Yes
ProjectileType_id integer No
ProjectileType_knockback real Yes
ProjectileType_trigger trigger Yes
r real No
RCSS_AddedShakiness real No
RCSS_EventLocation location No
RCSS_EventMagnitude real No
RCSS_EventMaxRange real No
RCSS_EventPlayer player No
RCSS_LoopPeriod real No
RCSS_MagnitudeReduceFlat real No
RCSS_MagnitudeReducePercent real No
RCSS_PlayerCameraLocation location No
RCSS_PlayerCurrentShake real Yes
RCSS_ShakingPlayers force No
RCSS_StopShakeThreshold real No
RCSS_tempDistance real No
RCSS_tempId integer No
RCSS_tempPlayer player No
RCSS_tempX real No
RCSS_tempY real No
RLD_AmmoGiven real Yes
RLD_id integer No
RLD_ItemAmmo itemcode Yes
RLD_ItemWeapon itemcode Yes
RLD_PlayerTicks integer Yes
RLD_PlayerTicksDone integer Yes
RLD_Ticks integer Yes
ROCKET_AOE real No
ROCKET_DAMAGE real No
ROCKET_KNOCKBACK real No
SkeletonBlinkCooldown timer No
SkeletonCage destructable No
SoundAssaultRifle sound Yes
SoundAssaultRifleCurrent integer No
SoundAssaultRifleId integer No
SoundChain sound Yes
SoundChainCurrent integer No
SoundChainId integer No
SoundFlamer sound Yes
SoundFlamerCurrent integer No
SoundFlamerId integer No
SoundGatling sound Yes
SoundGatlingCurrent integer No
SoundGatlingId integer No
SoundRifle sound Yes
SoundRifleCurrent integer No
SoundRifleId integer No
SoundSentry sound Yes
SoundSentryCurrent integer No
SoundSentryId integer No
SoundShotgun sound Yes
SoundShotgunCurrent integer No
SoundShotgunId integer No
SoundSMG sound Yes
SoundSMGCurrent integer No
SoundSMGId integer No
SpareParts itemcode No
SpawnedCrates integer No
speed real No
SupplyAbility abilcode Yes
SupplyId integer No
SupplyItem itemcode Yes
tempstring string No
TempUnit unit No
TG_BlockCurrentX integer No
TG_BlockCurrentY integer No
TG_BlockEndX integer No
TG_BlockEndY integer No
TG_BlockStartX integer No
TG_BlockStartY integer No
TG_CellCurrentX integer No
TG_CellCurrentY integer No
TG_CellEndX integer No
TG_CellEndY integer No
TG_CellStartX integer No
TG_CellStartY integer No
TG_DoorsUG group No
TG_FillEndX integer No
TG_FillEndY integer No
TG_FillStartX integer No
TG_FillStartY integer No
TG_RoomSizeX integer No
TG_RoomSizeY integer No
TG_SetChanceBigRoom real No
TG_SetChanceCorridor real No
TG_TypeSelect real No
ticks real No
transferInteger integer Yes
tree destructable No
tsFacing real No
tsSource real No
u unit No
UDex integer No
UDexGen integer No
UDexNext integer Yes
UDexPrev integer Yes
UDexRecycle integer No
UDexUnits unit Yes
UDexWasted integer No
uid integer No
UnitDamageRegistered boolean Yes
UnitIndexerEnabled boolean No
UnitIndexEvent real No
UnitTypeHeight real Yes
UnitTypeId integer No
UnitTypeUnit unitcode Yes
upicked unit No
utarget unit No
WALL_SCALE real No
WallType_DistanceSq real Yes
WallType_HeightEnd real Yes
WallType_HeightStart real Yes
WallType_id integer No
WallType_Type destructablecode Yes
WPN_Accuracy real Yes
WPN_AttachmentString string Yes
WPN_AutoType integer Yes
WPN_ClipSize integer Yes
WPN_Cooldown real Yes
WPN_Damage real Yes
WPN_id integer No
WPN_Item itemcode Yes
WPN_Knockback real Yes
WPN_picked integer No
WPN_SFX string Yes
WPN_SFXSize real Yes
WPN_Shots integer Yes
WPN_SoundTicks integer Yes
WPN_SoundTrigger trigger Yes
WPN_Speed real Yes
x1 real No
y1 real No
ZombieAI_Dogs group No
ZombieAI_Shamblers group No
ZombieAI_Walkers group No
ZombieGroup group No
ZombieId integer No
ZombieSpawnTimer timer No
ZombieType unitcode Yes
ZSpawnRegionId integer No
ZSpawnRegions rect Yes
Effects Models:
Bullet projectile by Epsilon
First aid by Em!
Rocket by WILL THE ALMIGHTY
Health bars by JesusHipster
Target confirmation by HappyTauren
Corpse explosion by vile

Unit Models:
Zombified Villager by The Weird Human
Zombie Dog by epsilon
Space Skeleton -Peper-
Supply Depot by killst4r
Marine by Talon the Mage
Diseased One by -Grendel
Mining Unit by Ket
Sentry gun by Domokun
Abomination Hero by SuPa-
Space skeleton hero by Ham Ham
Data server by Fingolfin
Heli by Kofi_Banan
Wight by Just_Spectating
Crawler (porcupine) by Kitabateke

Doodad Models:
Street light by JB_McKnight
Walls by Misha
Metal Fence by Teaspoon
Door by ikillforeyou
Crate by Deolin
Radio Tower by Ket
Computer by The Silent
Cage/headquarters by Ket
Laboratory models by Scythy Dervish
Chair by Systemfre1
Ceiling fan by Ribenamania
Screen table by Goldwolf
Bench by Teaspoon
Shelf by Goldwolf
Military base doodads by Strogg (xgm.ru)

Item Models:
Medkit by HappyTauren
Scrap metal by Ergius
Riot shield by Tr!KzZ
Chainsaw by Anvil & Uncle Fester
Rocket Launcher by Champara Bros
All other weapons by Frankster
Syringe by epsilon
Sounds:
Weapon sounds downloaded from soundbible.com and freesfx.co.uk, recorded by:
snottyboi, Mike Koenig, GoodSoundForYou, gustavocaf, parkerson, blastwavefx, 12345-6, mckinneysound, JFBSAUVE, ERH, danielnieto7, qubodup, gr8sfx
(all are either freeware or attribution)

Icons:
Reload by Zombie
Target by ChirusHighwind
Door by Darkfang
Marine by NFWar
Minigun ammo by Zombie
Armour by The Silent
Chainsaw by Uncle Fester
Fuel/battery by The Silent
Medkit by HappyTauren
Shotgun shell by graystuff111
SMG round by Huinipachutli
Rifle round by AlienArsonist
Grenade by ANdROnIQ
Bio by oh_snap
Metal by The_Silent
Medkit by HappyTauren
Syringe by The_Silent
Head shot by SexYFrostWyrM

Skins:
Road by MassiveMaster
Metal tile by Punisher_x
Concrete tile by Punisher_x

Code:
Unit Indexer and Damage Enginer by Bribe

User Interface by modafoka

Loadscreen from http://gdrtales.com/2012/03/15/zombie-starcraft/

Testing:
UnholyAngel
Map Start
  Events
    Map initialization
  Conditions
  Actions
    Unit - Remove Marine 0012 <gen> from the game
    Unit - Remove Marine 0013 <gen> from the game
    Quest - Create a Required quest titled Hints with the description - Watch your ammo! Buy more from a 3D printer whenever you are able, and don't kill zombies if you don't need to.- Close doors to delay a horde behind you and give you time to reload.- Build barricades. Zombies destroy barricades first, so drop a barricade if you need to delay the horde.- Don't stay outside too long. The air is toxic and will kill you if you stay too long.- Avoid entering rooms with only one exit. If the horde follows you and you have no grenades, you'll have no way to escape death. Walls are destructible, so if you happen to find yourself in this situation but have enough ammo, your best bet might be to clear a new path by blasting through the wall.- Keep moving. Zombies follow the sound of gunfire, so defending one spot too long will ensure that the entire horde will come to you.- Scrap Generators are a great investment. Hide it in a small room far away from where you're fighting. If you're lucky, the horde won't find it.- Don't forget to replace your starting weapon with something better as soon as you can., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
    Quest - Create a Optional quest titled Credits - Models Part 1 with the description Effects Models:Bullet projectile by EpsilonFirst aid by Em!Rocket by WILL THE ALMIGHTYHealth bars by JesusHipsterTarget confirmation by HappyTaurenCorpse explosion by vileUnit Models:Zombified Villager by The Weird HumanZombie Dog by epsilonSpace Skeleton -Peper-Supply Depot by killst4rMarine by Talon the MageDiseased One by -GrendelMining Unit by KetSentry gun by DomokunAbomination Hero by SuPa-Space skeleton hero by Ham HamData server by FingolfinHeli by Kofi_BananWight by Just_SpectatingCrawler (porcupine) by Kitabateke, using icon path ReplaceableTextures\CommandButtons\BTNSnazzyScrollPurple.blp
    Quest - Create a Optional quest titled Credits - Models Part 2 with the description Doodad Models:Street light by JB_McKnightWalls by MishaMetal Fence by TeaspoonDoor by ikillforeyouCrate by DeolinRadio Tower by KetComputer by The SilentCage/headquarters by KetLaboratory models by Scythy DervishChair by Systemfre1Ceiling fan by RibenamaniaScreen table by GoldwolfBench by TeaspoonShelf by GoldwolfMilitary base doodads by Strogg (xgm.ru)Item Models:Medkit by HappyTaurenScrap metal by ErgiusRiot shield by Tr!KzZChainsaw by Anvil & Uncle FesterRocket Launcher by Champara BrosAll other weapons by FranksterSyringe by epsilon, using icon path ReplaceableTextures\CommandButtons\BTNScrollOfTownPortal.blp
    Quest - Create a Optional quest titled Credits - Icons with the description Icons:Reload by ZombieTarget by ChirusHighwindDoor by DarkfangMarine by NFWarMinigun ammo by ZombieArmour by The SilentChainsaw by Uncle FesterFuel/battery by The SilentMedkit by HappyTaurenShotgun shell by graystuff111SMG round by HuinipachutliRifle round by AlienArsonistGrenade by ANdROnIQBio by oh_snapMetal by The_SilentMedkit by HappyTaurenSyringe by The_SilentHead shot by SexYFrostWyrM, using icon path ReplaceableTextures\CommandButtons\BTNScrollOfProtection.blp
    Quest - Create a Optional quest titled Credits - Misc with the description Sounds:Weapon sounds downloaded from soundbible.com and freesfx.co.uk, recorded by:snottyboi, Mike Koenig, GoodSoundForYou, gustavocaf, parkerson, blastwavefx, 12345-6, mckinneysound, JFBSAUVE, ERH, danielnieto7, qubodup, gr8sfx(all are either freeware or attribution)Skins:Road by MassiveMasterMetal tile by Punisher_xConcrete tile by Punisher_xCode:Unit Indexer and Damage Enginer by BribeUser Interface by modafokaLoadscreen from http://gdrtales.com/2012/03/15/zombie-starcraft/Testing:UnholyAngel, using icon path ReplaceableTextures\CommandButtons\BTNScroll.blp
    Game - Disable pre-selection functionality (Disable pre-selection circles, life bars, and object info)
    Game - Set the time of day to 0.00
    Game - Turn the day/night cycle Off
    Custom script: call SetDayNightModels("","")
    For each (Integer loopa) from 1 to 8, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player(loopa)) controller) Equal to User
            ((Player(loopa)) slot status) Equal to Is playing
          Then - Actions
            Player Group - Add (Player(loopa)) to Players
            Set VariableSet PlayerHeightTargeting[loopa] = 0.75
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Players) Equal to 1
      Then - Actions
        Player Group - Pick every player in Players and do (Actions)
          Loop - Actions
            Player - Set (Picked player) handicap to 150.00%
      Else - Actions
    Player - Set Player 9 (Gray) handicap to (60.00 + (5.00 x (Real((Number of players in Players)))))%
    Player - Set Player 10 (Light Blue) handicap to (60.00 + (5.00 x (Real((Number of players in Players)))))%
    Player - Set Player 11 (Dark Green) handicap to (60.00 + (5.00 x (Real((Number of players in Players)))))%
    Player - Set Player 12 (Brown) handicap to (60.00 + (5.00 x (Real((Number of players in Players)))))%
    Set VariableSet DIFFICULTY_SPAWNRATE = (5 + ((Number of players in Players) x 3))
    Countdown Timer - Start ZombieSpawnTimer as a Repeating timer that will expire in (60.00 / (Real(DIFFICULTY_SPAWNRATE))) seconds
    Set VariableSet DIFFICULTY_ZOMBIELIMIT = (20 + ((Number of players in Players) x 35))
    AI - Ignore the guard positions of all Player 9 (Gray) units
    AI - Ignore the guard positions of all Player 10 (Light Blue) units
    AI - Ignore the guard positions of all Player 11 (Dark Green) units
    AI - Ignore the guard positions of all Player 12 (Brown) units
    Set VariableSet NodesAmount = (3 + ((Number of players in Players) / 2))
    Set VariableSet MaxCrates = (20 + (10 x (Number of players in Players)))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Players) Equal to 1
      Then - Actions
        Trigger - Add to Zombie_AI_Enters_House <gen> the event (A unit enters House1 <gen>)
        Set VariableSet HouseRegion = House1 <gen>
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Number of players in Players) Equal to 2
            (Number of players in Players) Equal to 3
      Then - Actions
        Trigger - Add to Zombie_AI_Enters_House <gen> the event (A unit enters House23 <gen>)
        Set VariableSet HouseRegion = House23 <gen>
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Number of players in Players) Equal to 4
            (Number of players in Players) Equal to 5
      Then - Actions
        Trigger - Add to Zombie_AI_Enters_House <gen> the event (A unit enters House45 <gen>)
        Set VariableSet HouseRegion = House45 <gen>
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Number of players in Players) Equal to 6
            (Number of players in Players) Equal to 7
      Then - Actions
        Trigger - Add to Zombie_AI_Enters_House <gen> the event (A unit enters House67 <gen>)
        Set VariableSet HouseRegion = House67 <gen>
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Players) Equal to 8
      Then - Actions
        Trigger - Add to Zombie_AI_Enters_House <gen> the event (A unit enters House8 <gen>)
        Set VariableSet HouseRegion = House8 <gen>
      Else - Actions
    Animation - Play the hide (animationname) animation for all doodads of type LOth (doodadcode) within HouseRegion.
    Set VariableSet ZSpawnRegions[1] = ZSpawnEast <gen>
    Set VariableSet ZSpawnRegionId = 1
    Trigger - Run Terrain_Gen_Init <gen> (ignoring conditions)
Variables Setup
  Events
    Map initialization
  Conditions
  Actions
    Set VariableSet DUMMY = Projectile
    Set VariableSet GRAVITY = 0.50
    -------- ------------ --------
    Set VariableSet GRENADE_AOE = 300.00
    Set VariableSet GRENADE_DAMAGE = 100.00
    Set VariableSet GRENADE_KNOCKBACK = 15.00
    -------- ------------ --------
    Set VariableSet ROCKET_AOE = 250.00
    Set VariableSet ROCKET_DAMAGE = 200.00
    Set VariableSet ROCKET_KNOCKBACK = 20.00
    -------- ------------ --------
    Set VariableSet CHANCE_CRATES = 2.00
    Set VariableSet CHANCE_LABGREEN = 0.25
    Set VariableSet CHANCE_LABBLUE = 0.50
    Set VariableSet CHANCE_LABLIGHTNING = 0.75
    Set VariableSet CHANCE_CHAIR = 2.00
    Set VariableSet CHANCE_BENCH = 1.50
    Set VariableSet CHANCE_SHELF = 2.50
    Set VariableSet CHANCE_SCREEN = 1.00
    Set VariableSet CHANCE_LIGHT = 10.00
    Set VariableSet CHANCE_CEILINGFAN = 2.00
    Set VariableSet CHANCE_SCRAP = 0.00
    Set VariableSet CHANCE_SMGAMMO = 0.00
    Set VariableSet CHANCE_SHOTAMMO = 0.00
    -------- ------------ --------
    Set VariableSet DROP_MEDIKIT = 30.00
    Set VariableSet DROP_AMMOSMG = 15.00
    Set VariableSet DROP_AMMOSHELLS = 5.00
    Set VariableSet DROP_BARRICADE = 20.00
    Set VariableSet DROP_GRENADES = 10.00
    Set VariableSet DROP_SCRAP = 35.00
    Set VariableSet DROP_CCTV = 0.00
    -------- ------------ --------
    Set VariableSet DOOR_SIZE = 1.00
    Set VariableSet WALL_SCALE = 0.91
    -------- ------------ --------
    Set VariableSet loc1 = (Center of (Playable map area))
    Set VariableSet checkregion128 = (Region centered at loc1 with size (128.00, 128.00))
    Set VariableSet checkrect120x30 = (Region centered at loc1 with size (160.00, 64.00))
    Set VariableSet checkrect30x120 = (Region centered at loc1 with size (64.00, 160.00))
    Custom script: call RemoveLocation(udg_loc1)
    -------- ------------ --------
    Set VariableSet BreakthroughRegions[1] = Horde1 <gen>
    Set VariableSet BreakthroughRegions[2] = Horde2 <gen>
    Set VariableSet BreakthroughRegions[3] = Horde3 <gen>
    Set VariableSet BreakthroughRegions[4] = Horde4 <gen>
    Set VariableSet BreakthroughRegions[5] = Horde5 <gen>
    Set VariableSet BreakthroughRegions[6] = Horde6 <gen>
    Set VariableSet BreakthroughRegions[7] = Horde7 <gen>
    Set VariableSet BreakthroughRegions[8] = Horde8 <gen>
    Set VariableSet BreakthroughRegions[9] = Horde9 <gen>
    Set VariableSet BreakthroughRegions[10] = Horde10 <gen>
    Set VariableSet BreakthroughRegions[11] = Horde11 <gen>
    Set VariableSet BreakthroughRegions[12] = Horde12 <gen>
    Set VariableSet BreakthroughRegionId = 12
-9
-10
8
8
Terrain Gen Init
  Events
  Conditions
  Actions
    Trigger - Run Terrain_Gen_Barrels <gen> (ignoring conditions)
    -------- build entrance --------
    Set VariableSet TG_SetChanceBigRoom = 30.00
    Set VariableSet TG_SetChanceCorridor = 50.00
    Set VariableSet TG_BlockStartX = 9
    Set VariableSet TG_BlockStartY = -2
    Set VariableSet TG_BlockEndX = 11
    Set VariableSet TG_BlockEndY = 2
    Set VariableSet TG_BlockCurrentX = TG_BlockStartX
    Set VariableSet TG_BlockCurrentY = TG_BlockStartY
    Set VariableSet TG_CellStartX = ((TG_BlockStartX x 3) - 2)
    Set VariableSet TG_CellStartY = ((TG_BlockStartY x 3) - 2)
    Set VariableSet TG_CellEndX = ((TG_BlockEndX x 3) + 1)
    Set VariableSet TG_CellEndY = ((TG_BlockEndY x 3) + 1)
    Set VariableSet TG_CellCurrentX = TG_CellStartX
    Set VariableSet TG_CellCurrentY = TG_CellStartY
    For each (Integer loopa) from TG_CellStartX to TG_CellEndX, do (Actions)
      Loop - Actions
        For each (Integer loopb) from TG_CellStartY to TG_CellEndY, do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Point(((Real(loopa)) x 128.00), ((Real(loopb)) x 128.00)))
            Environment - Change terrain type at loc1 to Underground - Square Tiles using variation -1 in an area of size 1 and shape Square
            Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet continue = False
    Set VariableSet mordor = True
    Trigger - Turn on Terrain_Gen_Rooms <gen>
    Wait until (continue Equal to True), checking every 0.25 seconds
    Game - Display to (All players) the text: Generating Map - Please wait
    Set VariableSet continue = False
    Trigger - Turn on Terrain_Gen_Walls <gen>
    Wait until (continue Equal to True), checking every 0.25 seconds
    -------- mordor --------
    For each (Integer loopc) from 1 to 4, do (Actions)
      Loop - Actions
        Set VariableSet loc2 = (Point(((Real(TG_CellEndX)) x 128.00), ((Real((Random integer number between TG_CellStartY and TG_CellEndY))) x 128.00)))
        Unit - Create 1.DUMMY for Neutral Passive at loc2 facing Default building facing degrees
        Set VariableSet u = (Last created unit)
        Custom script: call SetUnitX(udg_u, GetLocationX(udg_loc2))
        Custom script: call SetUnitY(udg_u, GetLocationY(udg_loc2))
        Unit Group - Add (Last created unit) to TG_DoorsUG
        Custom script: call RemoveLocation(udg_loc2)
    For each (Integer loopc) from 1 to 3, do (Actions)
      Loop - Actions
        Set VariableSet loc2 = (Point(((Real(TG_CellStartX)) x 128.00), ((Real((Random integer number between TG_CellStartY and TG_CellEndY))) x 128.00)))
        Unit - Create 1.DUMMY for Neutral Passive at loc2 facing Default building facing degrees
        Set VariableSet u = (Last created unit)
        Custom script: call SetUnitX(udg_u, GetLocationX(udg_loc2))
        Custom script: call SetUnitY(udg_u, GetLocationY(udg_loc2))
        Unit Group - Add (Last created unit) to TG_DoorsUG
        Custom script: call RemoveLocation(udg_loc2)
    Trigger - Run Terrain_Gen_Doors <gen> (ignoring conditions)
    For each (Integer loopa) from TG_CellStartX to TG_CellEndX, do (Actions)
      Loop - Actions
        For each (Integer loopb) from TG_CellStartY to TG_CellEndY, do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Point(((Real(loopa)) x 128.00), ((Real(loopb)) x 128.00)))
            Environment - Change terrain type at loc1 to Underground - Brick using variation (Random integer number between 10 and 17) in an area of size 1 and shape Square
            Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet mordor = False
    -------- build main house --------
    Set VariableSet TG_SetChanceBigRoom = 20.00
    Set VariableSet TG_SetChanceCorridor = 35.00
    Set VariableSet TG_BlockStartX = (-5 - ((Number of players in Players) / 2))
    Set VariableSet TG_BlockStartY = (-6 - ((Number of players in Players) / 2))
    Set VariableSet TG_BlockEndX = (3 + ((Number of players in Players) / 2))
    Set VariableSet TG_BlockEndY = (4 + ((Number of players in Players) / 2))
    Set VariableSet TG_BlockCurrentX = TG_BlockStartX
    Set VariableSet TG_BlockCurrentY = TG_BlockStartY
    Set VariableSet TG_CellStartX = ((TG_BlockStartX x 3) - 2)
    Set VariableSet TG_CellStartY = ((TG_BlockStartY x 3) - 2)
    Set VariableSet TG_CellEndX = ((TG_BlockEndX x 3) + 1)
    Set VariableSet TG_CellEndY = ((TG_BlockEndY x 3) + 1)
    Set VariableSet TG_CellCurrentX = TG_CellStartX
    Set VariableSet TG_CellCurrentY = TG_CellStartY
    For each (Integer loopa) from TG_CellStartX to TG_CellEndX, do (Actions)
      Loop - Actions
        For each (Integer loopb) from TG_CellStartY to TG_CellEndY, do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Point(((Real(loopa)) x 128.00), ((Real(loopb)) x 128.00)))
            Environment - Change terrain type at loc1 to Underground - Square Tiles using variation -1 in an area of size 1 and shape Square
            Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet continue = False
    Trigger - Turn on Terrain_Gen_Rooms <gen>
    Wait until (continue Equal to True), checking every 0.25 seconds
    Set VariableSet continue = False
    Trigger - Turn on Terrain_Gen_Walls <gen>
    Wait until (continue Equal to True), checking every 0.25 seconds
    Trigger - Run Terrain_Gen_Doors <gen> (ignoring conditions)
    Trigger - Run Terrain_Gen_Store_Rooms <gen> (ignoring conditions)
    Trigger - Run Terrain_Gen_Printers_Etc <gen> (ignoring conditions)
    For each (Integer loopa) from TG_CellStartX to TG_CellEndX, do (Actions)
      Loop - Actions
        For each (Integer loopb) from TG_CellStartY to TG_CellEndY, do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Point(((Real(loopa)) x 128.00), ((Real(loopb)) x 128.00)))
            Environment - Change terrain type at loc1 to Underground - Brick using variation (Random integer number between 10 and 17) in an area of size 1 and shape Square
            Custom script: call RemoveLocation(udg_loc1)
    For each (Integer loopa) from 1 to (8 + ((Number of players in Players) x 4)), do (Actions)
      Loop - Actions
        Set VariableSet loc1 = (Random point in HouseRegion)
        Unit - Create 1.Walker for Player 12 (Brown) at loc1 facing Default building facing degrees
        Unit Group - Add (Last created unit) to ZombieAI_Walkers
        Unit - Add Wander (Neutral) to (Last created unit)
        Trigger - Add to Mission_1_Enter_Base <gen> the event ((Last created unit) Acquires a target)
        Custom script: call RemoveLocation(udg_loc1)
    For each (Integer loopa) from 1 to NodesAmount, do (Actions)
      Loop - Actions
        Set VariableSet loc1 = (Point(((Real((Random integer number between (TG_BlockStartX + 1) and (TG_BlockEndX - 1)))) x 384.00), ((Real((Random integer number between (TG_BlockStartY + 1) and (TG_BlockEndY - 1)))) x 384.00)))
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -128.00 and 0.00), (Random real number between -128.00 and 0.00)))
        Destructible - Pick every destructible within 40.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Unit - Create 1.Data Node for Neutral Passive at loc2 facing Default building facing degrees
        Unit Group - Add (Last created unit) to DataNodes
        Custom script: call RemoveLocation(udg_loc2)
        Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet DataNodeStoryTickEach = (30.00 x (Real((Number of units in DataNodes))))
    Set VariableSet DataNodeStoryTickEach = (DataNodeStoryTickEach / 4.01)
    Trigger - Run Game_Start <gen> (ignoring conditions)
Terrain Gen Barrels
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels01 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels02 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels03 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels04 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels05 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels06 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to 60.00
      Then - Actions
        For each (Integer loopa) from 1 to (Random integer number between 5 and 12), do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Random point in Barrels07 <gen>)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to 33.00
              Then - Actions
                Destructible - Create a B00G (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Less than or equal to 50.00
                  Then - Actions
                    Destructible - Create a B00H (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
                  Else - Actions
                    Destructible - Create a B00I (destructablecode) at loc1 facing (Random angle) with scale (Random real number between 1.00 and 1.05) and variation 0
            Custom script: call RemoveLocation(udg_loc1)
      Else - Actions
    Destructible - Pick every destructible in HouseRegion and do (Actions)
      Loop - Actions
        Destructible - Remove (Picked destructible)
Terrain Gen Rooms
  Events
    Time - Every 0.01 seconds of game time
  Conditions
    continue Equal to False
  Actions
    Set VariableSet loc1 = (Point(((Real(TG_BlockCurrentX)) x 384.00), ((Real(TG_BlockCurrentY)) x 384.00)))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Terrain type at loc1) Equal to Underground - Square Tiles
      Then - Actions
        -------- Room Type Selection --------
        Set VariableSet TG_TypeSelect = (Random percentage)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            TG_TypeSelect Greater than or equal to (100.00 - TG_SetChanceBigRoom)
          Then - Actions
            -------- Large Room --------
            Set VariableSet TG_RoomSizeX = (Random integer number between 2 and 4)
            Set VariableSet TG_RoomSizeY = (Random integer number between 2 and 4)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                TG_RoomSizeX Greater than (TG_BlockEndX - TG_BlockCurrentX)
              Then - Actions
                Set VariableSet TG_RoomSizeX = (TG_BlockEndX - TG_BlockCurrentX)
                Set VariableSet TG_RoomSizeX = (TG_RoomSizeX + 1)
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                TG_RoomSizeY Greater than (TG_BlockEndY - TG_BlockCurrentY)
              Then - Actions
                Set VariableSet TG_RoomSizeY = (TG_BlockEndY - TG_BlockCurrentY)
                Set VariableSet TG_RoomSizeY = (TG_RoomSizeY + 1)
              Else - Actions
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                TG_TypeSelect Less than or equal to TG_SetChanceCorridor
              Then - Actions
                -------- Corridor --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Greater than or equal to 50.00
                  Then - Actions
                    -------- Horizontal Corridor --------
                    Set VariableSet TG_RoomSizeX = (Random integer number between 2 and 4)
                    Set VariableSet TG_RoomSizeY = 1
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        TG_RoomSizeX Greater than (TG_BlockEndX - TG_BlockCurrentX)
                      Then - Actions
                        Set VariableSet TG_RoomSizeX = (TG_BlockEndX - TG_BlockCurrentX)
                        Set VariableSet TG_RoomSizeX = (TG_RoomSizeX + 1)
                      Else - Actions
                  Else - Actions
                    -------- Vertical Corridor --------
                    Set VariableSet TG_RoomSizeX = 1
                    Set VariableSet TG_RoomSizeY = (Random integer number between 2 and 4)
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        TG_RoomSizeY Greater than (TG_BlockEndY - TG_BlockCurrentY)
                      Then - Actions
                        Set VariableSet TG_RoomSizeY = (TG_BlockEndY - TG_BlockCurrentY)
                        Set VariableSet TG_RoomSizeY = (TG_RoomSizeY + 1)
                      Else - Actions
              Else - Actions
                -------- Small Room --------
                Set VariableSet TG_RoomSizeX = 1
                Set VariableSet TG_RoomSizeY = 1
        -------- Determine room extents --------
        Set VariableSet TG_FillStartX = ((TG_BlockCurrentX x 3) - 1)
        Set VariableSet TG_FillStartY = ((TG_BlockCurrentY x 3) - 1)
        Set VariableSet TG_FillEndX = ((TG_BlockCurrentX x 3) + ((TG_RoomSizeX x 3) - 3))
        Set VariableSet TG_FillEndY = ((TG_BlockCurrentY x 3) + ((TG_RoomSizeY x 3) - 3))
        -------- Fill room terrain --------
        For each (Integer loopa) from TG_FillStartX to TG_FillEndX, do (Actions)
          Loop - Actions
            For each (Integer loopb) from TG_FillStartY to TG_FillEndY, do (Actions)
              Loop - Actions
                Set VariableSet loc2 = (Point(((Real(loopa)) x 128.00), ((Real(loopb)) x 128.00)))
                Environment - Change terrain type at loc2 to Underground - Brick using variation -1 in an area of size 1 and shape Circle
                Custom script: call RemoveLocation(udg_loc2)
        -------- Add doors --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (TG_RoomSizeX + TG_RoomSizeY) Greater than or equal to 4
          Then - Actions
            Set VariableSet doors = 3
          Else - Actions
            Set VariableSet doors = 1
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            mordor Equal to True
          Then - Actions
            Set VariableSet doors = (doors + 1)
          Else - Actions
        For each (Integer loopc) from 1 to (Random integer number between doors and ((TG_RoomSizeX + TG_RoomSizeY) / 2)), do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Greater than or equal to 50.00
              Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Greater than or equal to 50.00
                  Then - Actions
                    -------- Top wall --------
                    Set VariableSet loc2 = (Point(((Real((Random integer number between TG_FillStartX and TG_FillEndX))) x 128.00), ((Real((TG_FillEndY + 1))) x 128.00)))
                  Else - Actions
                    -------- Bot wall --------
                    Set VariableSet loc2 = (Point(((Real((Random integer number between TG_FillStartX and TG_FillEndX))) x 128.00), ((Real((TG_FillStartY - 1))) x 128.00)))
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random percentage) Greater than or equal to 50.00
                  Then - Actions
                    -------- Left wall --------
                    Set VariableSet loc2 = (Point(((Real((TG_FillStartX - 1))) x 128.00), ((Real((Random integer number between TG_FillStartY and TG_FillEndY))) x 128.00)))
                  Else - Actions
                    -------- Right wall --------
                    Set VariableSet loc2 = (Point(((Real((TG_FillEndX + 1))) x 128.00), ((Real((Random integer number between TG_FillStartY and TG_FillEndY))) x 128.00)))
            Set VariableSet check = True
            -------- Don't create door inside a room --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Terrain type at loc2) Equal to Underground - Brick
              Then - Actions
                Set VariableSet check = False
              Else - Actions
            -------- Don't create a door next to another door --------
            For each (Integer loopa) from 1 to 4, do (Actions)
              Loop - Actions
                Set VariableSet loc3 = (loc2 offset by 128.00 towards ((Real(loopa)) x 90.00) degrees.)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at loc3) Equal to Underground - Grey Stones
                  Then - Actions
                    Set VariableSet check = False
                  Else - Actions
                Custom script: call RemoveLocation(udg_loc3)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                check Equal to True
              Then - Actions
                Unit - Create 1.DUMMY for Neutral Passive at loc2 facing Default building facing degrees
                Unit Group - Add (Last created unit) to TG_DoorsUG
              Else - Actions
            Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    Custom script: call RemoveLocation(udg_loc1)
    -------- Loop Continue --------
    Set VariableSet TG_BlockCurrentX = (TG_BlockCurrentX + 1)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        TG_BlockCurrentX Greater than TG_BlockEndX
      Then - Actions
        Set VariableSet TG_BlockCurrentY = (TG_BlockCurrentY + 1)
        Set VariableSet TG_BlockCurrentX = TG_BlockStartX
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            TG_BlockCurrentY Greater than TG_BlockEndY
          Then - Actions
            Set VariableSet continue = True
            Trigger - Turn off (This trigger)
          Else - Actions
      Else - Actions
Terrain Gen Walls
  Events
    Time - Every 0.01 seconds of game time
  Conditions
    continue Equal to False
  Actions
    -------- Iterations --------
    For each (Integer loopa) from 1 to 20, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((This trigger) is on) Equal to True
          Then - Actions
            Set VariableSet loc1 = (Point(((Real(TG_CellCurrentX)) x 128.00), ((Real(TG_CellCurrentY)) x 128.00)))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Terrain type at loc1) Equal to Underground - Square Tiles
              Then - Actions
                -------- WALL --------
                Set VariableSet locNorth = (loc1 offset by (0.00, 128.00))
                Set VariableSet locEast = (loc1 offset by (128.00, 0))
                Set VariableSet locSouth = (loc1 offset by (0.00, -128.00))
                Set VariableSet locWest = (loc1 offset by (-128.00, 0))
                -------- Shape: + --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B001 (destructablecode) at loc1 facing 0.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- Horizontal --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B000 (destructablecode) at loc1 facing 90.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- End East --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B000 (destructablecode) at loc1 facing 90.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- End West --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B000 (destructablecode) at loc1 facing 90.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- Vertical --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B000 (destructablecode) at loc1 facing 0.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- End North --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B000 (destructablecode) at loc1 facing 0.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- End South --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B000 (destructablecode) at loc1 facing 0.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- T North --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B003 (destructablecode) at loc1 facing 270.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- T East --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B003 (destructablecode) at loc1 facing 180.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- T South --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B003 (destructablecode) at loc1 facing 90.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- T West --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B003 (destructablecode) at loc1 facing 0.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- L NE --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B002 (destructablecode) at loc1 facing 0.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- L NW --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Not equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B002 (destructablecode) at loc1 facing 90.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- L SW --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Not equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B002 (destructablecode) at loc1 facing 180.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                -------- L SE --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Terrain type at locNorth) Not equal to Underground - Square Tiles
                    (Terrain type at locEast) Equal to Underground - Square Tiles
                    (Terrain type at locSouth) Equal to Underground - Square Tiles
                    (Terrain type at locWest) Not equal to Underground - Square Tiles
                  Then - Actions
                    Destructible - Create a B002 (destructablecode) at loc1 facing 270.00 with scale WALL_SCALE and variation 0
                  Else - Actions
                Custom script: call RemoveLocation(udg_locNorth)
                Custom script: call RemoveLocation(udg_locEast)
                Custom script: call RemoveLocation(udg_locSouth)
                Custom script: call RemoveLocation(udg_locWest)
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Terrain type at loc1) Equal to Underground - Brick
              Then - Actions
                Trigger - Run Terrain_Gen_Doodads_Items <gen> (ignoring conditions)
              Else - Actions
            Custom script: call RemoveLocation(udg_loc1)
            -------- Loop Continue --------
            Set VariableSet TG_CellCurrentX = (TG_CellCurrentX + 1)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                TG_CellCurrentX Greater than TG_CellEndX
              Then - Actions
                Set VariableSet TG_CellCurrentY = (TG_CellCurrentY + 1)
                Set VariableSet TG_CellCurrentX = TG_CellStartX
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    TG_CellCurrentY Greater than TG_CellEndY
                  Then - Actions
                    Set VariableSet continue = True
                    Trigger - Turn off (This trigger)
                  Else - Actions
              Else - Actions
          Else - Actions
Terrain Gen Doodads Items
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than or equal to CHANCE_CRATES
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Destructible-type of (Picked destructible)) Equal to LTcr (destructablecode)
              Then - Actions
                Set VariableSet SpawnedCrates = (SpawnedCrates - 1)
              Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            SpawnedCrates Less than MaxCrates
          Then - Actions
            Set VariableSet SpawnedCrates = (SpawnedCrates + 1)
            Destructible - Create a LTcr (destructablecode) at loc2 facing (Random angle) with scale 1.00 and variation 1
          Else - Actions
        Trigger - Add to Crate_Death <gen> the event ((Last created destructible) dies)
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_SCREEN
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Destructible - Create a B00A (destructablecode) at loc2 facing ((Real((Random integer number between 1 and 4))) x 90.00) with scale 1.00 and variation 1
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_LABBLUE
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Destructible - Create a B00D (destructablecode) at loc2 facing (Random real number between 180.00 and 360.00) with scale 1.30 and variation 1
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_LABLIGHTNING
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Destructible - Create a B00F (destructablecode) at loc2 facing (Random real number between 180.00 and 360.00) with scale 1.30 and variation 1
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_LABGREEN
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Destructible - Create a B00E (destructablecode) at loc2 facing (Random real number between 180.00 and 360.00) with scale 1.30 and variation 1
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_CHAIR
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Special Effect - Create a special effect at loc2 using war3mapImported\GenericModernChair.mdx
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_BENCH
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Destructible - Create a B00B (destructablecode) at loc2 facing ((Real((Random integer number between 1 and 4))) x 90.00) with scale 0.90 and variation 1
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_SHELF
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Destructible - Pick every destructible within 48.00 of loc2 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Destructible - Create a B00C (destructablecode) at loc2 facing ((Real((Random integer number between 1 and 4))) x 90.00) with scale 1.00 and variation 1
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_SCRAP
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Item - Create Scrap at loc2
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_SHOTAMMO
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Item - Create Shotgun Ammo at loc2
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_CEILINGFAN
      Then - Actions
        Special Effect - Create a special effect at loc1 using war3mapImported\Ceiling Fan.mdx
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random percentage) Less than CHANCE_SMGAMMO
      Then - Actions
        Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
        Item - Create SMG Ammo at loc2
        Custom script: call RemoveLocation(udg_loc2)
      Else - Actions
Terrain Gen Doors
  Events
  Conditions
  Actions
    Unit Group - Pick every unit in TG_DoorsUG and do (Actions)
      Loop - Actions
        Set VariableSet loc1 = (Position of (Picked unit))
        Set VariableSet count = 0
        Set VariableSet loc2 = (loc1 offset by (128.00, 0))
        Region - Center checkregion128 on loc2
        Destructible - Pick every destructible in checkregion128 and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Or - Any (Conditions) are true
                  Conditions
                    (Destructible-type of (Picked destructible)) Equal to B005 (destructablecode)
                    (Destructible-type of (Picked destructible)) Equal to B006 (destructablecode)
              Then - Actions
                Set VariableSet count = (count + 1)
              Else - Actions
        Custom script: call RemoveLocation(udg_loc2)
        Set VariableSet loc2 = (loc1 offset by (0.00, 128.00))
        Region - Center checkregion128 on loc2
        Destructible - Pick every destructible in checkregion128 and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Or - Any (Conditions) are true
                  Conditions
                    (Destructible-type of (Picked destructible)) Equal to B005 (destructablecode)
                    (Destructible-type of (Picked destructible)) Equal to B006 (destructablecode)
              Then - Actions
                Set VariableSet count = (count + 1)
              Else - Actions
        Custom script: call RemoveLocation(udg_loc2)
        Set VariableSet loc2 = (loc1 offset by (-128.00, 0))
        Region - Center checkregion128 on loc2
        Destructible - Pick every destructible in checkregion128 and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Or - Any (Conditions) are true
                  Conditions
                    (Destructible-type of (Picked destructible)) Equal to B005 (destructablecode)
                    (Destructible-type of (Picked destructible)) Equal to B006 (destructablecode)
              Then - Actions
                Set VariableSet count = (count + 1)
              Else - Actions
        Custom script: call RemoveLocation(udg_loc2)
        Set VariableSet loc2 = (loc1 offset by (0.00, -128.00))
        Region - Center checkregion128 on loc2
        Destructible - Pick every destructible in checkregion128 and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Or - Any (Conditions) are true
                  Conditions
                    (Destructible-type of (Picked destructible)) Equal to B006 (destructablecode)
                    (Destructible-type of (Picked destructible)) Equal to B005 (destructablecode)
              Then - Actions
                Set VariableSet count = (count + 1)
              Else - Actions
        Custom script: call RemoveLocation(udg_loc2)
        -------- Not adjacent to another door --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            count Equal to 0
          Then - Actions
            Set VariableSet locNorth = (loc1 offset by (0.00, 128.00))
            Set VariableSet locEast = (loc1 offset by (128.00, 0))
            Set VariableSet locSouth = (loc1 offset by (0.00, -128.00))
            Set VariableSet locWest = (loc1 offset by (-128.00, 0))
            -------- Horizontal --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Terrain type at locNorth) Not equal to Underground - Square Tiles
                (Terrain type at locEast) Equal to Underground - Square Tiles
                (Terrain type at locSouth) Not equal to Underground - Square Tiles
                (Terrain type at locWest) Equal to Underground - Square Tiles
              Then - Actions
                Set VariableSet DoorId = (DoorId + 1)
                Destructible - Pick every destructible within 32.00 of loc1 and do (Actions)
                  Loop - Actions
                    Destructible - Remove (Picked destructible)
                Destructible - Create a B005 (destructablecode) at loc1 facing 0.00 with scale DOOR_SIZE and variation 0
                Animation - Play (Last created destructible)'s death alternate (animationname) animation
                Set VariableSet DoorAngle[DoorId] = 0.00
                Set VariableSet DoorTree[DoorId] = (Last created destructible)
                Set VariableSet DoorDoorHp[DoorId] = 200.00
                Set VariableSet DoorWallHp[DoorId] = 1000.00
                Set VariableSet DoorRegion[DoorId] = (Region centered at loc1 with size (128.00, 128.00))
              Else - Actions
            -------- Vertical --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Terrain type at locNorth) Equal to Underground - Square Tiles
                (Terrain type at locEast) Not equal to Underground - Square Tiles
                (Terrain type at locSouth) Equal to Underground - Square Tiles
                (Terrain type at locWest) Not equal to Underground - Square Tiles
              Then - Actions
                Set VariableSet DoorId = (DoorId + 1)
                Destructible - Pick every destructible within 32.00 of loc1 and do (Actions)
                  Loop - Actions
                    Destructible - Remove (Picked destructible)
                Destructible - Create a B005 (destructablecode) at loc1 facing 90.00 with scale DOOR_SIZE and variation 0
                Animation - Play (Last created destructible)'s death alternate (animationname) animation
                Set VariableSet DoorAngle[DoorId] = 90.00
                Set VariableSet DoorTree[DoorId] = (Last created destructible)
                Set VariableSet DoorDoorHp[DoorId] = 200.00
                Set VariableSet DoorWallHp[DoorId] = 1000.00
                Set VariableSet DoorRegion[DoorId] = (Region centered at loc1 with size (128.00, 128.00))
              Else - Actions
            Custom script: call RemoveLocation(udg_locNorth)
            Custom script: call RemoveLocation(udg_locEast)
            Custom script: call RemoveLocation(udg_locSouth)
            Custom script: call RemoveLocation(udg_locWest)
          Else - Actions
        Custom script: call RemoveLocation(udg_loc1)
        Unit Group - Remove (Picked unit) from TG_DoorsUG.
        Unit - Remove (Picked unit) from the game
    For each (Integer loopa) from TG_BlockStartX to TG_BlockEndX, do (Actions)
      Loop - Actions
        For each (Integer loopb) from TG_BlockStartY to TG_BlockEndY, do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Point(((Real(loopa)) x 384.00), ((Real(loopb)) x 384.00)))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Random percentage) Less than or equal to CHANCE_LIGHT
              Then - Actions
                Special Effect - Create a special effect at loc1 using war3mapImported\TorchHumanOmni.mdx
              Else - Actions
            Custom script: call RemoveLocation(udg_loc1)
Terrain Gen Printers Etc
  Events
  Conditions
  Actions
    For each (Integer loopa) from 1 to (3 + ((Number of players in Players) / 3)), do (Actions)
      Loop - Actions
        Set VariableSet loc1 = (Point(((Real((Random integer number between TG_BlockStartX and TG_BlockEndX))) x 384.00), ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
        Set VariableSet loc2 = (loc1 offset by (-64.00, -64.00))
        Region - Center checkregion128 on loc2
        Destructible - Pick every destructible in checkregion128 and do (Actions)
          Loop - Actions
            Destructible - Remove (Picked destructible)
        Unit - Create 1.3D Printer for Neutral Passive at loc2 facing Default building facing degrees
        Unit - Pause (Last created unit)
        Custom script: call RemoveLocation(udg_loc2)
        Custom script: call RemoveLocation(udg_loc1)
    -------- ------------ --------
    Set VariableSet loc1 = (Point(((Real((Random integer number between (TG_BlockStartX + 2) and (TG_BlockEndX - 2)))) x 384.00), ((Real((Random integer number between (TG_BlockStartY + 2) and (TG_BlockEndY - 2)))) x 384.00)))
    Set VariableSet loc2 = (loc1 offset by (-64.00, -64.00))
    Destructible - Pick every destructible within 200.00 of loc2 and do (Actions)
      Loop - Actions
        Destructible - Remove (Picked destructible)
    Destructible - Create a B009 (destructablecode) at loc2 facing (Random angle) with scale 0.80 and variation 0
    Set VariableSet AbominationCage = (Last created destructible)
    Custom script: call RemoveLocation(udg_loc2)
    Custom script: call RemoveLocation(udg_loc1)
    -------- ------------ --------
    Set VariableSet loc1 = (Point(((Real((Random integer number between TG_BlockStartX and TG_BlockEndX))) x 384.00), ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
    Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
    Destructible - Pick every destructible within 40.00 of loc2 and do (Actions)
      Loop - Actions
        Destructible - Remove (Picked destructible)
    Destructible - Create a B008 (destructablecode) at loc2 facing (Random real number between 45.00 and 135.00) with scale 2.00 and variation 0
    Trigger - Add to Activate_Cameras <gen> the event ((Last created destructible) dies)
    Custom script: call RemoveLocation(udg_loc2)
    Custom script: call RemoveLocation(udg_loc1)
    -------- ------------ --------
    Set VariableSet loc1 = (Point(-4480.00, ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
    Destructible - Create a B009 (destructablecode) at loc1 facing (Random angle) with scale 0.80 and variation 0
    Set VariableSet SkeletonCage = (Last created destructible)
    Custom script: call RemoveLocation(udg_loc1)
    -------- ------------ --------
Terrain Gen Store Rooms
  Events
  Conditions
  Actions
    For each (Integer loopa) from TG_BlockStartX to TG_BlockEndX, do (Actions)
      Loop - Actions
        For each (Integer loopb) from TG_BlockStartY to TG_BlockEndY, do (Actions)
          Loop - Actions
            Set VariableSet loc1 = (Point(((Real(loopa)) x 384.00), ((Real(loopb)) x 384.00)))
            Set VariableSet loc2 = (loc1 offset by (-64.00, -64.00))
            Set VariableSet countDoors = 0
            Set VariableSet countWall = 0
            Region - Center CheckRoomRegion <gen> on loc2
            Destructible - Pick every destructible in CheckRoomRegion <gen> and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Destructible-type of (Picked destructible)) Equal to B005 (destructablecode)
                  Then - Actions
                    Set VariableSet countDoors = (countDoors + 1)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    Or - Any (Conditions) are true
                      Conditions
                        (Destructible-type of (Picked destructible)) Equal to B001 (destructablecode)
                        (Destructible-type of (Picked destructible)) Equal to B000 (destructablecode)
                        (Destructible-type of (Picked destructible)) Equal to B004 (destructablecode)
                        (Destructible-type of (Picked destructible)) Equal to B002 (destructablecode)
                        (Destructible-type of (Picked destructible)) Equal to B003 (destructablecode)
                  Then - Actions
                    Set VariableSet countWall = (countWall + 1)
                  Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                countDoors Equal to 1
                countWall Equal to 11
                (Random percentage) Less than or equal to 60.00
              Then - Actions
                For each (Integer loopc) from 1 to (Random integer number between 3 and 5), do (Actions)
                  Loop - Actions
                    Set VariableSet loc3 = (loc2 offset by ((Random real number between -128.00 and 128.00), (Random real number between -128.00 and 128.00)))
                    Destructible - Pick every destructible within 60.00 of loc3 and do (Actions)
                      Loop - Actions
                        Destructible - Remove (Picked destructible)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Destructible-type of (Picked destructible)) Equal to LTcr (destructablecode)
                          Then - Actions
                            Set VariableSet SpawnedCrates = (SpawnedCrates - 1)
                          Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        SpawnedCrates Less than MaxCrates
                      Then - Actions
                        Set VariableSet SpawnedCrates = (SpawnedCrates + 1)
                        Destructible - Create a LTcr (destructablecode) at loc3 facing (Random angle) with scale (Random real number between 0.90 and 1.10) and variation 0
                        Trigger - Add to Crate_Death <gen> the event ((Last created destructible) dies)
                      Else - Actions
                    Custom script: call RemoveLocation(udg_loc3)
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                countDoors Equal to 2
                countWall Equal to 10
                (Random percentage) Less than or equal to 60.00
              Then - Actions
                For each (Integer loopc) from 1 to (Random integer number between 1 and 2), do (Actions)
                  Loop - Actions
                    Set VariableSet loc3 = (loc2 offset by ((Random real number between -128.00 and 128.00), (Random real number between -128.00 and 128.00)))
                    Destructible - Pick every destructible within 60.00 of loc3 and do (Actions)
                      Loop - Actions
                        Destructible - Remove (Picked destructible)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Destructible-type of (Picked destructible)) Equal to LTcr (destructablecode)
                          Then - Actions
                            Set VariableSet SpawnedCrates = (SpawnedCrates - 1)
                          Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        SpawnedCrates Less than MaxCrates
                      Then - Actions
                        Set VariableSet SpawnedCrates = (SpawnedCrates + 1)
                        Destructible - Create a LTcr (destructablecode) at loc3 facing (Random angle) with scale (Random real number between 0.90 and 1.10) and variation 0
                        Trigger - Add to Crate_Death <gen> the event ((Last created destructible) dies)
                      Else - Actions
                    Custom script: call RemoveLocation(udg_loc3)
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                countDoors Equal to 0
                Or - Any (Conditions) are true
                  Conditions
                    countWall Equal to 10
                    countWall Equal to 7
                (Random percentage) Less than or equal to 60.00
              Then - Actions
                For each (Integer loopc) from 1 to (Random integer number between 2 and 3), do (Actions)
                  Loop - Actions
                    Set VariableSet loc3 = (loc2 offset by ((Random real number between -128.00 and 128.00), (Random real number between -128.00 and 128.00)))
                    Destructible - Pick every destructible within 60.00 of loc3 and do (Actions)
                      Loop - Actions
                        Destructible - Remove (Picked destructible)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Destructible-type of (Picked destructible)) Equal to LTcr (destructablecode)
                          Then - Actions
                            Set VariableSet SpawnedCrates = (SpawnedCrates - 1)
                          Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        SpawnedCrates Less than MaxCrates
                      Then - Actions
                        Set VariableSet SpawnedCrates = (SpawnedCrates + 1)
                        Destructible - Create a LTcr (destructablecode) at loc3 facing (Random angle) with scale (Random real number between 0.90 and 1.10) and variation 0
                        Trigger - Add to Crate_Death <gen> the event ((Last created destructible) dies)
                      Else - Actions
                    Custom script: call RemoveLocation(udg_loc3)
              Else - Actions
            Custom script: call RemoveLocation(udg_loc2)
            Custom script: call RemoveLocation(udg_loc1)
Activate Cameras
  Events
  Conditions
  Actions
    Game - Display to (All players) the text: Base CCTV activated.
    Set VariableSet loc1 = (Point(((Real((TG_BlockStartX - 2))) x 384.00), ((Real((TG_BlockStartY - 2))) x 384.00)))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((TG_BlockEndX + 2))) x 384.00), ((Real((TG_BlockStartY - 2))) x 384.00)))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((TG_BlockStartX - 2))) x 384.00), ((Real((TG_BlockEndY + 2))) x 384.00)))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((TG_BlockEndX + 2))) x 384.00), ((Real((TG_BlockEndY + 2))) x 384.00)))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(-384.00, ((Real((TG_BlockStartY - 2))) x 384.00)))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((TG_BlockEndX + 2))) x 384.00), -256.00))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(-384.00, ((Real((TG_BlockEndY + 2))) x 384.00)))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((TG_BlockStartX - 2))) x 384.00), -256.00))
    Unit - Create 1.CCTV Camera for (Random player from Players) at loc1 facing Default building facing degrees
    Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
    Cinematic - Ping minimap for (All players) at loc1 for 1 seconds
    Custom script: call RemoveLocation(udg_loc1)
Wreck Swarmed Entrance
  Events
    Time - Every 10.00 seconds of game time
  Conditions
  Actions
    Set VariableSet group1 = (Units in SwarmRegion <gen>)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in group1) Greater than or equal to 50
      Then - Actions
        Destructible - Kill (Random destructible in Wreck_Entrance <gen>)
      Else - Actions
    Custom script: call DestroyGroup(udg_group1)
Highlight Data Nodes
  Events
    Time - Every 0.05 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in DataNodes and do (Actions)
      Loop - Actions
        Set VariableSet uid = (Custom value of (Picked unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DataNodeR[uid] Less than or equal to 25.00
          Then - Actions
            Set VariableSet DataNodeRdelta[uid] = 5.00
          Else - Actions
        Set VariableSet DataNodeR[uid] = (DataNodeR[uid] + DataNodeRdelta[uid])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DataNodeR[uid] Greater than 100.00
          Then - Actions
            Set VariableSet DataNodeRdelta[uid] = -5.00
          Else - Actions
        Animation - Change (Picked unit)'s vertex coloring to (100.00%, DataNodeR[uid]%, DataNodeR[uid]%) with 0% transparency
Game Start
  Events
  Conditions
  Actions
    Cinematic - Clear the screen of text messages for (All players).
    Set VariableSet loc1 = (Center of EvacSpawn <gen>)
    Set VariableSet loc2 = (Center of PlayerSpawn <gen>)
    Unit - Create 1.Evac Heli for Player 1 (Red) at loc1 facing Default building facing degrees
    Sound - Play helicopter_hovering_overhead <gen> at 100% volume, attached to (Last created unit)
    Set VariableSet ChopperSound = (Last played sound)
    Set VariableSet heli = (Last created unit)
    Unit - Order heli to Move To.loc2
    Player Group - Pick every player in Players and do (Actions)
      Loop - Actions
        Player - Set (Picked player).Food cap to 100
        Camera - Pan camera for (Picked player) to loc2 over 0 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Custom script: call RemoveLocation(udg_loc2)
    Wait 4.00 seconds
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : Go go go!)
    For each (Integer loopd) from 1 to 8, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player(loopd)) is in Players.) Equal to True
          Then - Actions
            Set VariableSet loc1 = (Random point in PlayerSpawn <gen>)
            Unit - Create 1.Marine for (Player(loopd)) at loc1 facing Default building facing degrees
            Unit Group - Add (Last created unit) to PlayerHeroesAlive
            Selection - Select (Last created unit) for (Player(loopd))
            Set VariableSet PlayerHero[loopd] = (Last created unit)
            Hero - Create SMG Ammo and give it to (Last created unit)
            Item - Set charges remaining in (Last created item) to 5
            Hero - Create Grenade and give it to (Last created unit)
            Item - Set charges remaining in (Last created item) to 3
            Special Effect - Create a special effect attached to the weapon (attachpoint) of (Last created unit) using war3mapImported\TorchHumanOmni.mdx
            Hero - Create SMG and give it to (Last created unit)
            Item - Set life of (Last created item) to 130.00
            Hero - Order (Last created unit) to use (Last created item)
            Custom script: call RemoveLocation(udg_loc1)
            Set VariableSet loc1 = (Center of SupplyRadios <gen>)
            Unit - Create 1.Supply Radio new for (Player(loopd)) at loc1 facing Default building facing degrees
            Unit - Pause (Last created unit)
            Custom script: set udg_GetLocalPlayer = GetLocalPlayer()
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                GetLocalPlayer Not equal to (Player(loopd))
              Then - Actions
                Animation - Change (Last created unit)'s size to (0.00%, 0.00%, 0.00%) of its original size
              Else - Actions
            Set VariableSet PlayerSupply[loopd] = (Last created unit)
            Custom script: call RemoveLocation(udg_loc1)
          Else - Actions
        Wait 0.30 seconds
    Wait 1.00 seconds
    Set VariableSet loc2 = (Center of EvacSpawn <gen>)
    Unit - Order heli to Move To.loc2
    Custom script: call RemoveLocation(udg_loc2)
    Wait 3.00 seconds
    Sound - Stop ChopperSound After fading
    Unit - Remove heli from the game
    Wait 4.00 seconds
    Set VariableSet loc1 = (Center of HouseRegion)
    Cinematic - Ping minimap for (All players) at loc1 for 10.00 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : Alright ladies, the main building is just a few steps to the west. Get moving!)
    Quest - Create a Required quest titled Enter the Base with the description Enter the main base in the center of the complex to investigate., using icon path ReplaceableTextures\CommandButtons\BTNArcaneVault.blp
    Wait 60.00 seconds
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : I'm detecting a large concentration of harmful toxins in the air. We should stay inside as much as possible.)
    Trigger - Turn on Toxic_Outside <gen>
Spawn Marine
  Events
  Conditions
  Actions
    Animation - Change UDexUnits[UDex] flying height to 350.00 at 0.00
    Set VariableSet MoveDz[uid] = -4.00
    Unit Group - Add UDexUnits[UDex] to MoveGroup
    Unit - Set UDexUnits[UDex] movement speed to 0.00
Game Timer
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    Set VariableSet GameTimeSeconds = (GameTimeSeconds + 1)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        GameTimeSeconds Less than 10
      Then - Actions
        Set VariableSet tempstring = (:0 + (String(GameTimeSeconds)))
      Else - Actions
        Set VariableSet tempstring = (: + (String(GameTimeSeconds)))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        GameTimeSeconds Equal to 60
      Then - Actions
        Set VariableSet GameTimeMinutes = (GameTimeMinutes + 1)
        Set VariableSet GameTimeSeconds = 0
      Else - Actions
    Multiboard - Change the title of (Last created multiboard) to ((String(GameTimeMinutes)) + tempstring)
Level Increase
  Events
    Time - Every 60.00 seconds of game time
  Conditions
  Actions
    Set VariableSet Level = (Level + 1)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level mod 2) Equal to 0
      Then - Actions
        Set VariableSet DIFFICULTY_SPAWNRATE = (DIFFICULTY_SPAWNRATE + (((Number of players in Players) / 4) + 1))
        Countdown Timer - Start ZombieSpawnTimer as a Repeating timer that will expire in (60.00 / (Real(DIFFICULTY_SPAWNRATE))) seconds
      Else - Actions
Bio Bounty
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
        (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
  Actions
    Player - Add 1 to (Owner of (Killing unit)).Current lumber
Door Blocking
  Events
    Time - Every 0.05 seconds of game time
  Conditions
  Actions
    For each (Integer loopa) from 1 to DoorId, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Destructible-type of DoorTree[loopa]) Equal to B006 (destructablecode)
            (DoorTree[loopa] is dead) Equal to False
          Then - Actions
            Set VariableSet loc1 = (Position of DoorTree[loopa])
            Set VariableSet group1 = (Units in DoorRegion[loopa])
            Unit Group - Pick every unit in group1 and do (Actions)
              Loop - Actions
                Set VariableSet upicked = (Picked unit)
                Set VariableSet knockback = 10.00
                Custom script: set udg_x1 = GetUnitX(udg_upicked)
                Custom script: set udg_y1 = GetUnitY(udg_upicked)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    DoorAngle[loopa] Equal to 0.00
                  Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        y1 Greater than (Y of loc1)
                      Then - Actions
                        Custom script: call SetUnitY(udg_upicked, GetLocationY(udg_loc1) + 64)
                      Else - Actions
                        Custom script: call SetUnitY(udg_upicked, GetLocationY(udg_loc1) - 64)
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        x1 Greater than (X of loc1)
                      Then - Actions
                        Custom script: call SetUnitX(udg_upicked, GetLocationX(udg_loc1) + 64)
                      Else - Actions
                        Custom script: call SetUnitX(udg_upicked, GetLocationX(udg_loc1) - 64)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (upicked is in ZombieGroup.) Equal to True
                  Then - Actions
                    Unit - Order upicked to Attack.DoorTree[loopa]
                  Else - Actions
                    Unit - Order upicked to Stop.
            Custom script: call RemoveLocation(udg_loc1)
            Custom script: call DestroyGroup(udg_group1)
          Else - Actions
Scrap Generator Built
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Scrap Generator
  Actions
    Unit - Order (Constructed structure) to Neutral Alchemist - Chemical Rage.
Scrap Generator Get Scrap
  Events
    Unit - A unit Finishes casting an ability
  Conditions
    (Ability being cast) Equal to Generate Scrap
  Actions
    Set VariableSet count = 10
    Floating Text - Create floating text that reads (+ + (String(count))) above (Triggering unit) with Z offset 0, using font size 8.00, color (50.00%, 50.00%, 50.00%), and 0% transparency
    Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90 degrees
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
    Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
    Floating Text - Hide (Last created floating text) for (All players)
    Set VariableSet force1 = (Player group((Owner of (Triggering unit))))
    Floating Text - Show (Last created floating text) for force1
    Custom script: call DestroyForce(udg_force1)
    Player - Add count to (Owner of (Triggering unit)).Current gold
    Wait 0.00 seconds
    Unit - Order (Triggering unit) to Neutral Alchemist - Chemical Rage.
Toxic Outside
  Events
    Time - Every 2.00 seconds of game time
  Conditions
  Actions
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Set VariableSet pid = (Player number of (Picked player))
        Set VariableSet loc1 = (Position of PlayerHero[pid])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Terrain type at loc1) Not equal to Underground - Brick
            PlayerImmune[pid] Equal to False
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Life of PlayerHero[pid]) Less than or equal to 1.00
              Then - Actions
                Unit - Cause PlayerHero[pid] to damage PlayerHero[pid], dealing 500 damage of attack type Spells and damage type Normal
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Food used) Less than 100
                  Then - Actions
                    Player - Add 1 to (Picked player).Food used
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Life of PlayerHero[pid]) Less than or equal to (((Real(((Picked player) Food used))) x 0.20) + 1.00)
                  Then - Actions
                    Unit - Cause PlayerHero[pid] to damage PlayerHero[pid], dealing 500 damage of attack type Spells and damage type Normal
                  Else - Actions
                    Unit - Set life of PlayerHero[pid] to ((Life of PlayerHero[pid]) - ((Real(((Picked player) Food used))) x 0.20))
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                ((Picked player) Food used) Greater than 0
              Then - Actions
                Player - Add -1 to (Picked player).Food used
              Else - Actions
        Custom script: call RemoveLocation(udg_loc1)
Player Down
  Events
    Game - DamageEvent becomes Equal to 1.00
  Conditions
    (DamageEventTarget is A Hero) Equal to True
  Actions
    Set VariableSet uid = (Custom value of DamageEventTarget)
    Set VariableSet pid = (Player number of (Owner of DamageEventTarget))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DamageEventTarget Equal to PlayerHero[pid]
        ((Life of DamageEventTarget) - DamageEventAmount) Less than or equal to 0.00
      Then - Actions
        For each (Integer loopa) from 1 to 6, do (Actions)
          Loop - Actions
            Hero - Drop the item from slot loopa of DamageEventTarget.
        Unit - Pause DamageEventTarget
        Unit - Make DamageEventTarget Invulnerable
        Animation - Play DamageEventTarget's death (animationname) animation
        Game - Display to (All players) the text: ((Name of (Owner of DamageEventTarget)) + is down.)
        Unit Group - Remove DamageEventTarget from PlayerHeroesAlive.
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in PlayerHeroesAlive) Equal to 0
          Then - Actions
            Quest - Display to (All players) the Quest Failed message: |cffffcc00MISSION FAILED|r
            Trigger - Run Game_Over <gen> (ignoring conditions)
          Else - Actions
      Else - Actions
Revive Start
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Revive Player
  Actions
    Set VariableSet pid = (Player number of (Owner of (Triggering unit)))
    Set VariableSet loc1 = (Position of (Target unit of ability being cast))
    Unit - Create 1.Progress Bar for (Owner of (Triggering unit)) at loc1 facing Default building facing degrees
    Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
    Set VariableSet PlayerReviverBar[pid] = (Last created unit)
    Set VariableSet PlayerReviveTarget[pid] = (Target unit of ability being cast)
    Animation - Change (Last created unit)'s animation speed to 20.00% of its original speed
    Animation - Play (Last created unit)'s birth (animationname) animation
    Custom script: call RemoveLocation(udg_loc1)
Revive Cancel
  Events
    Unit - A unit Stops casting an ability
  Conditions
    PlayerReviverBar[(Player number of (Owner of (Triggering unit)))] Not equal to No unit
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Unit - Kill PlayerReviverBar[(Player number of (Owner of (Triggering unit)))]
    Set VariableSet PlayerReviverBar[(Player number of (Owner of (Triggering unit)))] = No unit
Revive Finish
  Events
    Unit - A unit Finishes casting an ability
  Conditions
    (Ability being cast) Equal to Revive Player
  Actions
    Set VariableSet pid = (Player number of (Owner of (Triggering unit)))
    Set VariableSet u = PlayerReviveTarget[pid]
    Unit - Unpause u
    Unit - Make u Vulnerable
    Game - Display to (All players) the text: ((Name of (Owner of u)) + has been revived.)
    Unit Group - Add u to PlayerHeroesAlive
    Unit - Set life of u to 25.00%
    Player - Set (Owner of u).Food used to (((Owner of u) Food used) - 25)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Owner of u) Food used) Less than 0
      Then - Actions
        Player - Set (Owner of u).Food used to 0
      Else - Actions
    Animation - Play u's stand (animationname) animation
Game Over
  Events
  Conditions
  Actions
    Cinematic - Fade out over 5.00 seconds using texture Black Mask and color (0%, 0%, 0%) with 0% transparency
    Wait 5.00 seconds
    Player Group - Pick every player in Players and do (Actions)
      Loop - Actions
        Game - Defeat (Picked player) with the message: (Mission failed. + ((String((Number of players in Players))) + marines MIA.))
Spawn Scrap
  Events
    Time - Every 120.00 seconds of game time
  Conditions
  Actions
    For each (Integer loopa) from 1 to (2 + (Number of players in Players)), do (Actions)
      Loop - Actions
        Set VariableSet loc1 = (Random point in HouseRegion)
        Item - Create Scrap at loc1
        Custom script: call RemoveLocation(udg_loc1)
Player Leave
  Events
    Player - Player 1 (Red) leaves the game
    Player - Player 2 (Blue) leaves the game
    Player - Player 3 (Teal) leaves the game
    Player - Player 4 (Purple) leaves the game
    Player - Player 5 (Yellow) leaves the game
    Player - Player 6 (Orange) leaves the game
    Player - Player 7 (Green) leaves the game
    Player - Player 8 (Pink) leaves the game
  Conditions
  Actions
    Game - Display to (All players) the text: ((Name of (Triggering player)) + has left the game.)
Prevent Outside Scrap
  Events
    Unit - A unit Begins construction
  Conditions
    (Unit-type of (Constructing structure)) Equal to Scrap Generator
  Actions
    Set VariableSet loc1 = (Position of (Constructing structure))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Terrain type at loc1) Not equal to Underground - Brick
      Then - Actions
        Hero - Create Scrap Generator and give it to PlayerHero[(Player number of (Owner of (Triggering unit)))]
        Floating Text - Create floating text that reads Invalid location - must be built on metal at loc1 with Z offset 0, using font size 8.00, color (100%, 100%, 100%), and 0% transparency
        Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
        Floating Text - Hide (Last created floating text) for (All players)
        Set VariableSet force1 = (Player group((Owner of (Triggering unit))))
        Floating Text - Show (Last created floating text) for force1
        Custom script: call DestroyForce(udg_force1)
        Unit - Remove (Constructing structure) from the game
      Else - Actions
    Custom script: call RemoveLocation(udg_loc1)
Mission 1 Enter Base
  Events
  Conditions
  Actions
    Trigger - Turn off (This trigger)
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : What the... they're dead!)
    Wait 5.00 seconds
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : We need to make contact with HQ. To the communication tower!)
    Quest - Mark (Last created quest) as Completed
    Quest - Create a Required quest titled Report Back with the description Go to the communication tower in the north east of the base to report back to HQ., using icon path war3mapImported\BTNRadio.blp
    Set VariableSet loc1 = (Center of SupplyRadioRegion <gen>)
    Cinematic - Ping minimap for (All players) at loc1 for 10.00 seconds
    Custom script: call RemoveLocation(udg_loc1)
    Trigger - Turn on Mission_2_Radar <gen>
    Wait 15.00 seconds
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : I'm picking up multiple contacts near the entrance...)
    Trigger - Turn on Zombie_Spawns <gen>
    Trigger - Turn on Level_Increase <gen>
Mission 2 Radar
  Events
    Unit - A unit enters SupplyRadioRegion <gen>
  Conditions
  Actions
    Trigger - Turn off (This trigger)
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : ** HQ, come in. HQ, come in. **)
    Wait 5.00 seconds
    Quest - Display to (All players) the Quest Update message: ((Name of (Random player from Players)) + : It's broken. We should check the main building for spare parts.)
    Quest - Mark (Last created quest) as Completed
    Quest - Create a Required quest titled Repair Comms Tower with the description Look for |cffffcc00Spare Parts|r in the main base and bring it to the comms tower to repair it., using icon path ReplaceableTextures\CommandButtons\BTNRepairOff.blp
    Trigger - Turn on Mission_3_Repair_Radar <gen>
    Set VariableSet loc1 = (Point(((Real((Random integer number between TG_BlockStartX and TG_BlockEndX))) x 384.00), ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
    Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
    Item - Create Spare Parts at loc2
    Custom script: call RemoveLocation(udg_loc2)
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((Random integer number between TG_BlockStartX and TG_BlockEndX))) x 384.00), ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
    Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
    Item - Create Spare Parts at loc2
    Custom script: call RemoveLocation(udg_loc2)
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((Random integer number between TG_BlockStartX and TG_BlockEndX))) x 384.00), ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
    Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
    Item - Create Spare Parts at loc2
    Custom script: call RemoveLocation(udg_loc2)
    Custom script: call RemoveLocation(udg_loc1)
    Set VariableSet loc1 = (Point(((Real((Random integer number between TG_BlockStartX and TG_BlockEndX))) x 384.00), ((Real((Random integer number between TG_BlockStartY and TG_BlockEndY))) x 384.00)))
    Set VariableSet loc2 = (loc1 offset by ((Random real number between -64.00 and 64.00), (Random real number between -64.00 and 64.00)))
    Item - Create Spare Parts at loc2
    Custom script: call RemoveLocation(udg_loc2)
    Custom script: call RemoveLocation(udg_loc1)
Mission 3 Repair Radar
  Events
    Unit - A unit enters SupplyRadioRegion <gen>
  Conditions