Index: code/branches/levelMichael/data/levels/Spacefight.oxw
===================================================================
--- code/branches/levelMichael/data/levels/Spacefight.oxw	(revision 9872)
+++ code/branches/levelMichael/data/levels/Spacefight.oxw	(revision 9873)
@@ -3,7 +3,15 @@
 <!--
 To Do:
+- Bigger Way for guard 3 (sonst im Mainship)
+- Spawnpoint 3
+- Discuss between Player and Captain Hood
+- Scout-way
 - Different Colors of the light!
 - If possible, do the spion with DistanceTriggerBeacon
-- More health for spacestations
+- Place the explosion right (time an place)
+- also place the docking-Trigger
+- bigger explosion?
+- collisionShape for mainship
+- DistanceTriggerBeacon for Captain Hood
 -->
 
@@ -61,29 +69,27 @@
   <?lua include("includes/pickups.oxi") ?>
 
- <Script code="showGUI NotificationLayer false true" needsGraphics="true" />
- <OverlayGroup name="spacefightHUD" scale = "1, 1">
- <CountDown
-     position    = "0.49, 0.05"
+<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
+<OverlayGroup name="spacefightHUD" scale = "1, 1">
+  <CountDown
+     position    = "0.51, 0.05"
      pickpoint   = "0.0, 0.0"
      font        = "ShareTechMono"
-     textsize    = 0.06
+     textsize    = 0.1
      colour      = "1.0, 1.0, 1.0, 1.0"
-     align       = "right"                  
+     align       = "center"                  
      counter     = "10.0"
-     speedfactor = "2.0"
+     speedfactor = "1.0"
      active      = "false"
   >
-      <events>
-          <activity>
-              <EventListener event="spawntrigger2" />
-          </activity>
-      </events>
- </CountDown>
- </OverlayGroup>
+    <events>
+      <activity>
+        <EventListener event="timer1" />
+      </activity>
+    </events>
+  </CountDown>
+</OverlayGroup>
 
 <!-- SPAWNTRIGGER -->
-
-<!-- Spawntrigger -->
-	<!-- StartPoint -->  
+	<!-- StartPoint -->
 	<SpawnPoint team=0 position="0, 0, 0" lookat="100,0,0" spawnclass=SpaceShip pawndesign=spaceshipswallow > <!-- pawndesign=spaceshipcollateraldamage -->
           <events>
@@ -103,19 +109,32 @@
 
 	<!-- Second Spawnpoint (after first guard) -->
-	<SpawnPoint team=0 position="13500, 2500, 10500" lookat="18000,5000,18000" spawnclass=SpaceShip pawndesign=spaceshipswallow delay=0.1><!-- pawndesign=spaceshipcollateraldamage -->
+	<SpawnPoint team=0 position="13500, 2500, 10500" lookat="18000,5000,18000" spawnclass=SpaceShip pawndesign=spaceshipswallow > <!-- pawndesign=spaceshipcollateraldamage -->
 	  <events>
             <activity>
-              <EventListener event="flying1" />
+	      <EventTrigger>
+		<EventTrigger invert=true >
+		  <events>
+		    <trigger>
+		      <EventListener event="reached" />
+		    </trigger>
+		  </events>
+		</EventTrigger>
+		<events>
+		  <trigger>
+                    <EventListener event="flying1" />
+		  </trigger>
+		</events>
+	      </EventTrigger>
             </activity>
-          </events> -->
+          </events>
         </SpawnPoint>
 	
-	<!-- Thirth Spawnpoint (when reached Captain Hood) -->
-	<SpawnPoint team=0 position="-4000, -18000, 19000" lookat="-12000, -22000, 25000" spawnclass=SpaceShip pawndesign=spaceshipswallow delay=0.1><!-- pawndesign=spaceshipcollateraldamage -->
+	<!-- Thirth Spawnpoint (when reached Captain Hood) --
+	<SpawnPoint team=0 position="-4000, -18000, 19000" lookat="-12000, -22000, 25000" spawnclass=SpaceShip pawndesign=spaceshipswallow /> <!-- pawndesign=spaceshipcollateraldamage --
 	  <events>
             <activity>
-              <EventListener event="reached" />
+	      <EventListener event="reached" />
             </activity>
-          </events> -->
+          </events>
         </SpawnPoint>
 
@@ -540,5 +559,14 @@
 
 	<!-- Helper-Trigger for Captain Hood -->
-	<DistanceTrigger name="reached" position="10000, 2000, 17000" target="SpaceShip" distance=1000 stayActive="true" delay=0.1 />
+	<DistanceTrigger name="reached" position="10000, 2000, 17000" target="SpaceShip" distance=1000 stayActive="true" delay=0.1 >
+		<EventTrigger>
+			<events>
+				<trigger>
+					<EventListener event="guard2trigger4" />
+				</trigger>
+			</events>
+		</EventTrigger>
+	</DistanceTrigger>
+
 	<SimpleNotification message="Follow Captain Hood!"  broadcast="true">
 		<events>
@@ -600,6 +628,102 @@
 	</SimpleNotification>
 
