Index: code/branches/presentationHS15/data/levels/AITest.oxw
===================================================================
--- code/branches/presentationHS15/data/levels/AITest.oxw	(revision 10970)
+++ code/branches/presentationHS15/data/levels/AITest.oxw	(revision 10970)
@@ -0,0 +1,351 @@
+<LevelInfo
+ name = "New AI testing level"
+ description = "A level with two opposing new AI teams"
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipEscort.oxt")
+  include("templates/spaceshipRing.oxt")
+  include("templates/spaceshipSwallow.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+    <?lua
+      include("includes/pickups.oxi")
+    ?>
+    <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"/>
+    <TeamSpawnPoint team=0 position="2000, 2000, 2000" lookat="1,1,-1" spawnclass=SpaceShip pawndesign=spaceshipassff />
+       
+    <Pawn position = "100000, 100000, 100000">
+      <controller>
+        <MasterController>
+        </MasterController>
+      </controller>
+    </Pawn>
+<!--     
+    <PickupSpawner pickup=largedamageboostpickup position="0,0,0" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=crazyhealthpickup position="0,0,0" triggerDistance="50" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=hugeshieldpickup position="4000,4500, 4500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+<PickupSpawner pickup=smalljumppickup position="6500,6500, 6000" triggerDistance="20" respawnTime="10" maxSpawnedItems="99" />
+<PickupSpawner pickup=largedamageboostpickup position="9500,9500, 9500" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=largedamageboostpickup position="13000,13000,13000" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+ -->
+<!-- HERE STARTS DEMO FOR THE "WAYPOINTS" -->
+      <!-- 
+    <SpaceShip position="-1500, -1500, -1500" lookat="0,0,0" team=0 name="ss1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=1 formationMode="finger4">
+          <actionpoints>
+            <Model mesh="cube.mesh" scale=8 position="  0,2000,-600" />
+            <Model mesh="cube.mesh" scale=8 position="  0,2000,-1000" />
+            <Model mesh="cube.mesh" scale=8 position="400,2000,-1000" />
+            <Model mesh="cube.mesh" scale=8 position="400,2000,-600" />
+          </actionpoints>
+        </DivisionController>
+      </controller>
+    </SpaceShip> 
+ -->
+    <!-- those two are same -->
+
+ <!--    
+    <Model mesh="cube.mesh" scale=8 position="  0,2000,-600" />
+    <Model mesh="cube.mesh" scale=8 position="  0,2000,-1000" />
+    <Model mesh="cube.mesh" scale=8 position="400,2000,-1000" />
+    <Model mesh="cube.mesh" scale=8 position="400,2000,-600" />
+    <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="ss1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="finger4">
+          <actionpoints>
+            <Actionpoint position="  0,2000,-600" action="FLY" loopStart=true/>
+            <Actionpoint position="  0,2000,-1000" action="FLY"  />
+            <Actionpoint position="400,2000,-1000" action="FLY" />
+            <Actionpoint position="400,2000,-600" action="FLY" loopEnd=true />
+          </actionpoints>
+        </DivisionController>
+      </controller>
+    </SpaceShip>  -->
+   
+<!-- HERE ENDS DEMO FOR THE "WAYPOINTS" -->
+
+<!-- HERE STARTS DEMO FOR THE ACTIONPOINTS. 
+P.S. Never set protectMe in the first actionpoint: if human didn't spawn, that actionpoint will be skipped -->
+       <!-- 
+    <Model mesh="cube.mesh" scale=8 position="0,0,0" />
+
+    <SpaceShip position="-2000, 1500, -1000" lookat="0,0,0" team=0 name="ss2">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="finger4">
+          <actionpoints>
+            <Actionpoint position="0,0,0" action="FLY" /> 
+            <Actionpoint position="-1000,750,-500" action="ATTACK" attack="attack" />
+            <Actionpoint position="-1000,750,-500" action="PROTECt" protectMe=true />
+            <Actionpoint position="-1000,750,-500" action="PROTECt" protect="protect" /> 
+            <Actionpoint position="-1000,750,-500" action="FIGHTALL" />
+           </actionpoints>
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-2000, 1900, -1000" lookat="0,0,0" team=0>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=0>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-2000, 2100, -1000" lookat="0,0,0" team=0>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-2000, 2400, -1000" lookat="0,0,0" team=0>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="0, 0, 0" lookat="0,0,0" team=2 name="ss4">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+    </SpaceShip>
+    <SpaceShip position="3000, 1000, 2000" lookat="0,0,0" team=2 name="attack">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+    </SpaceShip>
+    <SpaceShip position="-500, -300, -300" lookat="0,0,0" team=0 name="protect">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+    </SpaceShip> 
+  -->
+   
+<!-- HERE ENDS DEMO FOR THE ACTIONPOINTS -->
+<!-- HERE STARTS DEMO FOR FIGHTING -->
+    <!-- 
+
+    <SpaceShip position="-4000, 1500, -1000" lookat="0,0,0" team=0 name="d1sd1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="WALL">
+
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-4000, 1900, -1000" lookat="0,0,0" team=0 name="d1ss1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=0>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-4000, 2100, -1000" lookat="0,0,0" team=0 name="d1sw1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-4000, 2400, -1000" lookat="0,0,0" team=0 name="d1sw2">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="2000, -1500, 1000" lookat="0,0,0" team=1  name="d2sd1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=1 formationMode="DIAMOND">
+
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="2000, -1900, 1000" lookat="0,0,0" team=1 name="d2ss1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=1>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="2000, -2100, 1000" lookat="0,0,0" team=1 name="d2sw1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="2000, -2400, 1000" lookat="0,0,0" team=1 name="d2sw2">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip>  -->
+
+<!-- HERE ENDS DEMO FOR FIGHTING -->
+<!-- HERE STARTS DEMO FOR FORMATIONS -->
+    
+    <Model mesh="cube.mesh" scale=8 position="   0,2000,    0" />
+    <Model mesh="cube.mesh" scale=8 position="   0,2000,-2000" />
+    <Model mesh="cube.mesh" scale=8 position="2000,2000,-2000" />
+    <Model mesh="cube.mesh" scale=8 position="2000,2000,    0" />
+
+    <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="ss1">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=0 formationMode="diamond" spread=100>
+          <actionpoints>
+            <Actionpoint position="   0,2000,    0" action="FLY" loopStart=true/>
+            <Actionpoint position="   0,2000,-2000" action="FLY"  />
+            <Actionpoint position="2000,2000,-2000" action="FLY" />
+            <Actionpoint position="2000,2000,    0" action="FLY" loopEnd=true />
+          </actionpoints>
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip position="-2000, 1900, -1000" lookat="0,0,0" team=0>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=0>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-2000, 2100, -1000" lookat="0,0,0" team=0>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="-2000, 2400, -1000" lookat="0,0,0" team=0>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip> 
+   
+<!-- HERE ENDS DEMO FOR FORMATIONS -->
+    <!-- 1 division is roughly equal to 6 AIControllers--!>
+<!-- 
+    <SpaceShip position="2000, -1500, 1000" lookat="0,0,0" team=1 >
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <DivisionController team=1 formationMode="WALL">
+
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="2000, -1900, 1000" lookat="0,0,0" team=1>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <SectionController team=1>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="2000, -2100, 1000" lookat="0,0,0" team=1>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+    <SpaceShip position="2000, -2400, 1000" lookat="0,0,0" team=1>
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WingmanController team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip> 
+
+    <?lua
+      for i = 0, 5, 1 do
+        ?>
+      <SpaceShip position="<?lua print(7000) ?>,<?lua print(i*500) ?>,<?lua print(0) ?>" team=2>
+        <templates>
+          <Template link=spaceshipassff />
+        </templates>
+        <controller>
+          <AIController team=2 />
+        </controller>
+      </SpaceShip>
+    <?lua end ?> -->
+    
+
+  </Scene>
+</Level>
+
Index: code/branches/presentationHS15/data/levels/expeditionSector.oxw
===================================================================
--- code/branches/presentationHS15/data/levels/expeditionSector.oxw	(revision 10970)
+++ code/branches/presentationHS15/data/levels/expeditionSector.oxw	(revision 10970)
@@ -0,0 +1,858 @@
+<LevelInfo
+    name = "Expedition to Sector 5C"
+    description = "Commander, our scientists are reporting strange binary radio signals from a yet unexplored and thought to be uninhabited region, sector 5C. Explore the sector and get to the bottom of these messages!"
+    tags = "mission"
+    screenshot = "expeditionSector.png"
+/>
+
+<?lua
+    include("stats.oxo")
+    include("HUDTemplates3.oxo")
+    include("templates/lodInformation.oxt")
+
+    include("templates/spaceshipAssff.oxt")
+    include("templates/spaceshipPirate.oxt")
+    include("templates/spaceshipEscort.oxt")
+    include("templates/spaceshipShuttle.oxt")
+    include("templates/FPS.oxt")
+    include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+    <templates>
+        <Template link="lodtemplate_default" />
+    </templates>
+
+    <?lua include("includes/notifications.oxi") ?>
+
+    <NotificationQueueCEGUI
+        name="narrative"
+        targets="simpleNotification"
+        size=3
+        displayTime=3.9
+        position="0.15, 0, 0.1, 0"
+        fontSize="15"
+        fontColor="0.3, 1, 0.2, 0.8"
+        alignment="HorzCentred"
+        displaySize="0.7, 0, 0, 0"
+    />
+
+    <!-- GLOBAL LUA VARIABLES -->
+    <?lua
+
+        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+        cCenter = {0, 0, 0}
+        cSpawn = {-50, 0, 0}
+        cSector = {-15000, -5500, -9000}
+        cSectorEntry = {-4710, -5500, -2826}
+        cPathToEntry = {{0, -2000, 0}}
+        cBeacon = {-6500, -5500, -4400}
+
+        radSector = 12000
+
+	    cStationA = {1400, 400, -800}
+        cNewShip = {1000, 250, -350}
+
+        cPlanet1 = {20000, 0, 29000}
+        cPlanet2 = {-22000, 0, -29000}
+
+      	cEnemyBasePlanet = {-20000, -5500, -8000}
+
+        cEnemyBaseStation1 = {-12500, -4500, -3500}
+
+	      cField1 = {-5000, -4000, -3000}
+ 	      cField2 = {4000, 2000, 4500}
+
+        --[[ Function to print Coordinates. Quotes not included! ]]--
+        function printC(coord)
+          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+        end
+
+        --[[ Function to add Coordinates.]]--
+        function addC(coord1, coord2)
+            return {coord1[1]+coord2[1], coord1[2]+coord2[2], coord1[3]+coord2[3]}
+        end
+    ?>
+
+    <Scene
+        ambientlight = "0.8, 0.8, 0.8"
+        skybox = "Orxonox/skyBoxMoreNebula"
+        hasPhysics = true
+    >
+
+    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cCenter) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+    <Light type=directional position="<?lua printC(cCenter) ?>" 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"/>
+
+    <!--QUEST DEFINITIONS-->
+
+    <GlobalQuest id="quest1">
+        <QuestDescription title="Get the scout ship" description="We received some extraterrestial binary radio signals from Sector 5C! We'd like you to get to the outer base in sector 4A and get a scout ship to explore the sector!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest2" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest2">
+        <QuestDescription title="Explore the sector" description="Now then, Commander, fly over there to check out if life can be found in what we believed it to be an inhabitated region in space. We have marked 5B with red lights so you can easily find it." failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <subquests>
+            <GlobalQuest id="quest2.1">
+                <QuestDescription title="> Get to the Field Source" description="We percieve a large magnetic field source at a certain spot in the sector. You should check it out! We have marked it with a blue light." failMessage="" completeMessage="" />
+                <hints>
+                </hints>
+                <complete-effects>
+                    <AddQuest questId="quest2.2" />
+                </complete-effects>
+            </GlobalQuest>
+            <GlobalQuest id="quest2.2">
+                <QuestDescription title="> Fight your way out" description="Oh no... this cannot be happening! We discovered an alien race, and it does not seem to be interested in peace. In fact, they seem to be planning an attack! You must get out of the hot zone. Fight if necessary!" failMessage="" completeMessage="" />
+                <hints>
+                </hints>
+                <complete-effects>
+                    <AddQuest questId="quest3" />
+                </complete-effects>
+            </GlobalQuest>
+        </subquests>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest3">
+        <QuestDescription title="Get back to 4A" description="You made it out in one piece. Now report to base 4A to warn the others!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+    </GlobalQuest>
+
+    <!--EVENTS AND TRIGGERS
+        Usable events and triggers:
+        spawntrigger
+        dockA
+        reachedSector
+        reachedEnemyStation
+        fightEnd
+        backToA
+
+        BASE-STORY-LINE:
+        We receive a message from commander (SimpleNotification -> SpawnTrigger) about alien radio activity in a nearby sector and are asked to change our spaceship
+        QUEST1: Dock to Station and get better Spaceship
+        TRIGGER: Docked to Station
+        EVENT: Change Spaceship and Sector 5C becomes visilbe
+
+        We are asked to go to the sector and explore it
+        QUEST2.1: Go to Sector 5C and see what you can find there
+        TRIGGER: Distance Trigger at enemy spacestation, with a rather large radius
+        EVENT: The 25 Enemies and there SpaceStation become visible, the planet should stay invisible; the patroling enemies on your way back become visible as well.
+
+        On your way back you discover the patroling enemy spaceships, they attack you, but you must survive and report to your commander about an possible upcoming attack from the aliens
+        QUEST2.2: Destroy the patroling spaceships, spare no one
+        TRIGGER: -------- The patroling spaceships should triggered bythemselves?
+        EVENT: After destroying all 5 enemy ships, you can return to your base and safety, the Distancetrigger for next quest is activated
+        FAIL: You fail if you die here
+
+        After destroying the enemy ships, you make it bake to your station in time to report about the hord of enemies you saw and start preparing for the upcoming fight!
+        QUEST3: Go back to spacestation
+        TRIGGER: Distancetrigger i suppose?
+        EVENT: You win this level, and the main level is unlocked.
+    -->
+
+    <EventMultiTrigger name="spawntrigger">
+        <events>
+            <trigger>
+                <EventListener event="playerSpawn" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <!-- HACK: just waited out 3sec for animation. Cannot link an event to the COMPLETION of a dock. How is this not possible?? -->
+    <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
+        <events>
+            <trigger>
+                <EventListener event="dockA" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger name="reachedSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true />
+
+    <DistanceTrigger name="reachedEnemyStation" position="<?lua printC(cEnemyBaseStation1) ?>" distance="5000" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true />
+
+    <!-- Recursive helper function for the fightEnd event -->
+    <?lua
+    function enemyTriggerRecursor(i)
+    if i > 0 then
+    return [[
+    <EventTrigger name=killedEnemy]] .. i .. [[ activations=1 stayactive=true delay=0.1>
+        <events>
+            <trigger>
+                <EventListener event=enemy />
+            </trigger>
+        </events>
+        ]] .. enemyTriggerRecursor(i-1) .. [[
+    </EventTrigger>
+    ]]
+    else return ""
+    end
+    end
+    ?>
+    <!-- Actual Event for the enemies. -->
+    <?lua print(enemyTriggerRecursor(5)) ?>
+    <EventMultiTrigger name="fightEnd" delay=0.1 stayactive=true>
+        <events>
+            <trigger>
+                <EventListener event="killedEnemy5" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger active=false name="closeToPatrol" position="<?lua printC(cStationA) ?>" distance="6000" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true >
+        <events>
+            <activity>
+                <EventListener event="reachedEnemyStation" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <DistanceTrigger active=false name="backToA" position="<?lua printC(cStationA) ?>" distance="600" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true >
+        <events>
+            <activity>
+                <EventListener event="fightEnd" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="backToA" />
+            </trigger>
+        </events>
+    </Script>
+
+    <DistanceTrigger invert=true active=false name="hasDied" position="<?lua printC(cSector) ?>" distance="100000" target="SpaceShip" beaconMode="identify" targetname="newSpaceShip" stayactive=true >
+        <events>
+            <activity>
+                <EventListener event="reachedSector" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission fail" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="hasDied" />
+            </trigger>
+        </events>
+    </Script>
+
+    <!--QUEST EFFECT BEACONS -->
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="spawntrigger" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="dockedA" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest2.1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="reachedSector" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest2.1" />
+            <AddQuest questId="quest2.2" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="reachedEnemyStation" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest2.2" />
+            <CompleteQuest questId="quest2" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="fightEnd" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <!--NOTIFICATIONS -->
+
+    <SimpleNotification broadcast="true" message="Welcome, Commander.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="We've picked up strange radio Signals from Sector 5B!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=8 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Please dock to the outer base and get into the scout ship!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=12 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="We have marked the sector in red Lights. Enter it!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=0 >
+                   <events>
+                      <trigger>
+                         <EventListener event="dockedA" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Huh? Something's emanating a strong field... We marked it in blue.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=0 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedSector" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Woah! What the hell? We made alien contact!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=0 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedEnemyStation" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="It looks like they are getting ready to attack someone...">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedEnemyStation" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="It must be us! Commander, get back to the base and report!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=8 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedEnemyStation" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Oh no! A patrol! When did it get here?!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=0 >
+                   <events>
+                      <trigger>
+                         <EventListener event="closeToPatrol" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Phew, that was close. Now get back here!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=0 >
+                   <events>
+                      <trigger>
+                         <EventListener event="fightEnd" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <!--STATIONS -->
+
+    <Template name="station">
+        <Pawn mass=10000000 collisionType=dynamic friction=0.01>
+            <attached>
+                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
+                <DistanceTriggerBeacon name="NPC" />
+            </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>
+        </Pawn>
+    </Template>
+
+    <Pawn name="statA" team=0 radarname="Outer Base - Sector 4B" position="<?lua printC(cStationA) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
+        <templates>
+            <Template link="station" />
+        </templates>
+        <attached>
+            <DockingTarget name="dockTargetA" />
+            <Dock position="0,0,0" active=true>
+                <animations>
+                    <MoveToDockingTarget target="dockTargetA" />
+                </animations>
+                <effects>
+                    <DockToShip target="newSpaceShip" />
+                </effects>
+                <events>
+                    <execute>
+                        <EventListener event="dockA" />
+                    </execute>
+                </events>
+                <attached>
+                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
+                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+                </attached>
+            </Dock>
+        </attached>
+    </Pawn>
+
+    <!-- EnemyStation -->
+
+    <!-- Marking Billboard -->
+    <Billboard visible=false position="<?lua printC(cEnemyBaseStation1) ?>" amplitude=30 scale=2 material="Flares/lensflare" colour="0,0,1">
+        <events>
+           <visibility>
+              <EventListener event="reachedSector" />
+          </visibility>
+        </events>
+    </Billboard>
+
+
+    <Pawn name="statB" team=1 radarname="EnemyBase" position="<?lua printC(cEnemyBaseStation1) ?>" direction="<?lua printC(cSpawn) ?>" yaw=45 pitch=-5 roll=-25 initialhealth=10000 maxhealth=10000 >
+        <templates>
+            <Template link="station" />
+        </templates>
+        <events>
+            <visibility>
+                <EventListener event="reachedEnemyStation" />
+            </visibility>
+            <activity>
+                <EventListener event="reachedEnemyStation" />
+            </activity>
+        </events>
+    </Pawn>
+
+    <!-- New SpaceShip as destination of dock A-->
+    <SpaceShip
+            template            = "spaceshipassff"
+            team                = "0"
+            position            = "<?lua printC(cNewShip) ?>"
+            lookat              = "<?lua printC(cSector) ?>"
+            health              = "1500"
+            initialhealth       = "1500"
+            maxhealth           = "1500"
+            shieldhealth        = "80"
+            initialshieldhealth = "80"
+            maxshieldhealth     = "120"
+            shieldabsorption    = "0.8"
+            reloadrate          = "1"
+            reloadwaittime      = "1"
+            name                = "newSpaceShip"
+            radarname           = "ScoutShip" >
+        <attached>
+            <DockingTarget name="newSpaceShip" />
+            <DistanceTriggerBeacon name="newSpaceShip" />
+        </attached>
+    </SpaceShip>
+
+    <!--ELEMENTS -->
+
+    <?lua
+    for i = 1, 64, 1
+    do
+    rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
+    cBillNow = addC(cSector,rBillboard)
+    ?>
+    <Billboard position="<?lua printC(cBillNow) ?>"  scale=10 material="Flares/lensflare" colour="1,0.2,0.2" visible=false>
+        <events>
+            <visibility>
+                <EventListener event="dockedA" />
+            </visibility>
+        </events>
+    </Billboard>
+    <?lua end ?>
+
+    <!-- Asteroids you have to fly through to get to the EnemyBase -->
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
+    ?>
+
+    <!-- Other Asteroid-Fields -->
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
+    ?>
+
+    <!-- Planets -->
+
+   <Planet
+        position="<?lua printC(cPlanet1) ?>"
+        scale="3000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/muunilinst.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage=2
+        enablecollisiondamage=true
+	      visible=true
+	      active=ture
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="3000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    <Planet
+        position="<?lua printC(cPlanet2) ?>"
+        scale="2000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/ganymede.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage=2
+        enablecollisiondamage=true
+	      visible=true
+	      active=true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="2000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    <!-- EnemyPlanet(s) -->
+
+    <Planet
+        position="<?lua printC(cEnemyBasePlanet) ?>"
+        scale="5000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/jupiter.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage=2
+        enablecollisiondamage=true
+	      visible=false
+	      active=false
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="5000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+      xi = 5
+      zi = 5
+      for k = 1, xi, 1
+      do
+    ?>
+    <?lua
+      for j = 1, zi, 1
+      do
+      x = -2500+k*100
+      z = -4400+j*100
+    ?>
+    <SpaceShip visible=false active=false name="enemyStalled" radarname="Attacker" position="-11000,<?lua print(z)?>,<?lua print(x)?>" lookat="0,0,0" team=1>
+        <templates>
+            <Template link="spaceshippirate" />
+        </templates>
+        <events>
+            <visibility>
+                <EventListener event="reachedEnemyStation" />
+            </visibility>
+        </events>
+    </SpaceShip>
+    <?lua end ?>
+    <?lua end ?>
+
+    <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-2700,-800,-800" lookat="0,0,0" team=1>
+      <templates>
+        <Template link=spaceshippirate />
+      </templates>
+      <events>
+          <visibility>
+              <EventListener event="reachedEnemyStation" />
+          </visibility>
+          <activity>
+              <EventListener event="reachedEnemyStation" />
+          </activity>
+      </events>
+      <controller>
+        <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+            <events>
+                <activity>
+                    <EventListener event="reachedEnemyStation" />
+                </activity>
+            </events>
+          <waypoints>
+            <StaticEntity position="-3400,-1200,-200" />
+            <StaticEntity position="-1600,-1000,-200" />
+            <StaticEntity position="-1700,-1400,-940" />
+            <StaticEntity position="-2100,-1200,-1250" />
+            <StaticEntity position="-2700,-800,-800" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-3400,-1200,-200" lookat="0,0,0" team=1>
+        <events>
+            <visibility>
+                <EventListener event="reachedEnemyStation" />
+            </visibility>
+            <activity>
+                <EventListener event="reachedEnemyStation" />
+            </activity>
+        </events>
+      <templates>
+        <Template link=spaceshippirate />
+      </templates>
+      <controller>
+        <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+            <events>
+                <activity>
+                    <EventListener event="reachedEnemyStation" />
+                </activity>
+            </events>
+          <waypoints>
+            <StaticEntity position="-1600,-1000,-200" />
+            <StaticEntity position="-1700,-1400,-940" />
+            <StaticEntity position="-2100,-1200,-1250" />
+            <StaticEntity position="-2700,-800,-800" />
+            <StaticEntity position="-3400,-1200,-200" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-1600,-1000,-200" lookat="0,0,0" team=1>
+        <events>
+            <visibility>
+                <EventListener event="reachedEnemyStation" />
+            </visibility>
+            <activity>
+                <EventListener event="reachedEnemyStation" />
+            </activity>
+        </events>
+      <templates>
+        <Template link=spaceshippirate />
+      </templates>
+      <controller>
+        <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+            <events>
+                <activity>
+                    <EventListener event="reachedEnemyStation" />
+                </activity>
+            </events>
+          <waypoints>
+            <StaticEntity position="-1700,-1400,-940" />
+            <StaticEntity position="-2100,-1200,-1250" />
+            <StaticEntity position="-2700,-800,-800" />
+            <StaticEntity position="-3400,-1200,-200" />
+            <StaticEntity position="-1600,-1000,-200" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-1700,-1400,-940" lookat="0,0,0" team=1>
+        <events>
+            <visibility>
+                <EventListener event="reachedEnemyStation" />
+            </visibility>
+            <activity>
+                <EventListener event="reachedEnemyStation" />
+            </activity>
+        </events>
+      <templates>
+        <Template link=spaceshippirate />
+      </templates>
+      <controller>
+        <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+            <events>
+                <activity>
+                    <EventListener event="reachedEnemyStation" />
+                </activity>
+            </events>
+          <waypoints>
+            <StaticEntity position="-2100,-1200,-1250" />
+            <StaticEntity position="-2700,-800,-800" />
+            <StaticEntity position="-3400,-1200,-200" />
+            <StaticEntity position="-1600,-1000,-200" />
+            <StaticEntity position="-1700,-1400,-940" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip visible=false active=false name="enemy" radarname="Guard" position="-2100,-1200,-1250" lookat="0,0,0" team=1>
+        <events>
+            <visibility>
+                <EventListener event="reachedEnemyStation" />
+            </visibility>
+            <activity>
+                <EventListener event="reachedEnemyStation" />
+            </activity>
+        </events>
+      <templates>
+        <Template link=spaceshippirate />
+      </templates>
+      <controller>
+        <WaypointPatrolController active=false accuracy=40 alertnessradius=2000 team=1>
+            <events>
+                <activity>
+                    <EventListener event="reachedEnemyStation" />
+                </activity>
+            </events>
+          <waypoints>
+            <StaticEntity position="-2700,-800,-800" />
+            <StaticEntity position="-3400,-1200,-200" />
+            <StaticEntity position="-1600,-1000,-200" />
+            <StaticEntity position="-1700,-1400,-940" />
+            <StaticEntity position="-2100,-1200,-1250" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
+
+    </Scene>
+</Level>
Index: code/branches/presentationHS15/data/levels/missionOne.oxw
===================================================================
--- code/branches/presentationHS15/data/levels/missionOne.oxw	(revision 10967)
+++ code/branches/presentationHS15/data/levels/missionOne.oxw	(revision 10970)
@@ -1679,10 +1679,10 @@
 
 <!-- @Triggers: HACK. The attacktrigger6 Event is created, but does not trigger the Script.
