Index: /code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw
===================================================================
--- /code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw	(revision 11584)
+++ /code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw	(revision 11585)
@@ -55,12 +55,14 @@
     </EventMultiTrigger>
     
-    <SpaceShip
+    <Pawn
         team      = 0
+        collisionType = kinematic
         position  = "0,0,-2500"
         mass      = 10000
-        health    = 100000 initialhealth=100000 maxhealth="100000"
+        health    = 1000 initialhealth=1000 maxhealth="1000"
+        direction = "1,0,0"
         rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30"
-        name      = "target"
-        radarname = "Target" > 
+        name      = "CargoShip"
+        radarname = "Cargo Ship" >
       <attached>
         <DistanceTriggerBeacon name="CargoShip" />
@@ -72,8 +74,36 @@
         <BoxCollisionShape position="-100,-50,280" halfExtents="220,70,100" />
       </collisionShapes>
-    </SpaceShip>
+      <explosion>
+        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+        <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+        <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+   
+        <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart delay=0.8 scale = 2.5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart delay=0.8 scale = 2.5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+        <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+       
+        <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+        <ExplosionPart offset="30,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+        <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+        <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+      </explosion>
+    </Pawn>
 
     <!-- triggers when first quest is completed -->
-    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,-3000" distance=1000 target="SpaceShip" targetname="CargoShip" />
+    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,3000" distance=1000 target="Pawn" targetname="CargoShip" />
 
     <!-- create asteroids -->
@@ -91,5 +121,5 @@
         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=5 /> </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>")
+        print("<Pawn team=1 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=5 /> </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
     ?>
@@ -111,9 +141,9 @@
       <effects>
         <CompleteQuest questId="ProtectBoss.AsteroidField" />
-        <AddQuest questId="ProtectBoss.PirateAttack" />
+        <!--AddQuest questId="ProtectBoss.PirateAttack" /-->
       </effects>
       <events>
         <execute>
-          <EventListener event="passedAsteroidFieldOne" />
+          <EventListener event=passedAsteroidFieldOne />
         </execute>
       </events>
@@ -130,7 +160,7 @@
     <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>
+        <complete-effects>
             <AddQuest questId="ProtectBoss.PirateAttack" />
-        </complete-effects-->
+        </complete-effects>
     </LocalQuest>
 
@@ -139,5 +169,5 @@
     </LocalQuest>
 
-    <SimpleNotification message="Quest 1 completed (test message)">
+    <SimpleNotification message="Pirates are attacking!" broadcast="true" >
         <events>
             <trigger>
@@ -147,28 +177,25 @@
     </SimpleNotification>
 
-    <SpaceShip position="0,0,3500" lookat="-1300,-600,900" name="Pirate" radarname="Pirate" visible="true">
-        <events>
-            <visibility>
-                <EventListener event="passedAsteroidFieldOne" />
-            </visibility>
+    <SimpleNotification message="The cargo ship got destroyed!" broadcast=true >
+      <events>
+            <trigger>
+                <EventListener event="CargoShip" />
+            </trigger>
         </events>
-        <templates>
-            <Template link=spaceshippirate /> <!--spaceshipTransporter -->
-        </templates>
-        <controller>
-            <WaypointPatrolController alertnessradius=3129 team=1 active=false>
-                <waypoints>
-                    <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
-                    <Model mesh="cube.mesh" scale=0 position="0,0,0" />
-                </waypoints>
-                <events>
-                    <activity>
-                        <EventListener event="attack" /> <!-- activates enemies-->
-                     </activity>
-                </events>
-            </WaypointPatrolController>
-        </controller>
-    </SpaceShip>
-    
+    </SimpleNotification>
+
+    <!-- A function to put pirates to a certain location -->
+    <?lua
+      function placePirate(posX, posY, posZ, trigger)
+        print("<SpaceShip mass=10 position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\" name=Pirate radarname=Pirate><events><visibility><EventListener event=\"" .. trigger .. "\"/></visibility><activity><EventListener event=\"" .. trigger .. "\"/></activity></events><templates><Template link=spaceshippirate /></templates><controller><WaypointPatrolController alertnessradius=3129 team=1 active=false><waypoints><Model mesh=\"cube.mesh\" scale=0 position=\"-1300,-600,900\" /><Model mesh=\"cube.mesh\" scale=0 position=\"0,0,0\" /></waypoints><events><activity><EventListener event=attack /></activity></events></WaypointPatrolController></controller></SpaceShip>")
+      end
+    ?>
+
+    <?lua
+      placePirate(0, 0, 5500, "passedAsteroidFieldOne")
+      placePirate(0, 0, 6500, "passedAsteroidFieldOne")
+      placePirate(0, 0, 7500, "passedAsteroidFieldOne")
+    ?>
+
   </Scene>
 </Level>