+	<!-- End of Mainfight -->
+	<DistanceTrigger name="victory" position="-12000, -22000, 25000" target="SpaceShip" distance=10000 stayActive="true" delay=0.1 >
+		<EventTrigger>
+			<events>
+				<trigger>
+					<EventListener event="guard3trigger4" />
+				</trigger>
+			</events>
+		</EventTrigger>
+	</DistanceTrigger>
+
 	<!-- Rescue the commander -->
-	<DistanceTrigger name="dock" position="-12100, -22000, 25000" target="SpaceShip" distance=100 stayActive="true" delay=0 />
+	<BlinkingBillboard position="-11800, -22090, 24900" color="1.0, 1.0, 0.05" frequency=0.5 amplitude=5 material="Examples/Flare" >
+	  <events>
+	    <visibility>
+	      <EventTrigger>
+		<EventTrigger invert=true>
+		  <events>
+		    <trigger>
+		      <EventListener event="dock" />
+		    </trigger>
+		  </events>
+		</EventTrigger>
+	        <events>
+	          <trigger>
+	            <EventListener event="victory" />
+	          </trigger>
+	        </events>
+	      </EventTrigger>
+	    </visibility>
+	  </events>
+	</BlinkingBillboard>
+	
+	<DistanceTrigger name="dock" position="-11800, -22090, 24900" target="SpaceShip" distance=50 stayActive="true" delay=0 />
+	<SimpleNotification message="The Commander is on board!"  broadcast="true">
+		<events>
+			<trigger>
+				<EventListener event="dock" />
+			</trigger>
+		</events>
+	</SimpleNotification>
+
+    <EventTrigger name="dockdelay1" activations="1" stayactive="true" delay=5 >
+      <events>
+        <trigger>
+          <EventListener event="dock" />
+        </trigger>
+      </events>
+    </EventTrigger>
+
+    <EventTrigger name="dockdelay2" activations="1" stayactive="true" delay=5.1 >
+      <events>
+        <trigger>
+          <EventListener event="dock" />
+        </trigger>
+      </events>
+    </EventTrigger>
+
+	<SimpleNotification message="You have 10 seconds to move away..."  broadcast="true">
+		<events>
+			<trigger>
+				<EventListener event="dockdelay1" />
+			</trigger>
+		</events>
+	</SimpleNotification>
+
+	<SimpleNotification message="A bomb is placed in the mainship..."  broadcast="true">
+		<events>
+			<trigger>
+				<EventListener event="dockdelay2" />
+			</trigger>
+		</events>
+	</SimpleNotification>
+
+	<!-- TIMER-EVENTS -->
+    <EventTrigger name="timer1" activations="1" stayactive="true" delay=5 >
+      <events>
+        <trigger>
+          <EventListener event="dockdelay2" />
+        </trigger>
+      </events>
+    </EventTrigger>
+
+    <EventTrigger name="timerEnd" activations="1" stayactive="true" delay=10 >
+      <events>
+        <trigger>
+          <EventListener event="timer1" />
+        </trigger>
+      </events>
+    </EventTrigger>
+
+    <EventTrigger name="negativeTimerEnd" invert="true" delay=0 >
+      <events>
+        <trigger>
+          <EventListener event="timerEnd" />
+        </trigger>
+      </events>
+    </EventTrigger>
 
 <!-- ----------------------------------------------------- -->
@@ -723,7 +847,5 @@
 	
 <!-- ----------------------------------------------------- -->
-
 <!-- Passive Piraten: Guard 1 -->
-
 <SpaceShip position="8000,1000,0" lookat="-1,0,0" name="firstPatrol" radarname="Patrol">
   <events>
@@ -766,5 +888,4 @@
 
 <!-- Angreiffende Piraten: Guard 1 -->
-
 <SpaceShip position="8000,-1000,1000" lookat="8000,1000,-1000" name="firstPatrol" visible="true" radarname="Patrol" >
   <events>
@@ -819,5 +940,5 @@
   <events>
     <visibility>
-      <EventListener event="guard1trigger4" /> <!-- guard1trigger4 -->
+      <EventListener event="guard1trigger4" />
     </visibility>
   </events>
@@ -849,5 +970,5 @@
   <events>
     <visibility>
-      <EventListener event="guard1trigger4" /> <!-- guard1trigger4 -->
+      <EventListener event="guard1trigger4" />
     </visibility>
   </events>
@@ -879,5 +1000,5 @@
   <events>
     <visibility>
-      <EventListener event="guard1trigger4" /> <!-- guard1trigger4 -->
+      <EventListener event="guard1trigger4" />
     </visibility>
   </events>
@@ -909,5 +1030,5 @@
   <events>
     <visibility>
-      <EventListener event="guard1trigger4" /> <!-- guard1trigger4 -->
+      <EventListener event="guard1trigger4" />
     </visibility>
   </events>
@@ -1161,7 +1282,7 @@
     <WaypointPatrolController alertnessradius=2000 team=0 active=false>
       <waypoints>
