Index: /code/branches/keckslevelHS14/data/levels/kecks.oxw
===================================================================
--- /code/branches/keckslevelHS14/data/levels/kecks.oxw	(revision 10152)
+++ /code/branches/keckslevelHS14/data/levels/kecks.oxw	(revision 10153)
@@ -24,5 +24,5 @@
 ?>
 
-<Level>
+<Level gametype = "Mission">
 
   <templates>
@@ -32,23 +32,37 @@
   <?lua include("includes/notifications.oxi") ?>
 
-  <Scene
-    ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/skyBoxBasic"
-  >
-<!--Quest Versuch
-<GlobalQuest id="quest0">
-            <QuestDescription title="Quest 0" description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus at dolor quis dui gravida faucibus quis ut augue. Nulla sed accumsan nulla. Sed eleifend arcu ante, vel congue neque. Praesent vel felis sit amet lacus elementum laoreet at et massa. Pellentesque imperdiet orci sit amet sem gravida a ornare odio tempor. Donec posuere scelerisque purus, et porttitor ipsum dictum ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed non turpis non eros porttitor dignissim. Phasellus at elit vel diam gravida malesuada ut a lorem. Etiam vel lacus massa. In arcu neque, ultrices at placerat in, facilisis a metus. Curabitur erat nunc, molestie sed pretium ac, ullamcorper eget tellus. Vivamus tortor magna, mollis ut vulputate vel, lacinia nec neque. Integer a nisl odio, in iaculis tortor. Nam erat erat, commodo quis tincidunt et, congue at quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-
-            Ut consequat leo ut quam congue semper et eget nibh. Nunc sit amet velit eu lorem pretium adipiscing eu ut ante. Nulla facilisi. Pellentesque interdum, neque nec consectetur vulputate, mauris risus feugiat nunc, ac sollicitudin neque quam ut tellus. Morbi elit velit, tincidunt et hendrerit eget, rutrum at erat. Duis eros nulla, faucibus vitae blandit vitae, pharetra sollicitudin justo." failMessage="Fail message 0" completeMessage="Complete message 0" />
-        </GlobalQuest>
-<AddQuest questId="quest0" />
+<Scene
+	ambientlight = "0.8, 0.8, 0.8"
+	skybox       = "Orxonox/skyBoxBasic"
+>
+<!-- TODO: Trigger fuer Boxen, SimpleNotification, Gegner sollen nicht explodieren, Spawnpoint 2 -->
+
+    <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 roll="180" position="0, 0, 0" lookat="0, 1000, 0" spawnclass=SpaceShip pawndesign=spaceshipHXY team=0 active="true" />
+
+<!-- 2. Spawnpoint
+	<SpawnPoint roll="180" position="0, 114500, 0" lookat="0, 150000, 0" spawnclass=SpaceShip pawndesign=spaceshipHXY team=0 active="false" />	
+		<events>
+               <activity>
+                   <EventListener event="atPortal1" />
+               </activity>
+           </events>
+       </SpawnPoint>
 -->
-
-    <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 position="0,50000,0" lookat="0, 100000, 0" spawnclass=SpaceShip pawndesign=spaceshipHXY team=0 active="true" />
-    
-    
-    <!--Asteroiden-Guertel
+<DistanceTrigger name="startmission" position="0,0,0" target="SpaceShip" targetname="spaceshipHXY" distance=100 activations=1 stayActive=true />
+	<!--Funktioniert nicht
+	<SimpleNotification message="Follow the spaceships to escape" broadcast="true">
+		<events>
+			  <trigger>
+				  <EventListener event="startmission" />
+			  </trigger>
+		  </events>
+	</SimpleNotification>-->
+	<!-- Distance Trigger-->
+	
+	<DistanceTrigger name="atPortal1" position="0,112000,0" target="SpaceShip" targetname="spaceshipHXY" distance=100 activations=1 stayActive=true />
+
+    <!--Asteroiden-Guertel Versuch Schlaufe
     <?lua
     	for i = 1, 3, 1
