Index: code/branches/levelMichael/data/levels/Spacefight.oxw
===================================================================
--- code/branches/levelMichael/data/levels/Spacefight.oxw	(revision 9784)
+++ code/branches/levelMichael/data/levels/Spacefight.oxw	(revision 9785)
@@ -172,4 +172,10 @@
 			completeMessage="YEEEHAAA!
 				You managed it! For that you will get the golden medal of the united space armies." />
+		<complete-effects>
+			<AddQuest questId="spacefight.rescue" />
+			<!--
+			<BlinkingBillboard position="-12100, -22000, 25000" color="1.0,1.0,1.0" frequency=0.6 amplitude=2 material="Examples/Flare" visibility="true" />
+			-->
+		</complete-effects>
 	</LocalQuest>
 
@@ -186,4 +192,10 @@
 			completeMessage="YEEEHAAA!
 				You managed it! For that you will get the golden medal of the united space armies." />
+		<complete-effects>
+			<AddQuest questId="spacefight.rescue" />
+			<!--
+			<BlinkingBillboard position="-12100, -22000, 25000" color="1.0,1.0,1.0" frequency=0.6 amplitude=2 material="Examples/Flare" visibility="true" />
+			-->
+		</complete-effects>
 	</LocalQuest>
 <!-- -->
@@ -192,7 +204,10 @@
 		<QuestDescription
 			title="Rescue and place the bomb"
-			description="Now you have to free the commander and place the bomb."
+			description="Now you have to free the commander and place a bomb in the pirates' mainship."
 			failMessage="You've lost all your ships!"
 			completeMessage="" />
+		<complete-effects>
+			<AddQuest questId="spacefight.moveAway" />
+		</complete-effects>
 	</LocalQuest>
 
@@ -205,4 +220,7 @@
 	</LocalQuest>
 
+	<!-- GRAND EXPLOSION IF POSSIBLE -->
+	<!-- Next Part -->
+
 	
 <!-- ---------------------------------------------------------------------- -->
@@ -245,5 +263,5 @@
 	</QuestEffectBeacon>
 
-	<BlinkingBillboard position="13500, 2500, 10500" color="1,1,1" frequency=0.6 amplitude=10 material="Examples/Flare" >
+	<BlinkingBillboard position="13500, 2500, 10500" color="1.0,1.0,1.0" frequency=0.6 amplitude=10 material="Examples/Flare" >
           <events>
             <visibility>
@@ -353,4 +371,53 @@
 	</QuestEffectBeacon>
 
+	<!-- LAST FIGHT -->
+	<!-- Spion destroyed -->
+	<QuestEffectBeacon>
+		<effects>
+			<CompleteQuest questId="spacefight.mainfight(min)" />
+		</effects>
+		<events>
+			<execute>
+				<EventListener event="guard3trigger4" />
+			</execute>
+		</events>
+	</QuestEffectBeacon>
+
+	<!-- Spion escaped -->
+	<QuestEffectBeacon>
+		<effects>
+			<CompleteQuest questId="spacefight.mainfight(max)" />
+		</effects>
+		<events>
+			<execute>
+				<EventListener event="guard3trigger6" />
+			</execute>
+		</events>
+	</QuestEffectBeacon>
+
+	<!-- COMMANDER RESCUE -->
+	<QuestEffectBeacon>
+		<effects>
+			<CompleteQuest questId="spacefight.rescue" />
+		</effects>
+		<events>
+			<execute>
+				<EventListener event="dock" />
+			</execute>
+		</events>
+	</QuestEffectBeacon>
+
+	<!-- FLY AWAY -->
+	<QuestEffectBeacon>
+		<effects>
+			<CompleteQuest questId="spacefight.moveAway" />
+		</effects>
+		<events>
+			<execute>
+				<EventListener event="" />
+			</execute>
+		</events>
+	</QuestEffectBeacon>
+
 <!-- ---------------------------------------------------------------------- -->
 	<!--Helper-Trigger for first guard -->
@@ -394,5 +461,7 @@
 			</trigger>
 		</events>