-        <Model mesh="cube.mesh" scale=100 position="0, -1000, 18000" />
-	<Model mesh="cube.mesh" scale=100 position="-4000, -18000, 19000" />
-	<Model mesh="cube.mesh" scale=100 position="-11500, -22000, 25000" />
+        <Model mesh="cube.mesh" scale=0 position="0, -1000, 18000" />
+	<Model mesh="cube.mesh" scale=0 position="-4000, -18000, 19000" />
+	<Model mesh="cube.mesh" scale=0 position="-11500, -22000, 25000" />
       </waypoints>
       <events>
@@ -1195,5 +1316,5 @@
 </BlinkingBillboard>
 
-<SimpleNotification message="Your friend, Captain Hood, is dead..."  broadcast="true">
+<SimpleNotification message="Your friend Captain Hood is dead..."  broadcast="true">
 	<events>
 		<trigger>
@@ -1211,5 +1332,5 @@
 </EventTrigger>
 
-<SimpleNotification message="He died in a fight, like he wished it!"  broadcast="true">
+<SimpleNotification message="He died in a fight like he wished it!"  broadcast="true">
 	<events>
 		<trigger>
@@ -1221,5 +1342,6 @@
 <!-- ----------------------------------------------------- -->
 
-<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"/>
+<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" />
+
 
 
@@ -1318,11 +1440,79 @@
 
 <!-- ------------------------- Mainship ------------------ -->
-	<StaticEntity position="-12000, -22000, 25000" collisionType=static yaw=112 pitch=67 >
-	  <attached>
-	    <?lua
-	      createSpaceStationPar(0,2,1,2,1,4,1,50)
-	    ?>
-	  </attached>
-	</StaticEntity>
+    <SpaceShip
+        team      = 1
+        position  = "-12000, -22000, 25000"
+        mass      = 10000
+        health    = 100000 initialhealth=100000 maxhealth="100000"
+        name      = "Mainship"
+        radarname = "Mainship" 
+	visible	  = "true" >
+      <attached>
+        <Model scale=250 mesh="drone.mesh" position = "0,0,0" lookat="40000, 4000, 27000" />
+   <!-- <Model mesh="cube.mesh" mass=10 position="-560,0,0" scale3D="115,100,245"  />
+        <Model mesh="cube.mesh" mass=10 position="290,0,-480" scale3D="115,100,245" yaw=-120 />
+        <Model mesh="cube.mesh" mass=10 position="290,0,480" scale3D="115,100,245" yaw=-240 />
+        <Model mesh="cube.mesh" mass=10 position="-280,0,0" scale3D="163,50,50" />
+        <Model mesh="cube.mesh" mass=10 position="140,0,-240" scale3D="163,50,50"  yaw=-120/>
+        <Model mesh="cube.mesh" mass=10 position="140,0,240" scale3D="163,50,50" yaw=-240/>
+        <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" />
+        <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-120/>
+        <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-240/>
+        <Model mesh="cube.mesh" mass=10 position="0,400,0" scale3D="43,110,26" yaw=-30 />
+        <Model mesh="cube.mesh" mass=10 position="-200,100,0" scale3D="26,50,43" />
+        <Model mesh="cube.mesh" mass=10 position="100,100,-173" scale3D="43,50,26" yaw=-30/>
+        <Model mesh="cube.mesh" mass=10 position="100,100,173" scale3D="43,50,26" yaw=30/>
+        <Model mesh="cube.mesh" mass=10 position="-100,264,0" scale3D="26,105,43" roll=-49/>
+        <Model mesh="cube.mesh" mass=10 position="50,264,-87" scale3D="26,105,43" roll=-49 yaw=-120/>
+        <Model mesh="cube.mesh" mass=10 position="50,264,87" scale3D="26,105,43" roll=-49 yaw=-240/>     -->
+      </attached>
+      <collisionShapes>
+  <!--  <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes --
+        <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+        <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+        <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections --
+        <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+        <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower --
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+        <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one--
+        <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs --
+        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+        <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs --
+        <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+        <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 /> -->
+      </collisionShapes>
+      <events>
+        <visibility>
+	  <EventListener event="negativeTimerEnd" />
+        </visibility>
+      </events>
+    </SpaceShip>
+
+    <!-- PARTICLE EFFECT -->
+
+    <ParticleSpawner position="-12000, -22000, 25000" source="Orxonox/RingExp" autostart="false" lifetime=500 loop=0 startdelay=2.5>
+        <events>
+            <spawn>
+                <EventListener event="timerEnd" />
+            </spawn>
+        </events>
+    </ParticleSpawner>
+    <ParticleSpawner position="-12000, -22000, 25000" source="Orxonox/RingExp2" autostart="false" lifetime=500 loop=0 startdelay=2>
+        <events>
+            <spawn>
+                <EventListener event="timerEnd" />
+            </spawn>
+        </events>
+    </ParticleSpawner>
+    <ParticleSpawner position="-12000, -22000, 25000" source="Orxonox/RingExp3" autostart="false" lifetime=500 loop=0 startdelay=2>
+        <events>
+            <spawn>
+                <EventListener event="timerEnd" />
+            </spawn>
+        </events>
+    </ParticleSpawner>
 
   </Scene>