@@ -62,127 +76,57 @@
 	?>
     -->
-
+    
+    <!-- Asteroidenguertel-->
     <?lua
-	asteroidBelt(0, 0, 0, 0, 0, 100, 60, 110, 3300, 3000, 200	, 0)
-	asteroidBelt(0, 0, 0, 0, 0, 100, 70, 120, 6400, 6000, 300	, 0)
-	asteroidBelt(0, 0, 0, 0, 0, 100, 80, 130, 9500, 9000, 400	, 0)
-	?>
-
-<!-- Beschuetzer und Wegweiser Innen-->		 
-    		
-<?lua
-        for i = 0, (3*math.pi/2), (math.pi/2)
-              do       
-?>
-    		
-    		
-
-<SpaceShip position="<?lua print(250*math.sin(i)) ?>, <?lua print(250*math.cos(i)) ?>,0" lookat="<?lua print(1500*math.sin(i)) ?>,  <?lua print(1500*math.cos(i)) ?>,0" maxhealt="200" initialhealth="200" roll="<?lua print(180-i*180/math.pi)?>"  >
-    <templates>
-	  <Template link=spaceshipassff2 /> <!--spaceshipTransporter -->
-	</templates>
-	  <controller>
-		 <WaypointPatrolController alertnessradius=1500 active=true team=0>
-		   <waypoints>
-			 <StaticEntity position="50,10250,0"/>
-		   </waypoints>
-		 </WaypointPatrolController>
-	  </controller>
-</SpaceShip>
-      
-              
-<?lua
-end
-?>
-              
-<!-- ENDE Beschuetzer und Wegweiser Innen-->	
-
-<!-- Gegner Innen-->		
-
- <?lua
-        for i = 0, (3*math.pi/2), (math.pi/2)
-              do
-?>
-              
-              
-<SpaceShip position="<?lua print(1500*math.sin(i)) ?>,<?lua print(1500*math.cos(i)) ?>,0" roll="<?lua print(180-i*180/math.pi)?>" lookat="0, 0, 0">
-
-  <templates>
-	  <Template link=spaceshippirate />
-  </templates>
-	  <controller>
-	<WaypointPatrolController alertnessradius=1500 active=true team=1>
-	  <waypoints>
-		<StaticEntity position="0,0,0"/>
-	  </waypoints>
-	</WaypointPatrolController>
-	  </controller>
-</SpaceShip>
-            		          
-<?lua
-end
-?>
-              
-<!-- ENDE Gegner Innen-->
-             
-<!-- Gegnerische Patrouille -->	
-          
-<?lua
-	for i = 0, (5*math.pi/3), (math.pi/3)
-		do
-?>
-
+	asteroidBelt(0, 0, 0, 0, 0, 50, 60, 110, 3300, 3000, 100	, 1)
+	asteroidBelt(0, 0, 0, 0, 0, 50, 70, 120, 6400, 6000, 125	, 1)
+	asteroidBelt(0, 0, 0, 0, 0, 50, 80, 130, 9500, 9000, 150	, 1)
+	?>
+    <!--ENDE Asteroidenguertel-->
+
+	<!-- Beschuetzer und Wegweiser Innen-->		 
+				
+	<?lua
+			for i = 0, (3*math.pi/2), (math.pi/2)
+				  do       
+	?>
+				
+				
+	
+	<SpaceShip position="<?lua print(250*math.sin(i)) ?>, <?lua print(250*math.cos(i)) ?>,0" lookat="<?lua print(1500*math.sin(i)) ?>,  <?lua print(1500*math.cos(i)) ?>,0" maxhealt="150" initialhealth="150" roll="<?lua print(180-i*180/math.pi)?>"  >
+		<templates>
+		  <Template link=spaceshipassff2 /> <!--spaceshipTransporter -->
+		</templates>
+		  <controller>
+			 <WaypointPatrolController alertnessradius=1500 active=true team=0>
+			   <waypoints>
+				 <StaticEntity position="50,10250,0"/>
+			   </waypoints>
+			 </WaypointPatrolController>
+		  </controller>
+	</SpaceShip>
+		  
+				  
+	<?lua
+	end
+	?>
+				  
+	<!-- ENDE Beschuetzer und Wegweiser Innen-->	
+	
+	<!-- Gegner Innen-->		
+	
 	 <?lua