-	</SimpleNotification>	
+	</SimpleNotification>
+
+	<DistanceTrigger name="dock" position="-12100, -22000, 25000" target="SpaceShip" distance=100 stayActive="true" delay=0 />
 
 <!-- ----------------------------------------------------- -->
@@ -536,16 +605,4 @@
 
 <!-- For Escape -->
-	<!-- If the spion is escaped -->
-	<Trigger name="escaped" mode="xor" stayActive="true" >
-		<DistanceTrigger position="-7000,-10000,42000" target="SpaceShip" distance=100 stayActive="true" delay=0 />
-		<EventTrigger activations="1" >
-			<events>
-				<trigger>
-					<EventListener event="spion" />
-				</trigger>
-			</events>
-		</EventTrigger>
-	</Trigger>
-
 	<!-- If the spion is destroyed -->
 	<Trigger name="notEscaped" mode="xor" stayActive="true" >
@@ -563,5 +620,49 @@
 			</EventTrigger>
 		</Trigger>
-	</Trigger>		
+	</Trigger>
+
+<!-- For last fight -->
+    <EventTrigger name="guard3trigger5" activations="1" stayactive="true" delay=0.1 >
+      <events>
+        <trigger>
+          <EventListener event="lastGuard" />
+        </trigger>
+      </events>
+      <EventTrigger name="guard3trigger5" activations="1" stayactive="true" delay=0.1 >
+        <events>
+          <trigger>
+            <EventListener event="lastGuard" />
+          </trigger>
+        </events>
+        <EventTrigger name="guard3trigger4" activations="1" stayactive="true" delay=0.1 >
+          <events>
+            <trigger>
+              <EventListener event="lastGuard" />
+            </trigger>
+          </events>
+          <EventTrigger name="guard3trigger3" activations="1" stayactive="true" delay=0.1 >
+            <events>
+              <trigger>
+                <EventListener event="lastGuard" />
+              </trigger>
+            </events>
+	    <EventTrigger name="guard3trigger2" activations="1" stayactive="true" delay=0.1 >
+	      <events>
+		<trigger>
+		  <EventListener event="lastGuard" />
+		</trigger>
+	      </events>
+	      <EventTrigger name="guard3trigger1" activations="1" stayactive="true" delay=0.1 >
+		<events>
+		  <trigger>
+		    <EventListener event="lastGuard" />
+		  </trigger>
+		</events>
+	      </EventTrigger>
+	    </EventTrigger>
+          </EventTrigger>
+        </EventTrigger>
+      </EventTrigger>
+    </EventTrigger>			
 	
 <!-- ----------------------------------------------------- -->
@@ -783,5 +884,5 @@
   <events>
     <visibility>
-      <EventListener event="flying2" /> <!-- "guard1trigger4" -->
+      <EventListener event="guard1trigger4" />
     </visibility>
   </events>
@@ -793,5 +894,5 @@
       <waypoints>
         <Model mesh="cube.mesh" scale=1000 position="-7000,-10000,42000" />
-        <Model mesh="cube.mesh" scale=0 position="-12000, -22000, 25000" />
+        <Model mesh="cube.mesh" scale=1 position="-12000, -22000, 25000" />
       </waypoints>
       <events>
@@ -806,8 +907,8 @@
 <!-- Mainship - Pirates -->
 
-<SpaceShip position="-12000, -22000, 26000" lookat="-12000, -22000, 25000" name="spion" visible="true" radarname="Spion" >
-  <events>
-    <visibility>
-      <EventListener event=spawntrigger2 /> <!-- "guard1trigger4" -->
+<SpaceShip position="-12000, -22000, 26000" lookat="-12000, -22000, 25000" name="lastGuard" visible="true" radarname="Pirate" >
+  <events>
+    <visibility>
+      <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
     </visibility>
   </events>
@@ -829,5 +930,5 @@
       <events>
 	<activity>
-	  <EventListener event="guard2trigger1" />
+	  <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
 	</activity>
       </events>
@@ -836,8 +937,8 @@
 </SpaceShip>
 
