Index: code/branches/Boss_FS17/data/levels/FinalBossFS17.oxw
===================================================================
--- code/branches/Boss_FS17/data/levels/FinalBossFS17.oxw	(revision 11388)
+++ code/branches/Boss_FS17/data/levels/FinalBossFS17.oxw	(revision 11424)
@@ -3,5 +3,5 @@
  description = "Final Boss"
  tags = "test"
- screenshot = "emptylevel.png"
+ screenshot = "frozen1.jpeg"
 />
 
@@ -11,4 +11,5 @@
   include("templates/lodInformation.oxt")
   include("templates/HeavyCruiser.oxt")
+   include("templates/pickupRepresentationTemplates.oxt")
 ?>
 
@@ -16,4 +17,9 @@
   include("templates/Bossspawnship.oxt")
   include("templates/Bossship.oxt")
+
+  include("templates/spaceshipEscort.oxt")
+  include("templates/endurancetest_template.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/fastship.oxt")
 
   ?>
@@ -32,64 +38,1029 @@
   >
 
+  <?lua
+      include("includes/pickups.oxi")
+    ?>
+
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
 
-    <SpawnPoint team=0 position="-200,0,0" lookat="1,1,1" spawnclass=SpaceShip pawndesign=spaceshipescort />
-
-    <ModularSpaceShip velocity= "20,0,0" position="0,0,200" lookat= "0,0,0" health="1000" maxhealth="1000" initialhealth="1000" scale3D="1,1,1">
+    <SpawnPoint team=0 position="-200,0,0" lookat="1,1,1" spawnclass=SpaceShip pawndesign=spaceshipsputim />
+
+
+
+
+
+
+<?lua
+      for i = 1, 250, 1
+      do
+      j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(math.random()* 15000 - 1000) ?>,<?lua print(math.random() * 12000 - 4000) ?>,<?lua print(math.random() * 12000 - 4000) ?>"
+      collisionType = dynamic
+      linearDamping = 0.8
+      angularDamping = 0
+      scale = "<?lua print(j * 150)?>"
+      collisiondamage = 1
+      enablecollisiondamage = true
+    >
+      <attached>
+        <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+
+    <?lua
+      end
+    ?>
+
+
+
+
+<Spawnpoint team= 1 position="0,10,10" lookat="0,1,0" spawnclass=SpaceShip pawndesign=fastship >
+      <controller>
+        <WaypointPatrolController alertnessradius=100 attackradius=90 />
+      </controller>
+    </Spawnpoint>
+
+    <SpaceShip position="0,10,10" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+
+          	<?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+            <?lua
+      end
+    ?>
+            
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+
+
+
+
+
+
+
+
+
+
+
+
+    <SpaceShip position="0, 0, 100" lookat="0,0,0" team=0  name="d2sd1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="DIAMOND" />
+        <WaypointPatrolController alertnessradius=1000 attackradius=900 />
+      </controller>
+    </SpaceShip>
+
+     <SpaceShip position="-400, 150, -100" lookat="0,0,0" team=0 name="d1sd1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="WALL">
+        	<SectionController team=0>
+        </SectionController>
+
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-400, 190, -100" lookat="0,0,0" team=0 name="d1ss1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=0>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+
+ <!-- TRIGGERS -->
+    <DistanceTrigger name="FormationInit" position="800,700,600"  target="Pawn" distance=60 stayActive="true" delay=0.1 />
+    <DistanceTrigger name="LetsGo"        position="200,-200,1000" target="Pawn" distance=180 stayActive="true" delay=0.1 />
+    <BlinkingBillboard colour="1,1,0.05" position="200,-200,1000" frequency=0.6 amplitude=3 material="Flares/lensflare" />
+
+    <Script code="formationcontroller formationflight true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event=FormationInit />
+            </trigger>
+        </events>
+    </Script> <!-- !!! activates formation behaviour !!! -->
+
+    <Script code="artificialcontroller setbotlevel 5" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event=FormationInit />
+            </trigger>
+        </events>
+    </Script>
+
+    <SimpleNotification message="Let's go!">
+        <events>
+            <trigger>
+                <EventListener event="LetsGo" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+
+
+
+<!-- ADDING FORMATION: 2 Swallows -->
+<?lua for i=0,1,1 do
+?>
+    <SpaceShip position="<?lua print(400+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
+        <templates>
+            <Template link=spaceshipassff /> <!--spaceshipTransporter spaceshippirate-->
+        </templates>
+        <controller>
+            <AIController team=0>
+                <events>
+                    <activity>
+                        <EventListener event="LetsGo" />
+                     </activity>
+                </events>
+            </AIController>
+        </controller>
+    </SpaceShip>
+<?lua end ?>
+
+    
+
+    <ModularSpaceShip velocity= "20,0,0" position="0,0,200" lookat= "0,0,0" scale3D="1,1,1" health = 2000 initialhealth = 1000 maxhealth = 1000  Team= 1>
       <templates>
         <Template link= bossship />
       </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <Model mesh="sphere.mesh" scale=4 position="300,100,100" />