-		for j = 1, 3, 1
-		   do
-	 ?>
-		<SpaceShip position="<?lua print((600+3200*j)*math.sin(i)) ?>,<?lua print((600+3200*j)*math.cos(i)) ?>,0" roll="<?lua print(180-i*180/math.pi)?>" lookat="0, 0, 0" >
-
-		   <templates>
-		   <Template link=spaceshippirate />
-		   </templates>
-			<controller>
-		   <WaypointPatrolController alertnessradius=1500 active=true team=1>
-		   <waypoints>
-			   	   <?lua
-					 for k = 0, (59*math.pi/30), (math.pi/30)
-						   do 
-					?>  
-			   
-		   	   	   	   <Model mesh="cube.mesh" scale=8 position="<?lua print((600+3200*j)*math.sin(i+k)) ?>,<?lua print((600+3200*j)*math.cos(i+k)) ?>,0" />
-
-				   <?lua	
-					end
-					?>
-								
-		   </waypoints>
-			</WaypointPatrolController>
-		   </controller>
-		</SpaceShip>
-	<?lua
-	end
-	?>
-<?lua
-end
-?>
-
-<!-- ENDE Gegnerische Patrouille -->							   
-						   
-<!-- Gegnerische Flotte/ Totenkopfflotte-->						   
-
-<?lua
-	for j = 0, 1, 1
-		do
-?>
-	<?lua
-		for i = 0, 4, 1
-			do
-	?>
-	<SpaceShip position="<?lua print (40*i)?>, 52000 ,<?lua print (-200*j)?>" lookat="0, 0, 0">
+			for i = 0, (3*math.pi/2), (math.pi/2)
+				  do
+	?>
+				  
+				  
+	<SpaceShip position="<?lua print(1500*math.sin(i)) ?>,<?lua print(1500*math.cos(i)) ?>,0" roll="<?lua print(180-i*180/math.pi)?>" lookat="0, 0, 0">
+	
 	  <templates>
 		  <Template link=spaceshippirate />
 	  </templates>
 		  <controller>
-		<WaypointPatrolController alertnessradius=10 active=true team=1>
+		<WaypointPatrolController alertnessradius=1500 active=true team=1>
 		  <waypoints>
 			<StaticEntity position="0,0,0"/>
@@ -190,147 +134,318 @@
 		</WaypointPatrolController>
 		  </controller>
