Index: code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw
===================================================================
--- code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw	(revision 11541)
+++ code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw	(revision 11542)
@@ -69,7 +69,8 @@
         radarname = "Target" > 
       <attached>
+        <DistanceTriggerBeacon name="CargoShip" />
         <Model mesh="Transporterspaceship.mesh" mass=10000 position="0,0,0" scale=50 />
       </attached>
-      <collisionShapes>
+      <collisionShapes><!-- TODO: Change the collision shape -->
         <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
         <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
@@ -91,11 +92,43 @@
     </SpaceShip>
 
+    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,3000" distance=1000 target="SpaceShip" targetname="CargoShip" />
+
+    <!--DistanceTrigger name="passedAsteroidFieldOne" position="0,0,3000" distance=1000 targetname="CargoShip" target="SpaceShip"/-->
+
+    <StaticEntity postion="0,0,3000">
+      <attached>
+        <Model mesh="cokebottle.mesh" scale=10/>
+      </attached>
+    </StaticEntity>
+
+    <QuestEffectBeacon times=1>
+      <effects>
+        <CompleteQuest questId="ProtectBoss.AsteroidField" />
+      </effects>
+      <events>
+        <execute>
+          <EventListener event="passedAsteroidFieldOne" />
+        </execute>
+      </events>
+      <attached>
+        <DistanceTrigger name="passedAsteroidFieldOne" />
+      </attached>
+    </QuestEffectBeacon>
+
     <!-- create asteroids -->
     <?lua
-      for count = 1, 100, 1 do
+      for count = 1, 30, 1 do
         x = math.random(-1000, 1000)
         y = math.random(-1000, 1000)
         z = 125 * count + math.random(-250, 250)
-        print("<Pawn health=30 position=\"" .. x .. "," .. y .. "," .. z .. "\" direction=\"0,0,-1\" collisionType=dynamic mass=100 name=asteroid radarname=Asteroid> <!--events> <visibility> <EventListener event=flying4 /> </visibility> </events--> <attached> <Model position=\"0,0,0\" mesh=\"ast" .. math.random(6) .. ".mesh\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=4 /> </collisionShapes> <!--controller> <WaypointController team=1> </WaypointController> </controller--> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </Pawn>")
+        vmax = 10
+        rx = math.random(-vmax, vmax)
+        ry = math.random(-vmax, vmax)
+        rz = math.random(-vmax, vmax)
+        vx = math.random(-vmax, vmax)
+        vy = math.random(-vmax, vmax)
+        vz = math.random(-vmax, vmax)
+        rr = math.random() * 10
+        print("<Pawn health=30 position=\"" .. x .. "," .. y .. "," .. z .. "\" direction=\"0,0,-1\" velocity=\"" .. vx .. "," .. vy .. "," .. vz .. "\"rotationaxis=\"" .. rx .. "," .. ry .. "," .. rz .. "\" rotationrate=" .. rr .. " collisionType=dynamic mass=1 name=asteroid radarname=Asteroid> <!--events> <visibility> <EventListener event=flying4 /> </visibility> </events--> <attached> <Model position=\"0,0,0\" mesh=\"ast" .. math.random(6) .. ".mesh\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=4 /> </collisionShapes> <!--controller> <WaypointController team=1> </WaypointController> </controller--> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </Pawn>")
       end
     ?>
@@ -106,5 +139,5 @@
       </effects>
       <events>
-          <execute>
+        <execute>
           <EventListener event=spawntrigger />
         </execute>
@@ -122,8 +155,28 @@
     <LocalQuest id="ProtectBoss.AsteroidField">
         <QuestDescription title="Asteroid Field" description="The cargo ship in front of you is disabled and is drifting uncontrolled! Shoot the asteroids out of the way to protect it!" failmessage="The cargo ship has been hit!" completeMessage="" />
-        <!--complete-effects>
-            <AddQuest questId="missionOne.navigation" />
-        </complete-effects-->
+        <complete-effects>
+            <AddQuest questId="ProtectBoss.PirateAttack" />
+        </complete-effects>
     </LocalQuest>
+
+    <LocalQuest id="ProtectBoss.PirateAttack">
+      <QuestDescription title="Pirate Attack" description="Protect the cargo ship from the attacking pirates!" failmessage="The pirates boarded the cargo ship!" completeMessage="" />
+    </LocalQuest>
+
+    <SimpleNotification message="Quest 1 completed (test message)" broadcast = true>
+        <events>
+            <trigger>
+                <EventListener event="passedAsteroidFieldOne" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Spawntrigger (test message)" broadcast = true>
+        <events>
+            <trigger>
+                <EventListener event="spawntrigger" />
+            </trigger>
+        </events>
+    </SimpleNotification>
     
   </Scene>