+            <Model mesh="sphere.mesh" scale=4 position="500,-200,-300" />
+            <Model mesh="sphere.mesh" scale=4 position="-700,-300,-300" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
     </ModularSpaceShip>
 
 
-<MovableEntity position="0,0,0" rotationrate="45" rotationaxis="0,0,1">
-    <attached>
-        <Model position="0,0,0" mesh="IceStar.mesh" scale3D="100,100,100" />
-        <MovableEntity position="0,0,0" rotationrate="180" rotationaxis="0,1,0">
+
+
+    <Pawn team=1 health=30 velocity="0,0,0" shieldhealth=130 initialshieldhealth=130 maxshieldhealth=150 shieldabsorption=0.95 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=sat>
+    <attached>
+        <Model position="5,5,5" mesh="satellite.mesh" scale3D="3,3,3" />
+        <PickupSpawner pickup=smallshieldpickup position="50,5,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+    </attached>
+    <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+    </collisionShapes>
+
+
+
+    
+	</Pawn>
+
+	<EventTrigger name="sattrigger" activations="1" stayactive="true" delay=0.1>
+            <events>
+              <trigger>
+                <EventListener event="sat" />
+              </trigger>
+            </events>
+    </EventTrigger>
+
+	<PickupSpawner pickup=mediumboostpickup position="-50,305,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+
+
+<Pawn team=1 health=30 velocity="0,0,0" shieldhealth=130 initialshieldhealth=130 maxshieldhealth=150 shieldabsorption=0.95 position="0,0,100" direction="0,-1,0" collisionType=dynamic mass=100000 name=sat>
+    <attached>
+        <Model position="5,5,5" mesh="satellite.mesh" scale3D="3,3,3" />
+        <PickupSpawner pickup=smallshieldpickup position="50,5,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger4" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger4" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+    </attached>
+    <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+    </collisionShapes>
+
+
+
+    
+	</Pawn>
+
+	<EventTrigger name="sattrigger4" activations="1" stayactive="true" delay=0.1>
+            <events>
+              <trigger>
+                <EventListener event="sat" />
+              </trigger>
+            </events>
+    </EventTrigger>
+
+	<PickupSpawner pickup=mediumboostpickup position="-50,305,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger4" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger4" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+
+
+
+
+		<Pawn team=1 health=30 velocity="0,0,0" shieldhealth=130 initialshieldhealth=130 maxshieldhealth=150 shieldabsorption=0.95 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=sat>
+    <attached>
+        <Model position="2,2,2" mesh="satellite.mesh" scale3D="3,3,3" />
+        <PickupSpawner pickup=smallshieldpickup position="50,5,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger2" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger2" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+    </attached>
+    <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+    </collisionShapes>
+
+
+
+    
+	</Pawn>
+
+	<EventTrigger name="sattrigger2" activations="1" stayactive="true" delay=0.1>
+            <events>
+              <trigger>
+                <EventListener event="sat" />
+              </trigger>
+            </events>
+    </EventTrigger>
+
+	<PickupSpawner pickup=mediumboostpickup position="-50,305,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger2" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger2" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+
+		<Pawn team=1 health=30 velocity="0,0,0" shieldhealth=130 initialshieldhealth=130 maxshieldhealth=150 shieldabsorption=0.95 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=sat>
+    <attached>
+        <Model position="5,5,5" mesh="satellite.mesh" scale3D="3,3,3" />
+        <PickupSpawner pickup=smallshieldpickup position="50,5,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger3" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger3" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+    </attached>
+    <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+    </collisionShapes>
+
+
+
+    
+	</Pawn>
+
+	<EventTrigger name="sattrigger3" activations="1" stayactive="true" delay=0.1>
+            <events>
+              <trigger>
+                <EventListener event="sat" />
+              </trigger>
+            </events>
+    </EventTrigger>
+
+	<PickupSpawner pickup=mediumboostpickup position="-50,305,5" triggerDistance="10" maxSpawnedItems="1">
+			<events>
+	            <activity>
+	                <EventListener event="sattrigger3" />
+	            </activity>
+	            <visibility>
+		            <EventListener event="sattrigger3" />
+	    	    </visibility>
+
+	        </events>
+		</PickupSpawner>
+
+<!--
+<MovableEntity position="-50,-50,-50" rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+        <Model position="-50,-50,-50" mesh="IceStar.mesh" scale3D="100,100,100" />
+        <MovableEntity position="-50,-50,-50" rotationrate="180" rotationaxis="0,1,0">
             <attached>