-	</SpaceShip>			
-	<?lua
-	end
-	?>
-<?lua
-end
-?>
-			
-<?lua
-	for j = 0, 1, 1
-		do
-?>
-	<?lua
-			for i = 0, 6, 1
+	</SpaceShip>
+								  
+	<?lua
+	end
+	?>
+				  
+	<!-- ENDE Gegner Innen-->
+				 
+	<!-- Gegnerische Patrouille -->	
+			  
+	<?lua
+		for i = 0, (7*math.pi/4), (math.pi/4)
+			do
+	?>
+	
+		 <?lua
+			for j = 1, 3, 1
+			   do
+		 ?>
+			<SpaceShip position="<?lua print((600+3200*j)*math.sin(i)) ?>,<?lua print((600+3200*j)*math.cos(i)) ?>,0" roll="<?lua print(180-i*180/math.pi)?>" lookat="0, 0, 0" >
+	
+			   <templates>
+			   <Template link=spaceshippirate />
+			   </templates>
+				<controller>
+			   <WaypointPatrolController alertnessradius=1500 active=true team=1>
+			   <waypoints>
+					   <?lua
+						 for k = 0, (59*math.pi/30), (math.pi/30)
+							   do 
+						?>  
+				   
+						   <Model mesh="cube.mesh" scale=0 position="<?lua print((600+3200*j)*math.sin(i+k)) ?>,<?lua print((600+3200*j)*math.cos(i+k)) ?>,0" />
+	
+					   <?lua	
+						end
+						?>
+									
+			   </waypoints>
+				</WaypointPatrolController>
+			   </controller>
+			</SpaceShip>
+		<?lua
+		end
+		?>
+	<?lua
+	end
+	?>
+	
+	<!-- ENDE Gegnerische Patrouille -->							   
+							   
+	<!-- Gegnerische Flotte/ Totenkopfflotte-->						   
+	
+	<?lua
+		for j = 0, 1, 1
+			do
+	?>
+		<?lua
+			for i = 0, 4, 1
 				do
-	?>
-		<SpaceShip position="<?lua print (40*i-40)?>, 52000 ,<?lua print (-40-80*j)?>" lookat="0, 0, 0">
+		?>
+		<SpaceShip position="<?lua print (40*i)?>, 120000 ,<?lua print (-200*j)?>" roll="180" lookat="0, 0, 0">
 		  <templates>
 			  <Template link=spaceshippirate />
 		  </templates>
 			  <controller>
-			<WaypointPatrolController alertnessradius=10 active=true team=1>
+			<WaypointPatrolController alertnessradius=1550 active=false team=1>
 			  <waypoints>
-				<StaticEntity position="0,0,0"/>
+				<StaticEntity position="0,111000,0"/>
 			  </waypoints>
+				 <events>
+					  <activity>
+						  <EventListener event="atPortal1" />
+					  </activity>
+				  </events>
 			</WaypointPatrolController>
 			  </controller>
 		</SpaceShip>			
-	<?lua
-	end
-	?>
-<?lua
-end
-?>
-
-<?lua
-	for i = 0, 6, 3
-		do
-?>
-		<SpaceShip position="<?lua print (40*i-40)?>, 52000 ,-80" lookat="0, 0, 0">
+		<?lua
+		end
+		?>
+	<?lua
+	end
+	?>
+				
+	<?lua
+		for j = 0, 1, 1
+			do
+	?>
+		<?lua
+				for i = 0, 6, 1
+					do
+		?>
+			<SpaceShip position="<?lua print (40*i-40)?>, 120000 ,<?lua print (-40-80*j)?>" roll="180" lookat="0, 0, 0">
+			  <templates>
+				  <Template link=spaceshippirate />
+			  </templates>
+				  <controller>
+				<WaypointPatrolController alertnessradius=1450 active=false team=1>
+				  <waypoints>
+					<StaticEntity position="0,110000,0"/>
+				  </waypoints>
+					 <events>
+					  <activity>
+						  <EventListener event="atPortal1" />
+					  </activity>
+				  </events>
+				</WaypointPatrolController>
+				  </controller>
+			</SpaceShip>			
+		<?lua
+		end
+		?>
+	<?lua
+	end
+	?>
+	
+	<?lua
+		for i = 0, 6, 3
+			do
+	?>
+			<SpaceShip position="<?lua print (40*i-40)?>, 120000 ,-80" roll="180" lookat="0, 0, 0">
+			  <templates>
+				  <Template link=spaceshippirate />
+			  </templates>
+				  <controller>
+				<WaypointPatrolController alertnessradius=1550 active=false team=1>
+				  <waypoints>
+					<StaticEntity position="0,110000,0"/>
+				  </waypoints>
+			 <events>
+				  <activity>
+					  <EventListener event="atPortal1" />
+				  </activity>
+			  </events>
+				</WaypointPatrolController>
+				  </controller>
+			</SpaceShip>			
+	<?lua
+	end
+	?>
+			
+	
+	<?lua
+		for i = 0, 6, 1
+			do
+	?>
+			
+		<SpaceShip position="<?lua print (40*i-40)?>, 120000 ,-160" roll="180" lookat="0, 0, 0">
 		  <templates>
 			  <Template link=spaceshippirate />
 		  </templates>
 			  <controller>
