Index: code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw
===================================================================
--- code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw	(revision 11556)
+++ code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw	(revision 11557)
@@ -17,4 +17,5 @@
   include("templates/spaceshipAssff.oxt")
   include("templates/endurancetest_template.oxt")
+  include("templates/spaceshipPirate.oxt")
 ?>
 
@@ -45,4 +46,5 @@
 
     <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"/>
+
     <EventMultiTrigger name=spawntrigger>
       <events>
@@ -52,12 +54,5 @@
       </events>
     </EventMultiTrigger>
-
-    <!-- Cargo ship / target -->
-    <!--MovableEntity collisionType=kinematic linearDamping=0.8 angularDamping=0 mass="100" position="0,0,-2500" rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30" radarname="Target">
-    <attached>
-        <Model scale="<?lua print(math.random(20,70)) ?>" mesh="Transporterspaceship.mesh" shadow=false/>
-    </attached>
-    </MovableEntity-->
-
+    
     <SpaceShip
         team      = 0
@@ -70,49 +65,15 @@
       <attached>
         <DistanceTriggerBeacon name="CargoShip" />
-        <Model mesh="Transporterspaceship.mesh" mass=10000 position="0,0,0" scale=50 />
+        <Model mesh="escortShip.mesh" mass=10000 position="0,0,0" scale=100 />
       </attached>
-      <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 />
-        <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>
+        <BoxCollisionShape position="0,0,0" halfExtents="300,100,200" /> <!-- laenge  ,   dicke    , breite -->
+        <BoxCollisionShape position="-100,-50,-280" halfExtents="220,70,100" />
+        <BoxCollisionShape position="-100,-50,280" halfExtents="220,70,100" />
       </collisionShapes>
     </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>
+    <!-- triggers when first quest is completed -->
+    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,-3000" distance=1000 target="SpaceShip" targetname="CargoShip" />
 
     <!-- create asteroids -->
@@ -122,5 +83,5 @@
         y = math.random(-1000, 1000)
         z = 125 * count + math.random(-250, 250)
-        vmax = 10
+        vmax = 7
         rx = math.random(-vmax, vmax)
         ry = math.random(-vmax, vmax)
@@ -130,8 +91,9 @@
         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>")
+        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>")
       end
     ?>
 
+    <!-- start first quest -->
     <QuestEffectBeacon times=1>
       <effects>
@@ -141,4 +103,17 @@
         <execute>
           <EventListener event=spawntrigger />
+        </execute>
+      </events>
+    </QuestEffectBeacon>
+
+    <!-- start second quest (doesn't work yet) -->
+    <QuestEffectBeacon times=1>
+      <effects>
+        <CompleteQuest questId="ProtectBoss.AsteroidField" />
+        <AddQuest questId="ProtectBoss.PirateAttack" />
+      </effects>
+      <events>
+        <execute>
+          <EventListener event="passedAsteroidFieldOne" />
         </execute>
       </events>
@@ -155,7 +130,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>
 
@@ -164,5 +139,5 @@
     </LocalQuest>
 
-    <SimpleNotification message="Quest 1 completed (test message)" broadcast = true>
+    <SimpleNotification message="Quest 1 completed (test message)">
         <events>
             <trigger>
@@ -172,11 +147,27 @@
     </SimpleNotification>
 
-    <SimpleNotification message="Spawntrigger (test message)" broadcast = true>
+    <SpaceShip position="0,0,3500" lookat="-1300,-600,900" name="Pirate" radarname="Pirate" visible="true">
         <events>
-            <trigger>
-                <EventListener event="spawntrigger" />
-            </trigger>
+            <visibility>
+                <EventListener event="passedAsteroidFieldOne" />
+            </visibility>
         </events>
-    </SimpleNotification>
+        <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>
     
   </Scene>