-<SpaceShip position="-12000, -21000, 25000" lookat="-12000, -22000, 25000" name="spion" visible="true" radarname="Spion" >
-  <events>
-    <visibility>
-      <EventListener event=spawntrigger2 /> <!-- "guard1trigger4" -->
+<SpaceShip position="-12000, -21000, 25000" lookat="-12000, -22000, 25000" name="lastGuard" visible="true" radarname="Pirate" >
+  <events>
+    <visibility>
+      <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
     </visibility>
   </events>
@@ -859,5 +960,5 @@
       <events>
 	<activity>
-	  <EventListener event="guard2trigger1" />
+	  <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
 	</activity>
       </events>
@@ -866,8 +967,8 @@
 </SpaceShip>
 
-<SpaceShip position="-12000, -22000, 24000" lookat="-12000, -22000, 25000" name="spion" visible="true" radarname="Spion" >
-  <events>
-    <visibility>
-      <EventListener event=spawntrigger2 /> <!-- "guard1trigger4" -->
+<SpaceShip position="-12000, -22000, 24000" lookat="-12000, -22000, 25000" name="lastGuard" visible="true" radarname="Pirate" >
+  <events>
+    <visibility>
+      <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
     </visibility>
   </events>
@@ -889,5 +990,5 @@
       <events>
 	<activity>
-	  <EventListener event="guard2trigger1" />
+	  <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
 	</activity>
       </events>
@@ -896,8 +997,8 @@
 </SpaceShip>
 
-<SpaceShip position="-12000, -23000, 25000" lookat="-12000, -22000, 25000" name="spion" visible="true" radarname="Spion" >
-  <events>
-    <visibility>
-      <EventListener event=spawntrigger2 /> <!-- "guard1trigger4" -->
+<SpaceShip position="-12000, -23000, 25000" lookat="-12000, -22000, 25000" name="lastGuard" visible="true" radarname="Pirate" >
+  <events>
+    <visibility>
+      <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
     </visibility>
   </events>
@@ -919,5 +1020,5 @@
       <events>
 	<activity>
-	  <EventListener event="guard2trigger1" />
+	  <EventListener event=spawntrigger2 /> <!-- "guard2trigger4" -->
 	</activity>
       </events>
@@ -927,8 +1028,8 @@
 
 <!-- Additional pirates if the spion has warned the mainship -->
-<SpaceShip position="-11700, -21700, 25000" lookat="-12000, -22000, 25000" name="spion" visible="true" radarname="Spion" >
-  <events>
-    <visibility>
-      <EventListener event=spawntrigger2 /> <!-- "guard1trigger4" -->
+<SpaceShip position="-11700, -21700, 25000" lookat="-12000, -22000, 25000" name="lastGuard" visible="true" radarname="Pirate" >
+  <events>
+    <visibility>
+      <EventListener event=spawntrigger2 /> <!-- "escaped" -->
     </visibility>
   </events>
@@ -950,5 +1051,5 @@
       <events>
 	<activity>
-	  <EventListener event="guard2trigger1" />
+	  <EventListener event=spawntrigger2 /> <!-- "escaped" -->
 	</activity>
       </events>
@@ -957,8 +1058,8 @@
 </SpaceShip>
 
-<SpaceShip position="-12700, -22700, 25000" lookat="-12000, -22000, 25000" name="spion" visible="true" radarname="Spion" >
-  <events>
-    <visibility>
-      <EventListener event=spawntrigger2 /> <!-- "guard1trigger4" -->
+<SpaceShip position="-12700, -22700, 25000" lookat="-12000, -22000, 25000" name="lastGuard" visible="true" radarname="Pirate" >
+  <events>
+    <visibility>
+      <EventListener event=spawntrigger2 /> <!-- "escaped" -->
     </visibility>
   </events>
@@ -980,5 +1081,5 @@
       <events>
 	<activity>
-	  <EventListener event="guard2trigger1" />
+	  <EventListener event=spawntrigger2 /> <!-- "escaped" -->
 	</activity>
       </events>