-			<WaypointPatrolController alertnessradius=10 active=true team=1>
+			<WaypointPatrolController alertnessradius=1450 active=false team=1>
 			  <waypoints>
-				<StaticEntity position="0,0,0"/>
+				<StaticEntity position="0,110000,0"/>
 			  </waypoints>
+			 <events>
+				  <activity>
+					  <EventListener event="atPortal1" stayActiv=1 />
+				  </activity>
+			  </events>
 			</WaypointPatrolController>
 			  </controller>
-		</SpaceShip>			
-<?lua
-end
-?>
+		</SpaceShip>
+			
+	<?lua
+	end
+	?>
 		
-
-<?lua
-	for i = 0, 6, 1
-		do
-?>
-		
-		<SpaceShip position="<?lua print (40*i-40)?>, 52000 ,-160" lookat="0, 0, 0">
+	<?lua
+		for i = 1, 5, 2
+			do
+	?>
+			
+		<SpaceShip position="<?lua print (40*i-40)?>, 120000 ,-240" roll="180" lookat="0, 0, 0">
 		  <templates>
 			  <Template link=spaceshippirate />
 		  </templates>
 			  <controller>
-			<WaypointPatrolController alertnessradius=10 active=true team=1>
+			<WaypointPatrolController alertnessradius=1550 active=false team=1>
 			  <waypoints>
-				<StaticEntity position="0,0,0"/>
+				<StaticEntity position="0,110000,0"/>
 			  </waypoints>
+			 <events>
+				  <activity>
+					  <EventListener event="atPortal1" />
+				  </activity>
+			  </events>
 			</WaypointPatrolController>
 			  </controller>