-                <Model position="0,0,0" mesh="sphere.mesh" scale3D="1,1,10" />
+                <Model position="-50,-50,-50" mesh="sphere.mesh" scale3D="1,1,10" />
             </attached>
         </MovableEntity>
     </attached>
-</MovableEntity>
-
-<MovableEntity position="0,0,0" rotationrate="45" rotationaxis="0,1,0">
-    <attached>
-        <Model position="0,0,0" mesh="IceStar.mesh" scale3D="100,100,100" />
-        <MovableEntity position="0,0,0" rotationrate="180" rotationaxis="0,1,0">
-            <attached>
-                <Model position="0,0,0" mesh="sphere.mesh" scale3D="1,1,10" />
-            </attached>
-        </MovableEntity>
-    </attached>
-</MovableEntity>
-<!--
-<StaticEntity position="0,-10000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
-    <attached> 
-        <Model position="0,0,0" mesh="IceStar.mesh" scale3D="10000,10000,1000" /> 
-    </attached> 
-    <collisionShapes> 
-        <BoxCollisionShape position="0,0,0" halfExtents="10000,10000,1000" /> 
-    </collisionShapes> 
-</StaticEntity>
--->
-
-
-
-    <!--
-
-    <StaticEntity position="0,-10000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
-    <attached> 
-        <Model position="0,0,0" mesh="Transporter.mesh" scale3D="10000,10000,1000" /> 
-    </attached> 
-    <collisionShapes> 
-        <BoxCollisionShape position="0,0,0" halfExtents="10000,10000,1000" /> 
-    </collisionShapes> 
-</StaticEntity>
-
-  
--->
-
-    
+</MovableEntity>-->
+
+
+
+<Spawnpoint team= 1 position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" lookat="0,1,0" spawnclass=SpaceShip pawndesign=fastship >
+      <controller>
+        <WaypointPatrolController alertnessradius=100 attackradius=90 />
+      </controller>
+    </Spawnpoint>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1 health=200>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+
+
+ <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+
+<Spawnpoint team= 1 position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" lookat="0,1,0" spawnclass=SpaceShip pawndesign=fastship health=200 >
+      <controller>
+        <WaypointPatrolController alertnessradius=100 attackradius=90 />
+      </controller>
+    </Spawnpoint>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1 health=200>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+<Spawnpoint team= 1 position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" lookat="0,1,0" spawnclass=SpaceShip pawndesign=fastship >
+      <controller>
+        <WaypointPatrolController alertnessradius=100 attackradius=90 />
+      </controller>
+    </Spawnpoint>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1 health=200>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+
+    <Spawnpoint team= 1 position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" lookat="0,1,0" spawnclass=SpaceShip pawndesign=fastship >
+      <controller>
+        <WaypointPatrolController alertnessradius=100 attackradius=90 />
+      </controller>
+    </Spawnpoint>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+           <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+            <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <Spawnpoint team= 1 position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" lookat="0,1,0" spawnclass=SpaceShip pawndesign=fastship >
+      <controller>
+        <WaypointPatrolController alertnessradius=100 attackradius=90 />
+      </controller>
+    </Spawnpoint>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 0>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 0>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 0>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 0>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 0>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 0>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=0>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+<SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </MovableEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+
+    <SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <StaticEntity >
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </StaticEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+<SpaceShip position="<?lua print(math.random()* 1500 - 1000) ?>,<?lua print(math.random() * 1200 - 400) ?>,<?lua print(math.random() * 1200 - 400) ?>" velocity="50,50,50" team= 1>
+      <templates>
+        <Template link=fastship />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=200 attackradius=150 Team=1>
+          <waypoints>
+            <?lua
+          	size = 1200
+      for i = 1, 50, 1
+      do
+    ?>
+             <StaticEntity >
+    <attached>
+            <Model  mesh="IceStar.mesh" scale=4 position= "<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>,<?lua print(math.random() * size - size / 2) ?>"/>
+</attached>
+ </StaticEntity>
+            <?lua
+      end
+    ?>
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <MovableEntity rotationrate="45" rotationaxis="0,0,1">
+    	<attached>
+    		<Model mesh="Spacegate.mesh" scale=5 position="0,100, 1000"/>
+    	</attached>
+    </MovableEntity>
+
+
+
   </Scene>
 </Level>