-(WTF?) TODO: looks like a BUG 
+(WTF?) TODO: looks like a BUG
 Thus a distanceTrigger is created, that gets enabled, when the inner trigger gets activated.
 Due to the large radius it is likely that it actually gets triggered.
 -->
 
-  <DistanceTrigger name="testDistanceTrigger" position="0,0,0" distance=10000 target="SpaceShip" stayActive="true" delay=37.0>
+  <DistanceTrigger name="testDistanceTrigger" position="0,0,0" distance=10000 target="Pawn" stayActive="true" delay=37.0>
     <EventTrigger name="testEventTrigger" activations="1" stayactive="true" delay=0.1>
       <events>
Index: code/branches/presentationHS15/data/levels/shuttleAttack.oxw
===================================================================
--- code/branches/presentationHS15/data/levels/shuttleAttack.oxw	(revision 10970)
+++ code/branches/presentationHS15/data/levels/shuttleAttack.oxw	(revision 10970)
@@ -0,0 +1,1171 @@
+<!--TODO: Shuttle and Stations -->
+<LevelInfo
+    name = "Shuttle under Attack"
+    description = "The newly discovered hostile alien species is attacking one of our outset stations, Andromeda! There is no protecting it; you have to escort the escape shuttle to a safer location."
+    tags = "mission"
+    screenshot = "shuttleProtect.png"
+/>
+
+<?lua
+    include("stats.oxo")
+    include("HUDTemplates3.oxo")
+    include("templates/lodInformation.oxt")
+
+    include("templates/spaceshipAssff.oxt")
+    include("templates/spaceshipPirate.oxt")
+    include("templates/spaceshipEscort.oxt")
+    include("templates/spaceshipShuttle.oxt")
+    include("templates/FPS.oxt")
+    include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+    <templates>
+        <Template link="lodtemplate_default" />
+    </templates>
+
+    <?lua include("includes/notifications.oxi") ?>
+
+    <NotificationQueueCEGUI
+        name="narrative"
+        targets="simpleNotification"
+        size=3
+        displayTime=3.9
+        position="0.15, 0, 0.1, 0"
+        fontSize="15"
+        fontColor="0.3, 1, 0.2, 0.8"
+        alignment="HorzCentred"
+        displaySize="0.7, 0, 0, 0"
+    />
+
+    <!-- GLOBAL LUA VARIABLES -->
+    <?lua
+        waves = 3
+        enemiesInit = 5
+        enemiesIncrease = 2
+        allies = 3
+
+        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+        cCenter = {0, 0, 0}
+        cSpawn = {-50, 0, 0}
+        cUnit = {-2000, 0, 3000}
+        cA = {-3000, 0, 5000}
+        cB = {-3000, 0, -5000}
+        cC = {-2300, 0, 0}
+        dStation = {1, 0, 0}
+        cNewShip = {-2100, 0, 4100}
+        cFPSGround = {-2300, 800, 0}
+        cFPS = {-2300, 1000, 0}
+        cField1 = {400, 0, 2500}
+        cField2 = {400, 0, -2500}
+        cPlanet1 = {8000, -2000, 15000}
+        cPlanet2 = {-20000, 4000, -1000}
+        rAllies = {3000, -2000}         --[[ To be addressed directly, hence r. Do not permute! ]]--
+
+        --[[ Function to print Coordinates. Quotes not included! ]]--
+        function printC(coord)
+          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+        end
+    ?>
+
+    <Scene
+        ambientlight = "0.8, 0.8, 0.8"
+        skybox = "Orxonox/skyBoxMoreNebula"
+        hasPhysics = true
+    >
+
+    <SpawnPoint name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cA) ?>" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+    <Light type=directional position="<?lua printC(cCenter) ?>" 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"/>
+
+    <!--QUEST DEFINITIONS-->
+
+    <GlobalQuest id="quest1">
+        <QuestDescription title="Reach Andromeda Station!" description="You need to get in contact with your base! Word is enemies are preparing to attack our people and goods! Be quick!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest2" />
+            <AddQuest questId="quest2.1" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest2">
+        <QuestDescription title="Prepare to fight the Enemy" description="You need to be prepared, mentally and physically! So gather all your strength and forces to destroy those space pirates!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <subquests>
+            <GlobalQuest id="quest2.1">
+                <QuestDescription title="> Get a better Spaceship" description="Take over the faster, stronger, more secure and overall better spaceship!" failMessage="" completeMessage="" />
+                <complete-effects>
+                    <AddQuest questId="quest2.2" />
+                </complete-effects>
+            </GlobalQuest>
+            <GlobalQuest id="quest2.2">
+                <QuestDescription title="> Meet your Unit" description="Your unit will help you, where ever you go. To victory or to death, they will be loyal to you!" failMessage="" completeMessage="" />
+            </GlobalQuest>
+        </subquests>
+        <complete-effects>
+            <AddQuest questId="quest3" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest3">
+        <QuestDescription title="Fight the first Wave" description="Five enemies are approaching you! There main target is the shuttle though, so destroy them - before the destroy the escape shuttle with the valuebals goods (and of course the people aboard)!" failMessage="Oh no! You have to be better, they destroyed the shuttle!" completeMessage="Good Job!" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest4" />
+            <AddQuest questId="quest4.1" />
+            <AddQuest questId="quest4.2" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest4">
+        <QuestDescription title="Prepare for the next Wave" description="This was just a scouting troop from the enemies, they know now how many there are from us and will send a bigger troop next time! Prepare yourself..." failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <subquests>
+            <GlobalQuest id="quest4.1">
+                <QuestDescription title="> Get to the Defense Station" description="Fly to the defense station, we will guard your spaceship while you will fight them with the Cannon Suit." failMessage="" completeMessage="" />
+            </GlobalQuest>
+            <GlobalQuest id="quest4.2">
+                <QuestDescription title="> Get into the Cannon Suit!" description="Dock to the defense station, you will be able to contol the Cannon Suit on top of the station, perfect for fighting off a hord of enemies!" failMessage="" completeMessage="" />
+            </GlobalQuest>
+        </subquests>
+        <complete-effects>
+            <AddQuest questId="quest5" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest5">
+        <QuestDescription title="Fight the Hord!" description="Destroy the next wave!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest6" />
+            <AddQuest questId="quest6.1" />
+            <AddQuest questId="quest6.2" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest6">
+        <QuestDescription title="Get back for the Showdown" description="Undock from the defense station and get into your Spaceship!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <subquests>
+            <GlobalQuest id="quest6.1">
+                <QuestDescription title="> Collect the local Pickups" description="There is a box with pickups close to the station, you can collect them if you want to, but it is advised to do so. They will support your task in destroying the enemies and make your life easier." failMessage="" completeMessage="" />
+            </GlobalQuest>
+            <GlobalQuest id="quest6.2">
+                <QuestDescription title="> Get back to the Shuttle" description="Fly to the Shuttle!" failMessage="" completeMessage="" />
+            </GlobalQuest>
+        </subquests>
+        <complete-effects>
+            <AddQuest questId="quest7" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest7">
+        <QuestDescription title="Fight the final Wave" description="Good gracious, another hord of pirate ships!" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <subquests>
+        </subquests>
+    </GlobalQuest>
+
+    <!--EVENTS AND TRIGGERS
+        Usable events and triggers:
+        _spawntrigger
+        _reachedA
+        _dock<A|B|C>
+        _docked<A>      WIP; see below
+        -joinedUnit
+        _wave<k>
+        _killedEnemy<k>.<i>
+        _waveClear<k>
+    -->
+
+
+
+    <EventMultiTrigger name="spawntrigger" activations=1>
+        <events>
+            <trigger>
+                <EventListener event="playerSpawn" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger name="reachedA" position="<?lua printC(cA) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true />
+
+    <!-- HACK: just waited out 3sec for animation. Cannot link an event to the COMPLETION of a dock. How is this not possible?? -->
+    <EventMultiTrigger name="dockedA" activations="1" stayactive="true" delay=3>
+        <events>
+            <trigger>
+                <EventListener event="dockA" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger name="joinedUnit" active=false position="<?lua printC(cUnit) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+        <events>
+            <activity>
+                    <EventListener event="dockedA" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <EventMultiTrigger name="wave1" activations="1" delay=4>
+        <events>
+            <trigger>
+                <EventListener event="joinedUnit" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <!-- Recursive helper function for the end-of-wave events. F*ck the event system, seriously. -->
+    <?lua
+    function enemyTriggerRecursor(i, k)
+    if i > 0 then
+    return [[
+    <EventTrigger name=killedEnemy]] .. k .. [[.]] .. i .. [[ activations=1 stayactive=true delay=0.1>
+        <events>
+            <trigger>
+                <EventListener event=attackers]] .. k .. [[ />
+            </trigger>
+        </events>
+        ]] .. enemyTriggerRecursor(i-1, k) .. [[
+    </EventTrigger>
+    ]]
+    else return ""
+    end
+    end
+    ?>
+    <!-- Actual recursive Event(s) for the respective waves. -->
+    <?lua
+    enemies = enemiesInit
+    for k = 1, waves, 1
+    do
+    print(enemyTriggerRecursor(enemies,k))
+    ?>
+    <EventMultiTrigger name="waveClear<?lua print(k) ?>" delay=4.0>
+        <events>
+            <trigger>
+                <EventListener event="killedEnemy<?lua print(k .. [[.]] .. enemies) ?>" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+    <?lua enemies = enemies + enemiesIncrease ?>
+    <?lua end ?>
+
+    <!-- This controls the ally AI controller so it is only active when active enemies are around! -->
+    <EventDispatcher name="allyControllerDispatcher">
+      <targets>
+        <EventTarget target="allyController" />
+      </targets>
+      <events>
+          <activity>
+              <?lua
+              for k = 1, waves, 1 do
+              ?>
+              <Trigger mode=and>
+                  <EventTrigger>
+                      <events>
+                          <trigger>
+                              <EventListener event="wave<?lua print(k) ?>" />
+                          </trigger>
+                      </events>
+                  </EventTrigger>
+                  <EventTrigger invert=true>
+                      <events>
+                          <trigger>
+                              <EventListener event="waveClear<?lua print(k) ?>" />
+                          </trigger>
+                      </events>
+                  </EventTrigger>
+              </Trigger>
+              <?lua end ?>
+          </activity>
+      </events>
+    </EventDispatcher>
+
+    <DistanceTrigger active=false name="reachedC" position="<?lua printC(cC) ?>" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="waveClear1" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <EventMultiTrigger name="dockedC" activations="1" stayactive="true" delay=3>
+        <events>
+            <trigger>
+                <EventListener event="dockC" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventMultiTrigger name="wave2" activations="1" delay=8>
+        <events>
+            <trigger>
+                <EventListener event="dockedC" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventMultiTrigger name="readyAfterWave2" activations="1" delay=2 stayactive=true>
+        <events>
+            <trigger>
+                <Trigger mode=and>
+                    <EventTrigger>
+                        <events>
+                            <trigger>
+                                <EventListener event="undockC" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                    <EventTrigger>
+                        <events>
+                            <trigger>
+                                <EventListener event="waveClear2" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                </Trigger>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <!-- See the DistanceTrigger attached to the shuttle here! !-->
+
+    <EventMultiTrigger name="wave3" activations="1" delay=12>
+        <events>
+            <trigger>
+                <EventListener event="reachedShuttle" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger active=false name="reachedB" position="<?lua printC(cB) ?>" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="waveClear3" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="reachedB" />
+            </trigger>
+        </events>
+    </Script>
+
+    <EventMultiTrigger name="missionFailed" activations="1" stayactive=true>
+        <events>
+            <trigger>
+                <EventListener event="transporter" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventMultiTrigger name="failMissionHelper" delay=4 stayactive=true>
+        <events>
+            <trigger>
+                <EventListener event="missionFailed" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger active=false name="failMission" position="<?lua printC(cA) ?>" distance=100 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="failMissionHelper" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <!--HACK: Ultimately settled on docking A to fail the mission... that makes a whole lot of sense. -->
+
+    <Script code="Mission endMission fail" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="failMission" />
+            </trigger>
+        </events>
+    </Script>
+
+    <!--QUEST EFFECT BEACONS -->
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="spawntrigger" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="reachedA" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest2.1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="dockedA" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest2.2" />
+            <CompleteQuest questId="quest2" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="joinedUnit" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest3" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="waveClear1" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest4.1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="reachedC" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest4.2" />
+            <CompleteQuest questId="quest4" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="dockedC" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest5" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="waveClear2" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest6.1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="gotPickups" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest6.2" />
+            <CompleteQuest questId="quest6" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="reachedShuttle" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest7" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="waveClear3" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <!--NOTIFICATIONS -->
+
+    <SimpleNotification broadcast="true" message="Welcome, Commander. Please report at Andromeda Station.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Our enemy is set to attack us very soon.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=8 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Please study your mission briefing!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=12 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Welcome to Andromeda, Commander.">
+        <events>
+            <trigger>
+                <EventListener event="reachedA" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="We've prepared a reinforced Ship for you.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedA" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Now join our defense Team.">
+        <events>
+            <trigger>
+                <EventListener event="dockedA" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Howdy Commander! Ready to kick some alien ass?">
+        <events>
+            <trigger>
+                <EventListener event="joinedUnit" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <!-- HACK: Somehow only fires a second time if the (notification,event) pairs are separate! WTF -->
+    <?lua
+    for k = 1, waves, 1 do
+    ?>
+    <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!">
+        <events>
+            <trigger>
+                <EventListener event="wave<?lua print(k) ?>" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+    <?lua end ?>
+
+    <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
+        <events>
+            <trigger>
+                <EventListener event="attackers1" />
+                <EventListener event="attackers2" />
+                <EventListener event="attackers3" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Phew, that was close! Well done, Commmander.">
+        <events>
+            <trigger>
+                <EventListener event="waveClear1" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="But it's not over yet! Get to the defense station and dock!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="waveClear1" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="This is our powerful reinforced cannon suit.">
+        <events>
+            <trigger>
+                <EventListener event="dockedC" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="It should deal with those pesky invaders!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="dockedC" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Brilliant work, Commander! now undock again.">
+        <events>
+            <trigger>
+                <EventListener event="waveClear2" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Here's some supplies for you. Shoot that crate!">
+        <events>
+            <trigger>
+                <EventListener event="readyAfterWave2" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Our Intelligence reports one more wave...">
+        <events>
+            <trigger>
+                <EventListener event="reachedShuttle" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Ready to be a hero, Commander?">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedShuttle" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Congrats, Commander! You saved our skin.">
+        <events>
+            <trigger>
+                <EventListener event="waveClear3" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Get over to the safe base to take a break.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="waveClear3" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="It's over... we failed. Retreat to Andromeda!">
+        <events>
+            <trigger>
+                <EventListener event="missionFailed" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <!--STATIONS -->
+
+    <!-- (Temporary) Template for stations. Used to define common features of all Stations. -->
+    <Template name="station">
+        <Pawn mass=10000000 collisionType=dynamic friction=0.01>
+            <attached>
+                <Model mesh="HydroHarvester.mesh" position="0,0,0" scale=50 />
+                <DistanceTriggerBeacon name="NPC" />
+            </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>
+        </Pawn>
+    </Template>
+
+    <!-- A, Coordinates are approx. (cos(29pi/16), sin(29pi/16), 0)*3000 -->
+    <Pawn name="statA" team=0 radarname="Andromeda Station" position="<?lua printC(cA) ?>" direction="<?lua printC(dStation) ?>" yaw=-50 initialhealth=10000 maxhealth=10000>
+        <templates>
+            <Template link="station" />
+        </templates>
+        <attached>
+            <DockingTarget name="dockTargetA" />
+            <Dock position="0,0,0" active=true>
+                <animations>
+                    <MoveToDockingTarget target="dockTargetA" />
+                </animations>
+                <effects>
+                    <DockToShip target="newSpaceShip" />
+                </effects>
+                <events>
+                    <execute>
+                        <EventListener event="dockA" />
+                    </execute>
+                </events>
+                <attached>
+                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockA" />
+                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+                </attached>
+            </Dock>
+        </attached>
+    </Pawn>
+
+    <!-- B, Coordinates are approx. (-cos(29pi/16), sin(29pi/16), 0)*3000 -->
+    <Pawn name="statB" team=0 radarname="Safe Base" position="<?lua printC(cB) ?>" direction="<?lua printC(dStation) ?>" yaw=210 initialhealth=10000 maxhealth=10000>
+        <templates>
+            <Template link="station" />
+        </templates>
+        <attached>
+            <DockingTarget name="dockTargetB" />
+            <Dock position="0,0,0" active=false>
+                <animations>
+                    <MoveToDockingTarget target="dockTargetB" />
+                </animations>
+                <effects>
+                    <DockToShip target="newSpaceShip" />
+                </effects>
+                <events>
+                    <execute>
+                        <EventListener event="dockB" />
+                    </execute>
+                </events>
+                <attached>
+                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockB" />
+                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+                </attached>
+            </Dock>
+        </attached>
+    </Pawn>
+
+    <!-- C -->
+    <Pawn name="statC" team=0 radarname="Defense Station" position="<?lua printC(cC) ?>" direction="<?lua printC(dStation) ?>" initialhealth=10000 maxhealth=10000>
+        <templates>
+            <Template link="station" />
+        </templates>
+        <attached>
+            <DockingTarget name="dockTargetC" />
+            <Dock position="0,0,0">
+                <animations>
+                    <MoveToDockingTarget target="dockTargetC" />
+                </animations>
+                <effects>
+                    <DockToShip target="fpsMode" />
+                </effects>
+                <events>
+                    <execute>
+                        <EventListener event="dockC" />
+                    </execute>
+                </events>
+                <attached>
+                    <!--HACK: We use another dock to undock back to the ship since undocking is not implemented... -->
+                    <Dock position="0,0,0" active=true>
+                        <effects>
+                            <DockToShip target="newSpaceShip" />
+                        </effects>
+                        <events>
+                            <execute>
+                                <EventListener event="undockC" />
+                            </execute>
+                        </events>
+                    </Dock>
+                    <DistanceTrigger active=false position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockC">
+                        <events>
+                            <activity>
+                                <EventListener event="reachedC" />
+                            </activity>
+                        </events>
+                    </DistanceTrigger>
+                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
+                </attached>
+            </Dock>
+        </attached>
+    </Pawn>
+
+    <!-- New SpaceShip as destination of dock A-->
+    <SpaceShip
+            template            = "spaceshipassff"
+            team                = "0"
+            position            = "<?lua printC(cNewShip) ?>"
+            lookat              = "<?lua print(rAllies[2] .. ',' .. [[0]] .. ',' .. rAllies[1]) ?>"
+            health              = "400"
+            initialhealth       = "400"
+            maxhealth           = "1500"
+            shieldhealth        = "80"
+            initialshieldhealth = "80"
+            maxshieldhealth     = "120"
+            shieldabsorption    = "0.8"
+            reloadrate          = "1"
+            reloadwaittime      = "1"
+            name                = "newSpaceShip"
+            radarname           = "Defender" >
+        <attached>
+            <DockingTarget name="newSpaceShip" />
+            <DistanceTriggerBeacon name="newSpaceShip" />
+        </attached>
+    </SpaceShip>
+
+    <!-- FPS Player as destination of dock C -->
+    <FpsPlayer team=0 template = "fps" radarname = "Cannon Suit" position = "<?lua printC(cFPS) ?>" lookat="<?lua printC(cCenter) ?>">
+        <attached>
+            <DockingTarget name="fpsMode" />
+            <DistanceTriggerBeacon name="fpsPlayer" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="1,1,1"/>
+        </collisionShapes>
+    </FpsPlayer>
+
+    <!-- Floor for FPS Player -->
+    <StaticEntity position="<?lua printC(cFPSGround) ?>" collisionType=static mass=100000 friction=0.01 >
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="80,5,80" />
+            <Billboard position="320,50,320" material="Flares/ringflare2" colour="0.2,0.4,0.8" />
+    	    <DistanceTrigger position="320,50,320" distance="50" target="Pawn" beaconMode="identify" targetname="fpsPlayer" name="undockC" stayactive=true />
+            <ForceField active=false position="0,0,0" mode="homogen" diameter="600" forcedirection = "0,-500,0" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="400,25,400" />
+        </collisionShapes>
+    </StaticEntity>
+
+    <!--ELEMENTS -->
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 2000, 250, 0)
+    ?>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 2000, 250, 0)
+    ?>
+
+    <Planet
+        position="<?lua printC(cPlanet1) ?>"
+        scale="2000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/muunilinst.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="2000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
+    ?>
+
+    <Planet
+        position="<?lua printC(cPlanet2) ?>"
+        scale="3000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/planet3.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="3000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    <Pawn team=0 health=30 position="<?lua print((cC[1]+600) .. ',' .. cC[2] .. ',' .. (cC[3]-600)) ?>" direction="0,-1,0" collisionType=dynamic mass=1000 radarname="Supplies" name="gotPickups">
+        <events>
+            <visibility>
+                <EventListener event="readyAfterWave2" />
+            </visibility>
+            <activity>
+                <EventListener event="readyAfterWave2" />
+            </activity>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="10,10,10" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+        </collisionShapes>
+    </Pawn>
+
+    <?lua
+        include("includes/pickups.oxi")
+    ?>
+
+    <PickupSpawner pickup=hugeshieldpickup position="<?lua print((cC[1]+585) .. ',' .. cC[2] .. ',' .. (cC[3]-585)) ?>" triggerDistance="15" maxSpawnedItems="1">
+        <events>
+            <visibility>
+                <EventListener event="readyAfterWave2" />
+            </visibility>
+            <activity>
+                <EventListener event="readyAfterWave2" />
+            </activity>
+        </events>
+    </PickupSpawner>
+
+    <PickupSpawner pickup=crazyhealthpickup position="<?lua print((cC[1]+615) .. ',' .. cC[2] .. ',' .. (cC[3]-615)) ?>" triggerDistance="15" maxSpawnedItems="1">
+        <events>
+            <visibility>
+                <EventListener event="readyAfterWave2" />
+            </visibility>
+            <activity>
+                <EventListener event="readyAfterWave2" />
+            </activity>
+        </events>
+    </PickupSpawner>
+
+    <PickupSpawner pickup=hugespeedpickup position="<?lua print((cC[1]+585) .. ',' .. cC[2] .. ',' .. (cC[3]-615)) ?>" triggerDistance="15" maxSpawnedItems="1" >
+        <events>
+            <visibility>
+                <EventListener event="readyAfterWave2" />
+            </visibility>
+            <activity>
+                <EventListener event="readyAfterWave2" />
+            </activity>
+        </events>
+    </PickupSpawner>
+
+    <!-- Allies -->
+    <?lua
+    for i = 1, allies, 1
+    do
+    x = rAllies[1] + math.cos(2*math.pi/allies*(i+1))*100
+    y = rAllies[2] + math.sin(2*math.pi/allies*(i+1))*100
+    ?>
+    <SpaceShip visible=false active=false name="allies<?lua print(k)?>" radarname="Ally" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*100) ?>,<?lua print(x)?>" lookat="0,0,0" team=0>
+        <templates>
+            <Template link="spaceshipassff" />
+        </templates>
+        <events>
+            <visibility>
+                <EventListener event="dockedA" />
+            </visibility>
+            <activity>
+                <EventListener event="dockedA" />
+            </activity>
+        </events>
+        <attached>
+            <DistanceTriggerBeacon name="NPC" />
+        </attached>
+        <controller>
+            <!-- also see allyControllerDispatcher -->
+            <AIController name="allyController" accuracy=100 team=0 active=false />
+        </controller>
+    </SpaceShip>
+    <?lua end ?>
+
+    <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
+    <?lua
+    enemies = enemiesInit
+    for k = 1, waves, 1
+    do
+    ?>
+    <?lua
+    for i = 1, enemies, 1
+    do
+    x = math.cos(math.pi/(2*enemies - 2)*(i+k))*1500
+    y = math.sin(math.pi/(2*enemies - 2)*(i+k))*1500
+    ?>
+    <SpaceShip visible=false active=false name="attackers<?lua print(k)?>" radarname="Attacker" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*250) ?>,<?lua print(x)?>" lookat="0,0,0" team=1>
+        <templates>
+            <Template link="spaceshippirate" />
+        </templates>
+        <events>
+            <visibility>
+                <EventListener event="wave<?lua print(k)?>" />
+            </visibility>
+            <activity>
+                <EventListener event="wave<?lua print(k)?>" />
+            </activity>
+        </events>
+        <attached>
+            <DistanceTriggerBeacon name="NPC" />
+        </attached>
+        <controller>
+            <WaypointPatrolController name="attackController" accuracy=100 alertnessradius=100 team=1 active=false>
+                <waypoints>
+                    <Attacher target="transporter" deletewithparent=false />
+                </waypoints>
+                <events>
+                    <activity>
+                        <EventListener event="wave<?lua print(k)?>" />
+                    </activity>
+                </events>
+            </WaypointPatrolController>
+        </controller>
+    </SpaceShip>
+    <?lua end ?>
+    <?lua
+    enemies = enemies + enemiesIncrease
+    end ?>
+
+    <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
+    <SpaceShip position="<?lua printC(cA) ?>" lookat="<?lua printC(cB) ?>" team=0 name="transporter" radarname="Shuttle" >
+        <templates>
+            <Template link="spaceshipShuttle" />
+        </templates>
+        <attached>
+            <DistanceTriggerBeacon name="NPC" />
+            <DistanceTriggerBeacon name="transporter" />
+            <DistanceTrigger active=false name="reachedShuttle" position="0,0,0" distance=400 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true initialhealth=1000 maxhealth=1000>
+                <events>
+                    <activity>
+                        <EventListener event="readyAfterWave2" />
+                    </activity>
+                </events>
+            </DistanceTrigger>
+        </attached>
+        <controller>
+            <WaypointController accuracy=10 team=0>
+                <waypoints>
+                    <!-- A to B -->
+                    <?lua
+                    max = 5
+                    for i = 1, max, 1
+                    do
+                    x = math.cos(math.pi*(i+1)/8)*5000
+                    y = -math.sin(math.pi*(i+1)/8)*700-3000
+                    ?>
+                    <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+                    <?lua end ?>
+
+                    <!-- Return Point -->
+                    <Billboard position="<?lua printC(cB) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+
+                    <!-- B to A -->
+                    <?lua
+                    max = 5
+                    for i = 1, max, 1
+                    do
+                    x = math.cos(math.pi*(max+2-i)/8)*5000
+                    y = -math.sin(math.pi*(max+2-i)/8)*700-3000
+                    ?>
+                    <Billboard position="<?lua print(y) ?>,0,<?lua print(x) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+                    <?lua end ?>
+
+                    <!-- Start Point -->
+                    <Billboard position="<?lua printC(cA) ?>" amplitude=1 material="Flares/lensflare" colour="1,1,0.05"/>
+                </waypoints>
+            </WaypointController>
+        </controller>
+    </SpaceShip>
+
+    </Scene>
+</Level>
Index: code/branches/presentationHS15/data/levels/shuttleRetaliation.oxw
===================================================================
--- code/branches/presentationHS15/data/levels/shuttleRetaliation.oxw	(revision 10970)
+++ code/branches/presentationHS15/data/levels/shuttleRetaliation.oxw	(revision 10970)
@@ -0,0 +1,1181 @@
+<LevelInfo
+    name = "Retaliation"
+    description = "This attack cannot be met with no consequences! Commander, we order you to get back to sector 5C and erradicate the alien menace at once!"
+    tags = "mission"
+    screenshot = "retailiation.png"
+/>
+
+<?lua
+    include("stats.oxo")
+    include("HUDTemplates3.oxo")
+    include("templates/lodInformation.oxt")
+
+    include("templates/spaceshipAssff.oxt")
+    include("templates/spaceshipPirate.oxt")
+    include("templates/spaceshipEscort.oxt")
+    include("templates/spaceshipShuttle.oxt")
+    include("templates/FPS.oxt")
+    include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level gametype = "Mission">
+    <templates>
+        <Template link="lodtemplate_default" />
+    </templates>
+
+    <?lua include("includes/notifications.oxi") ?>
+
+    <NotificationQueueCEGUI
+        name="narrative"
+        targets="simpleNotification"
+        size=3
+        displayTime=3.9
+        position="0.15, 0, 0.1, 0"
+        fontSize="15"
+        fontColor="0.3, 1, 0.2, 0.8"
+        alignment="HorzCentred"
+        displaySize="0.7, 0, 0, 0"
+    />
+
+    <!-- GLOBAL LUA VARIABLES -->
+    <?lua
+
+        enemies = 2
+        allies = 2
+
+        radSector = 12000
+
+        --[[ Coordinates in (y,z,x). NOTE: Indexing starts at 1 in lua! Don´t forget to adapt the for loops, too! ]]--
+        cCenter = {0, 0, 0}
+        cSpawn = {1500, -2000, 900}
+        cSector = {-15000, -5500, -9000}
+        cSectorEntry = {-4710, -5500, -2826}
+        cPathToEntry = {{0, -2000, 0}}
+        cBeacon = {-6500, -5500, -4400}
+         cAllyWait = cBeacon
+
+        cAlly = cSpawn
+        cEnemy = {-9600, -5500, -6000}
+
+        rSection= {0, -200, 0}
+        rWingman1 = {0, -100, 100}
+        rWingman2 = {0, -100, -100}
+
+        cPlanet1 = {20000, 0, 29000}
+        cPlanet2 = {-22000, 0, -29000}
+
+        cEnemyBasePlanet = {-20000, -8000, -10000}
+
+        cField1 = {-5000, -4000, -3000}
+        cField2 = {4000, 2000, 4500}
+
+
+        --[[ Function to print Coordinates. Quotes not included! ]]--
+        function printC(coord)
+          print(coord[1] .. [[,]] .. coord[2] .. [[,]] .. coord[3])
+        end
+
+        --[[ Function to add Coordinates.]]--
+        function addC(coord1, coord2)
+            return {coord1[1]+coord2[1], coord1[2]+coord2[2], coord1[3]+coord2[3]}
+        end
+    ?>
+
+    <Scene
+        ambientlight = "0.8, 0.8, 0.8"
+        skybox = "Orxonox/skyBoxMoreNebula"
+        hasPhysics = true
+    >
+
+    <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" />
+
+    <Light type=directional position="<?lua printC(cSpawn) ?>" 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"/>
+
+    <!--SPAWNING-->
+
+    <Template name=commander>
+        <SpaceShip
+            template            = "spaceshipassff"
+            team                = "0"
+            health              = "800"
+            initialhealth       = "800"
+            maxhealth           = "1500"
+            shieldhealth        = "80"
+            initialshieldhealth = "80"
+            maxshieldhealth     = "120"
+            shieldabsorption    = "0.8"
+            reloadrate          = "1"
+            reloadwaittime      = "1"
+            name                = "commander"
+            radarname           = "Commander"
+            >
+            <attached>
+                <DistanceTriggerBeacon name="Commander" />
+            </attached>
+        </SpaceShip>
+    </Template>
+
+    <Template name=ally>
+        <SpaceShip
+            template            = "spaceshipassff"
+            team                = "0"
+            radarname           = "Ally"
+            lookat              = "<?lua printC(cPathToEntry[1]) ?>"
+        >
+            <attached>
+                <DistanceTriggerBeacon name="Ally" />
+            </attached>
+        </SpaceShip>
+    </Template>
+
+    <Template name=enemy>
+        <SpaceShip
+            template            = "spaceshippirate"
+            team                = "1"
+            radarname           = "Invader"
+            lookat              = "<?lua printC(cBeacon) ?>"
+            active              = false
+            visible             = false
+        >
+            <attached>
+                <DistanceTriggerBeacon name="Enemy" />
+            </attached>
+        </SpaceShip>
+    </Template>
+
+    <TeamSpawnPoint active=false name="playerSpawn" team=0 position="<?lua printC(cSpawn) ?>" lookat="<?lua printC(cPathToEntry[1]) ?>" spawnclass=SpaceShip pawndesign=commander>
+        <events>
+            <activity>
+                <EventTrigger invert=true>
+                  <events>
+                    <trigger>
+                      <EventListener event="reachedSector" />
+                    </trigger>
+                  </events>
+                </EventTrigger>
+            </activity>
+        </events>
+    </TeamSpawnPoint>
+
+    <TeamSpawnPoint active=false name="altSpawn" team=0 position="<?lua printC(cBeacon) ?>" lookat="<?lua printC(cSector) ?>" spawnclass=SpaceShip pawndesign=commander>
+        <events>
+            <activity>
+                <EventListener event="reachedSector" />
+            </activity>
+        </events>
+    </TeamSpawnPoint>
+
+    <!--QUEST DEFINITIONS-->
+
+    <GlobalQuest id="quest1">
+        <QuestDescription title="Enter Sector 5C" description="It is time to retaliate against the aggressors. Get back to Sector 5C to kill every last one of them! We have you covered with <?lua print(allies) ?> of our finest Divisions. They will guide, help and protect you if necessary." failMessage="" completeMessage="" />
+        <hints>
+            <QuestHint id="quest1hint1">
+                <QuestDescription title="Markings" description="We have marked the bounds of Sector 5C in red lights, you can follow the green trail to get there." />
+            </QuestHint>
+        </hints>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest2">
+        <QuestDescription title="Find them" description="It seems they have hidden themselves, that is, their whole civilization, in fear of retaliation. Our scientists presume some cloaking technology to be in use. Look out for a way to make the aggressors visible!" failMessage="" completeMessage="" />
+        <hints>
+            <QuestHint id="quest2hint1">
+                <QuestDescription title="The detector beacon" description="Our scientists claim cloaking is generally toggled by a visible Switch called a detector beacon. Try to find a bright light in your Area and approach it!" />
+            </QuestHint>
+        </hints>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest3">
+        <QuestDescription title="Fight their army" description="You have successfully uncovered their civilization and home planet, and it is much worse than we thought... they came prepared! You have to fight their army to fulfill your mission." failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <complete-effects>
+            <AddQuest questId="quest4" />
+            <AddQuest questId="quest4.1" />
+            <AddQuest questId="quest4.2" />
+            <AddQuestHint hintId="quest4.1hint1" />
+            <AddQuestHint hintId="quest4.2hint1" />
+        </complete-effects>
+    </GlobalQuest>
+
+    <GlobalQuest id="quest4">
+        <QuestDescription title="Do the right thing" description="The aggressors have surrendered and seem to have had good reasons for their actions. Yet they did not talk to us beforehand and tried to kill us. What will you do?" failMessage="" completeMessage="" />
+        <hints>
+        </hints>
+        <subquests>
+            <GlobalQuest id="quest4.1">
+                <QuestDescription title="> Destroy their civilisation" description="Even if they had reasons, they are still murderers and can not be trusted anymore. This whole thing might even be a setup... We need to kill them and destroy their planet!" failMessage="" completeMessage="" />
+                <hints>
+                    <QuestHint id="quest4.1hint1">
+                        <QuestDescription title="Choosing" description="To make this choice, kill the remaining enemy ships. The divisions will follow your decision." />
+                    </QuestHint>
+                </hints>
+            </GlobalQuest>
+            <GlobalQuest id="quest4.2">
+                <QuestDescription title="> Spare them and leave" description="Military tension arising from a missunderstanding is no valid reasoning for a genocide. Nothing is. We should leave and talk this out later." failMessage="" completeMessage="" />
+                <hints>
+                    <QuestHint id="quest4.2hint1">
+                        <QuestDescription title="Choosing" description="To make this choice, fly out of the sector. The divisions will follow your decision." />
+                    </QuestHint>
+                </hints>
+            </GlobalQuest>
+        </subquests>
+    </GlobalQuest>
+
+    <!--EVENTS AND TRIGGERS
+        Usable events and triggers:
+        spawntrigger
+    -->
+
+    <EventMultiTrigger name="spawntrigger" activations=1>
+        <events>
+            <trigger>
+                <EventListener event="playerSpawn" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventMultiTrigger name="spawned" stayactive=true activations=1>
+        <events>
+            <trigger>
+                <EventListener event="spawntrigger" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger name="reachedSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true />
+
+    <EventMultiTrigger name="addQuest2">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=10 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedSector" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger name="alliesReachedWait" position="<?lua printC(cAllyWait) ?>" distance="1000" target="SpaceShip" beaconMode="identify" targetname="Ally" stayactive=true />
+
+    <!-- So the allies stall when they reached their position for negociation and don´t fire away... -->
+
+    <EventDispatcher name="allyControllerDispatcher">
+      <targets>
+        <EventTarget target="allyController" />
+      </targets>
+      <events>
+          <activity>
+                <Trigger mode=or>
+                    <EventTrigger invert=true>
+                        <events>
+                            <trigger>
+                                <EventListener event="alliesReachedWait" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                    <EventTrigger>
+                        <events>
+                            <trigger>
+                                <EventListener event="noMercy" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                    <Trigger mode=and>
+                        <EventTrigger>
+                            <events>
+                                <trigger>
+                                    <EventListener event="fightBegun" />
+                                </trigger>
+                            </events>
+                        </EventTrigger>
+                        <EventTrigger invert=true>
+                            <events>
+                                <trigger>
+                                    <EventListener event="oneUnitLeft" />
+                                </trigger>
+                            </events>
+                        </EventTrigger>
+                    </Trigger>
+                </Trigger>
+          </activity>
+      </events>
+    </EventDispatcher>
+
+    <EventMultiTrigger name="hintBeacon">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=70 >
+                   <events>
+                      <trigger>
+                         <EventListener event="reachedSector" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <DistanceTrigger name="cloakBeacon" position="<?lua printC(cBeacon) ?>" distance=100 target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true />
+
+    <EventMultiTrigger name="fightBegun" stayactive=true>
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=12>
+                   <events>
+                      <trigger>
+                         <EventListener event="cloakBeacon" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventDispatcher name="enemyControllerDispatcher">
+      <targets>
+        <EventTarget target="enemyController" />
+      </targets>
+      <events>
+          <activity>
+              <Trigger mode=and>
+                  <EventTrigger>
+                      <events>
+                          <trigger>
+                              <EventListener event="fightBegun" />
+                          </trigger>
+                      </events>
+                  </EventTrigger>
+                  <EventTrigger invert=true>
+                      <events>
+                          <trigger>
+                              <EventListener event="oneUnitLeft" />
+                          </trigger>
+                      </events>
+                  </EventTrigger>
+              </Trigger>
+          </activity>
+      </events>
+    </EventDispatcher>
+
+    <EventMultiTrigger name="noMercy" stayactive=true>
+        <events>
+            <trigger>
+                <EventListener event="allUnitsDown" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventMultiTrigger name="enemyPlanetMulti">
+     <events>
+         <trigger>
+             <EventListener event="enemyPlanet" />
+         </trigger>
+     </events>
+    </EventMultiTrigger>
+
+    <!-- Recursive helper function for the event at the "end" of a Unit.-->
+    <?lua
+    function enemyTriggerRecursor(i, k)
+    if i > 0 then
+    return [[
+    <EventTrigger name=killedEnemy]] .. ((k-1)*4+i) .. [[ activations=1 stayactive=true delay=0.1>
+        <events>
+            <trigger>
+                <EventListener event=enemy]] .. k .. [[ />
+            </trigger>
+        </events>
+        ]] .. enemyTriggerRecursor(i-1, k) .. [[
+    </EventTrigger>
+    ]]
+    else return ""
+    end
+    end
+    ?>
+    <!-- Actual recursive Event(s) for the respective Units. (packs of 4 Enemies that is!) -->
+    <?lua
+    for k = 1, enemies, 1
+    do
+    print(enemyTriggerRecursor(4,k))
+    ?>
+    <EventMultiTrigger name="unit<?lua print(k) ?>Down" delay=0.1 stayactive=true>
+        <events>
+            <trigger>
+                <EventListener event="killedEnemy<?lua print(k*4) ?>" />
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+    <?lua end ?>
+
+    <EventMultiTrigger name="oneUnitLeft" stayactive=true>
+        <events>
+            <trigger>
+                <Trigger mode=or>
+                    <?lua
+                    for k = 1, enemies, 1
+                    do
+                    ?>
+                        <Trigger mode=and>
+                            <EventTrigger invert=true>
+                                <events>
+                                    <trigger>
+                                        <EventListener event="unit<?lua print(k) ?>Down" />
+                                    </trigger>
+                                </events>
+                            </EventTrigger>
+                            <?lua
+                            for i = 1, enemies, 1
+                            do
+                            if not (i == k) then
+                            ?>
+                            <EventTrigger>
+                                <events>
+                                    <trigger>
+                                        <EventListener event="unit<?lua print(i) ?>Down" />
+                                    </trigger>
+                                </events>
+                            </EventTrigger>
+                            <?lua end end ?>
+                        </Trigger>
+                    <?lua end ?>
+                </Trigger>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <EventMultiTrigger name="allUnitsDown" stayactive=true>
+        <events>
+            <trigger>
+                <Trigger mode=and>
+                    <?lua
+                    for k = 1, enemies, 1
+                    do
+                    ?>
+                    <EventTrigger>
+                        <events>
+                            <trigger>
+                                <EventListener event="unit<?lua print(k) ?>Down" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                    <?lua end ?>
+                </Trigger>
+            </trigger>
+        </events>
+    </EventMultiTrigger>
+
+    <!--TODO: Complete the DistanceTriggers for completing/succeeding correctly! -->
+
+    <DistanceTrigger active=false invert=true name="almostLeft" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector-200) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true>
+        <events>
+            <activity>
+                <Trigger mode=and>
+                    <EventTrigger>
+                        <events>
+                            <trigger>
+                                <EventListener event="oneUnitLeft" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                    <EventTrigger invert=true>
+                        <events>
+                            <trigger>
+                                <EventListener event="enemyPlanetMulti" />
+                            </trigger>
+                        </events>
+                    </EventTrigger>
+                </Trigger>
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <DistanceTrigger active=false invert=true name="leftSector" position="<?lua printC(cSector) ?>" distance="<?lua print(radSector) ?>" target="SpaceShip" beaconMode="identify" targetname="Commander" stayactive=true>
+        <events>
+            <activity>
+                <EventListener event="oneUnitLeft" />
+            </activity>
+        </events>
+    </DistanceTrigger>
+
+    <Script code="Mission endMission true" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event="leftSector" />
+            </trigger>
+        </events>
+    </Script>
+
+    <!--QUEST EFFECT BEACONS -->
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest1" />
+            <AddQuestHint HintId="quest1hint1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="spawntrigger" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest1" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="reachedSector" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest2" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="addQuest2" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuestHint hintId="quest2hint1
+                " />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="hintBeacon" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest2" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="cloakBeacon" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <AddQuest questId="quest3" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="fightBegun" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest3" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="oneUnitLeft" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+    <!--TODO: Include planet destruction and quitting -->
+
+    <QuestEffectBeacon times=1>
+        <effects>
+            <CompleteQuest questId="quest4" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="enemyAllGone" />
+            </execute>
+        </events>
+    </QuestEffectBeacon>
+
+
+    <!--NOTIFICATIONS -->
+
+    <SimpleNotification broadcast="true" message="Welcome, Commander. It is time to retaliate!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=4 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Get to section 5C and erradicate the aggressors!">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=8 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="That seems extreme. Is there no way around it?">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=12 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Stick to your objective, Commander. This is war.">
+        <events>
+            <trigger>
+                <EventTrigger stayactive="true" delay=16 >
+                   <events>
+                      <trigger>
+                         <EventListener event="spawntrigger" />
+                      </trigger>
+                   </events>
+                </EventTrigger>
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Huh?! The sector is empty! where are they hiding?">
+       <events>
+           <trigger>
+               <EventTrigger stayactive="true" delay=2 >
+                  <events>
+                     <trigger>
+                        <EventListener event="reachedSector" />
+                     </trigger>
+                  </events>
+               </EventTrigger>
+           </trigger>
+       </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="They must be cloaking themselves! But we'll figure it out...">
+      <events>
+          <trigger>
+              <EventTrigger stayactive="true" delay=6 >
+                 <events>
+                    <trigger>
+                       <EventListener event="reachedSector" />
+                    </trigger>
+                 </events>
+              </EventTrigger>
+          </trigger>
+      </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Got it! Look out for a bright light and touch it!">
+     <events>
+         <trigger>
+             <EventListener event="addQuest2" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Divisions are standing by, Sir.">
+     <events>
+         <trigger>
+             <EventListener event="alliesReachedWait" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Woah! what the hell! they boobytrapped us!">
+     <events>
+         <trigger>
+             <EventListener event="cloakBeacon" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Greetings, Humans. Are you here to resign to your menace and make amends?">
+     <events>
+         <trigger>
+             <EventTrigger stayactive="true" delay=4 >
+                <events>
+                   <trigger>
+                      <EventListener event="cloakBeacon" />
+                   </trigger>
+                </events>
+             </EventTrigger>
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Menace? What is he on about, General?">
+     <events>
+         <trigger>
+             <EventTrigger stayactive="true" delay=8 >
+                <events>
+                   <trigger>
+                      <EventListener event="cloakBeacon" />
+                   </trigger>
+                </events>
+             </EventTrigger>
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="None of your concern, Commander. Launch the attack!">
+     <events>
+         <trigger>
+             <EventTrigger stayactive="true" delay=12 >
+                <events>
+                   <trigger>
+                      <EventListener event="cloakBeacon" />
+                   </trigger>
+                </events>
+             </EventTrigger>
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Unit 1 down!">
+     <events>
+         <trigger>
+             <EventListener event="unit1Down" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Unit 2 down!">
+     <events>
+         <trigger>
+             <EventListener event="unit2Down" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Unit 3 down!">
+     <events>
+         <trigger>
+             <EventListener event="unit3Down" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Unit 4 down!">
+     <events>
+         <trigger>
+             <EventListener event="unit4Down" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Please! No More! We surrender!">
+     <events>
+         <trigger>
+             <EventListener event="oneUnitLeft" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Roger that, Commander. We destroy their planet.">
+     <events>
+         <trigger>
+             <EventListener event="allUnitsDown" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="Well done, Commander! Now exfiltrate the sector!">
+     <events>
+         <trigger>
+             <EventListener event="enemyPlanetMulti" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <SimpleNotification broadcast="true" message="This will have dire consequences, Commander!">
+     <events>
+         <trigger>
+             <EventListener event="almostLeft" />
+         </trigger>
+     </events>
+    </SimpleNotification>
+
+    <!--ELEMENTS -->
+
+    <!-- Billboard Path to Sector 5C. Height changes in an atan shape -->
+
+    <?lua
+    for i = 1, 11, 1
+    do
+    heightNow = cPathToEntry[1][2] - (cPathToEntry[1][2]-cSectorEntry[2])*(math.atan(-1.6+0.3*i) + 1)/2
+    cBillNow = {(cSectorEntry[1]-cPathToEntry[1][1])*i/12, heightNow, (cSectorEntry[3]-cPathToEntry[1][3])*i/12}
+    cPathToEntry[i+1] = cBillNow
+    ?>
+    <Billboard position="<?lua printC(cBillNow) ?>"  scale=2 material="Flares/ringflare" colour="0.2,0.9,0.2"/>
+    <?lua
+    end
+    cPathToEntry[13] = cSectorEntry
+    ?>
+
+    <Billboard position="<?lua printC(cSectorEntry) ?>"  scale=5 material="Flares/ringflare" colour="0.2,0.9,0.2"/>
+
+    <!-- Circular Billboard Ring around Sector 5C -->
+
+    <?lua
+    for i = 1, 64, 1
+    do
+    rBillboard = {math.sin(i*math.pi/32)*radSector, 0, math.cos(i*math.pi/32)*radSector}
+    cBillNow = addC(cSector,rBillboard)
+    ?>
+    <Billboard position="<?lua printC(cBillNow) ?>"  scale=10 material="Flares/lensflare" colour="1,0.2,0.2"/>
+    <?lua end ?>
+
+    <!-- Cloaking Beacon -->
+
+    <BlinkingBillboard visible=false active=false scale=2 position="<?lua printC(cBeacon) ?>" material="Flares/lensflare" frequency=1 amplitude=3 colour="0.4,0.4,1">
+        <events>
+            <activity>
+                <EventListener event="addQuest2" />
+            </activity>
+            <visibility>
+                <EventListener event="addQuest2" />
+            </visibility>
+        </events>
+    </BlinkingBillboard>
+
+    <!-- Asteroids you have to fly through to get to the EnemyBase -->
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+       asteroidField(cField1[1], cField1[2], cField1[3], 20, 30, 4500, 500, 0)
+    ?>
+
+    <!-- Other Asteroid-Fields -->
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+       asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 4500, 500, 0)
+    ?>
+
+    <!-- Planets -->
+
+   <Planet
+        position="<?lua printC(cPlanet1) ?>"
+        scale="3000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/muunilinst.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+    visible=true
+    active=true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+        </attached>
+        <collisionShapes>
+            <SphereCollisionShape radius="3000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    <Planet
+        position="<?lua printC(cPlanet2) ?>"
+        scale="2000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/ganymede.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+        visible=true
+        active=true
+      >
+      <attached>
+        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+        </attached>
+          <collisionShapes>
+            <SphereCollisionShape radius="2000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(cPlanet2[1], cPlanet2[2], cPlanet2[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
+    ?>
+
+    <!-- EnemyPlanet -->
+
+    <Planet
+        position="<?lua printC(cEnemyBasePlanet) ?>"
+        scale="5000"
+        collisionType="dynamic"
+        linearDamping="0.8"
+        angularDamping="0"
+        mass="5000000"
+        pitch="0"
+        mesh="planets/jupiter.mesh"
+        atmosphere="atmosphere1"
+        rotationaxis="1,0,0"
+        rotationrate="1.0"
+        atmospheresize="80.0f"
+        imagesize="1024.0f"
+        collisiondamage = 2
+        enablecollisiondamage = true
+        visible=false
+        active=false
+    >
+        <attached>
+           <ForceField position="0,0,0" rotationaxis="0.1,1,0.1"mode="sphere" diameter="10000" velocity="-500" />
+        </attached>
+        <events>
+            <activity>
+                <Trigger  name="enemyPlanetVisible" mode=and>
+                   <EventTrigger>
+                         <events>
+                             <trigger>
+                                 <EventListener event="cloakBeacon" />
+                             </trigger>
+                         </events>
+                     </EventTrigger>
+                     <EventTrigger invert=true>
+                         <events>
+                             <trigger>
+                                 <EventListener event="enemyPlanetMulti" />
+                             </trigger>
+                         </events>
+                     </EventTrigger>
+                 </Trigger>
+            </activity>
+            <visibility>
+                <Trigger  name="enemyPlanetVisible" mode=and>
+                   <EventTrigger>
+                         <events>
+                             <trigger>
+                                 <EventListener event="cloakBeacon" />
+                             </trigger>
+                         </events>
+                     </EventTrigger>
+                     <EventTrigger invert=true>
+                         <events>
+                             <trigger>
+                                 <EventListener event="enemyPlanetMulti" />
+                             </trigger>
+                         </events>
+                     </EventTrigger>
+                 </Trigger>
+            </visibility>
+        </events>
+        <collisionShapes>
+          <SphereCollisionShape position="0,0,0" radius=5000/>
+        </collisionShapes>
+    </Planet>
+
+    <!-- Pawn that represents the planet during destruction -->
+
+    <Pawn team=1 visible=false active=false scale=5000 health=500 name="enemyPlanet" position="<?lua printC(cEnemyBasePlanet) ?>" collisionType=dynamic mass=5000000 radarname="Enemy home planet">
+        <events>
+            <activity>
+                <EventListener event="allUnitsDown" />
+            </activity>
+            <visibility>
+                <EventListener event="allUnitsDown" />
+            </visibility>
+        </events>
+        <collisionShapes>
+          <SphereCollisionShape position="0,0,0" radius=5005/>
+        </collisionShapes>
+    </Pawn>
+    <!--SHIPS -->
+    <!-- one Controller to rule them all -->
+    <Pawn position = "100000, 100000, 100000">
+      <controller>
+        <MasterController>
+        </MasterController>
+      </controller>
+    </Pawn>
+    <!--Allied units-->
+
+    <?lua
+    for i = 1, allies, 1
+    do
+    rUnit = {-math.sin(math.pi*((i-1/2)/allies))*125, math.pow(-1,i)*80, math.cos(math.pi*((i-1/2)/allies))*800}
+    cAllyNow = addC(cAlly,rUnit)
+    ?>
+
+    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(cAllyNow) ?>" name="ally<?lua print(i) ?>.D">
+      <templates>
+        <Template link=ally />
+      </templates>
+      <controller>
+        <DivisionController name="allyController" team=0 formationMode="diamond" spread=100>
+          <actionpoints>
+              <?lua
+              for i = 1, 13, 1
+              do
+              ?>
+              <Actionpoint position="<?lua printC(addC(cPathToEntry[i], rUnit)) ?>" action="fly"/>
+              <?lua end ?>
+           </actionpoints>
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rSection)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.S">
+      <templates>
+        <Template link=ally />
+      </templates>
+      <controller>
+        <SectionController name="allyController" team=0>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman1)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W1">
+      <templates>
+        <Template link=ally />
+      </templates>
+      <controller>
+        <WingmanController name="allyController" team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip health=600 initialhealth=600 maxhealth=600 position="<?lua printC(addC(cAllyNow,rWingman2)) ?>" lookat="0,0,0" name="ally<?lua print(i) ?>.W2">
+      <templates>
+        <Template link=ally />
+      </templates>
+      <controller>
+        <WingmanController name="allyController" team=0>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+
+    <?lua end ?>
+
+    <!-- Enemy Units -->
+
+    <?lua
+    for k = 1, enemies, 1
+    do
+    rUnit = {125 -math.sin(math.pi*((k-1/2)/enemies))*200, math.pow(-1,k)*300, math.cos(math.pi*((k-1/2)/enemies))*1000}
+    cEnemyNow = addC(cEnemy,rUnit)
+    ?>
+
+    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(cEnemyNow) ?>" name="enemy<?lua print(k) ?>">
+      <templates>
+        <Template link=enemy />
+      </templates>
+      <events>
+          <activity>
+              <EventListener event="cloakBeacon" />
+          </activity>
+          <visibility>
+              <EventListener event="cloakBeacon" />
+          </visibility>
+      </events>
+      <controller>
+        <DivisionController name="enemyController" active=false team=1 formationMode="diamond" spread=100>
+          <actionpoints>
+              <Actionpoint position="<?lua printC(cEnemyNow) ?>" action="fightall" />
+          </actionpoints>
+        </DivisionController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rSection)) ?>" name="enemy<?lua print(k) ?>">
+      <templates>
+        <Template link=enemy />
+      </templates>
+      <events>
+          <activity>
+              <EventListener event="cloakBeacon" />
+          </activity>
+          <visibility>
+              <EventListener event="cloakBeacon" />
+          </visibility>
+      </events>
+      <controller>
+        <SectionController name="enemyController" active=false team=1>
+        </SectionController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman1)) ?>" lookat="0,0,0" name="enemy<?lua print(k) ?>">
+      <templates>
+        <Template link=enemy />
+      </templates>
+      <events>
+          <activity>
+              <EventListener event="cloakBeacon" />
+          </activity>
+          <visibility>
+              <EventListener event="cloakBeacon" />
+          </visibility>
+      </events>
+      <controller>
+        <WingmanController name="enemyController" active=false team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+
+    <SpaceShip health=400 initialhealth=400 maxhealth=400 position="<?lua printC(addC(cEnemyNow,rWingman2)) ?>" name="enemy<?lua print(k) ?>">
+      <templates>
+        <Template link=enemy />
+      </templates>
+      <events>
+          <activity>
+              <EventListener event="cloakBeacon" />
+          </activity>
+          <visibility>
+              <EventListener event="cloakBeacon" />
+          </visibility>
+      </events>
+      <controller>
+        <WingmanController name="enemyController" active=false team=1>
+        </WingmanController>
+      </controller>
+    </SpaceShip>
+
+    <?lua end ?>
+
+    </Scene>
+</Level>
Index: code/branches/presentationHS15/data/levels/templates/spaceshipShuttle.oxt
===================================================================
--- code/branches/presentationHS15/data/levels/templates/spaceshipShuttle.oxt	(revision 10970)
+++ code/branches/presentationHS15/data/levels/templates/spaceshipShuttle.oxt	(revision 10970)
@@ -0,0 +1,101 @@
+<Template name=spaceshipShuttle>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipTransportercameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 2000
+   maxhealth         = 2500
+   initialhealth     = 2000
+
+   primaryThrust     = 120;
+   auxilaryThrust    = 20;
+   rotationThrust    = 30;
+
+   collisionType     = "dynamic"
+   mass              = 1000
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshipTransporterengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=180 pitch=0 roll=0 scale=10 mesh="Transporterspaceship.mesh" />
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position=" 0, 0, 20"      halfExtents=" 37, 25, 80" />
+      <BoxCollisionShape position=" 0, 21, 20"      halfExtents=" 37, 21, 80" />
+      <BoxCollisionShape position=" 0, 40, 110"      halfExtents=" 20, 10, 40" />
+      <BoxCollisionShape position=" 0, 45, 170"      halfExtents=" 33, 25, 20" />
+      <BoxCollisionShape position=" -60, 33, 0"      halfExtents=" 24, 16, 120" />
+      <BoxCollisionShape position=" 60, 33, 0"      halfExtents=" 24, 16, 120" />
+      <BoxCollisionShape position=" 0, 10, -90"      halfExtents=" 30, 25, 30" />
+      <BoxCollisionShape position=" 0, -3, -145"      halfExtents=" 20, 20, 30" />
+    </collisionShapes>
+
+<?lua
+  include("../includes/weaponSettingsTransporter.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipTransportercameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,90,350" drag=true mouselook=true />
+      <CameraPosition position="0,125, 400" drag=true mouselook=true />
+      <CameraPosition position="0,200,550" drag=true mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipTransporterengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2
+
+   speedfront     = 120
+   speedback      =  20
+   speedleftright =  20
+   speedupdown    =  20
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 40
+   accelerationbrake     = 30
+   accelerationback      = 20
+   accelerationleftright =  20
+   accelerationupdown    =  20
+  >
+    <EffectContainer condition="idle">
+      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+    </EffectContainer>
+    <EffectContainer condition="not idle">
+
+    </EffectContainer>
+    <EffectContainer condition="normal or brake">
+
+    </EffectContainer>
+    <EffectContainer condition="normal or boost">
+      <Backlight mainstate=activity active=false scale=2 name=bltest position=" -80, 33, 100" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=2 name=bltest position=" 80, 33, 100" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=2 name=bltest position=" -75, 25, -57" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=2 name=bltest position=" 75, 25, -57" colour="1, 0.7, 0.1, 1.0" width=10 length=3000 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+    </EffectContainer>
+    <EffectContainer condition="boost">
+      <Backlight mainstate=activity active=false scale=3 name=bltest position=" -80, 33, 100" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=3 name=bltest position=" 80, 33, 100" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=3 name=bltest position=" -75, 25, -57" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=3 name=bltest position=" 75, 25, -57" colour="1, 0.7, 0.1, 0.7" width=25 length=2000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+    <EffectContainer condition="brake">
+      <FadingBillboard mainstate=activity active=false scale=2 position=" -75, 33, 40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=2 position=" 75, 33, 40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=1 position=" -68, 25, -115" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=1 position=" 68, 25, -115" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+  </MultiStateEngine>
+</Template>