-		</SpaceShip>			
-<?lua
-end
-?>
-	
-<?lua
-	for i = 1, 5, 2
-		do
-?>
-		
-		<SpaceShip position="<?lua print (40*i-40)?>, 52000 ,-240" lookat="0, 0, 0">
-		  <templates>
-			  <Template link=spaceshippirate />
-		  </templates>
-			  <controller>
-			<WaypointPatrolController alertnessradius=10 active=true team=1>
-			  <waypoints>
-				<StaticEntity position="0,0,0"/>
-			  </waypoints>
-			</WaypointPatrolController>
-			  </controller>
-		</SpaceShip>			
-<?lua
-end
-?>
-		
-<!-- ENDE Gegnerische Flotte/ Totenkopfflotte-->	
-		
-<!--Portal-->
-	<Template name=PortalDefault>
-		<PortalEndPoint>
-			<attached>
-				<Model mesh="Spacegate.mesh" />
+		</SpaceShip>
+			
+	<?lua
+	end
+	?>
+			
+	<!-- ENDE Gegnerische Flotte/ Totenkopfflotte-->	
+	
+	<!-- Boxen um Flotte zu befreien -->
+
+	<?lua
+			for j = 0, 1, 1
+				  do       
+	?>
+		<?lua
+			for i = 0, 1, 1
+				  do       
+		?>
+
+			<Pawn health=10 position="<?lua print(25-i*50) ?>, <?lua print(116000) ?>,<?lua print(25-j*50) ?>" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Gravitation Box" >
+				<attached>
+					<Model position="0,0,0" scale="10" mesh="CuboidBody.mesh" />
+				</attached>
+				<collisionShapes>
+					<BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+				</collisionShapes>
+				<controller>
+					<WaypointController team=1>
+					</WaypointController>
+				</controller>
+			 </Pawn>
+				  
+		<?lua
+		end
+		?>
+								  
+	<?lua
+	end
+	?>
+	
+	<!-- Flotte Erde-->
+	<?lua
+			for j = 0, 2, 1
+				  do       
+	?>
+		<?lua
+			for i = 0, 2, 1
+				  do       
+		?>
+				
+
+			<SpaceShip position="<?lua print(50-i*50) ?>, <?lua print(116000) ?>,<?lua print(50-j*50) ?>" lookat="0,150000,0" maxhealt="200" initialhealth="200" >
+				<templates>
+				  <Template link=spaceshipassff2 /> <!--spaceshipTransporter -->
+				</templates>
+				  <controller>
+					 <WaypointPatrolController alertnessradius=1500 active=false team=0>
+					   <waypoints>
+						 <StaticEntity position="0,150000,0"/>
+					   </waypoints>
+				  <events>
+					  <activity>
+						  <EventListener event="atPortal1" />
+					  </activity>
+				  </events>
+					 </WaypointPatrolController>
+				  </controller>
+			</SpaceShip>
+   
+					
+		<?lua
+		end
+		?>
+				  
+	<?lua
+	end
+	?>
+					  
+	<!-- ENDE Flotte Erde-->
+			
+	<!--Portal-->
+		<Template name=PortalDefault>
+			<PortalEndPoint>
+				<attached>
+					<Model mesh="Spacegate.mesh" />
+				</attached>
+			</PortalEndPoint>
+		</Template>
+	
+		<PortalEndPoint position="0,112000,0" id="1" pitch="90" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+		<PortalEndPoint position="50,10250,0" id="2"  pitch="90" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+		<PortalLink fromID="1" toID="2" />
+		<PortalLink fromID="2" toID="1" />
+	<!--ENDE Portal-->
+	   
+	<!--Heimatplanet-->
+		<Planet
+		  position="0,100000,0"
+		  scale="10000"
+		  collisionType="dynamic"
+		  linearDamping="0.8"
+		  angularDamping="0"
+		  mass="5000000"
+		  pitch="0"
+		  yaw="0"
+		  roll="0"
+		  mesh="planets/earth.mesh"
+		  atmosphere="atmosphere1"
+		  rotationaxis="0,0,1"
+		  rotationrate="5.0"
+		  atmospheresize="80.0f"
+		  imagesize="1024.0f"
+		  collisiondamage = 1
+		  enablecollisiondamage = true
+		  >
+		  <attached>
+			  <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
 			</attached>
-		</PortalEndPoint>
-	</Template>
-
-	<PortalEndPoint position="0,100000,0" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
-	<PortalEndPoint position="50,10250,0" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
-	<PortalLink fromID="1" toID="2" />
-	<PortalLink fromID="2" toID="1" />
-<!--ENDE Portal-->
-   
-<!--Heimatplanet-->
-	<Planet
-	  position="0,111000,0"
-	  scale="10000"
-	  collisionType="dynamic"
-	  linearDamping="0.8"
-	  angularDamping="0"
-	  mass="5000000"
-	  pitch="0"
-	  yaw="0"
-	  roll="0"
-	  mesh="planets/earth.mesh"
-	  atmosphere="atmosphere1"
-	  rotationaxis="0,0,1"
-	  rotationrate="5.0"
-	  atmospheresize="80.0f"
-	  imagesize="1024.0f"
-	  collisiondamage = 2
-	  enablecollisiondamage = true
-	  >
-	  <attached>
-		  <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
-		</attached>
-		<collisionShapes>
-		  <SphereCollisionShape radius="10000" position="0,0,0" />
-		</collisionShapes>
-	  </Planet>	 
-<!--ENDE Heimatplanet-->	
+			<collisionShapes>
+			  <SphereCollisionShape radius="10000" position="0,0,0" />
+			</collisionShapes>
+		  </Planet>	 
+	<!--ENDE Heimatplanet-->	
 
   </Scene>
