Index: code/branches/dockingsystem2/data/levels/docking.oxw
===================================================================
--- code/branches/dockingsystem2/data/levels/docking.oxw	(revision 8255)
+++ code/branches/dockingsystem2/data/levels/docking.oxw	(revision 8257)
@@ -30,6 +30,66 @@
       <SpawnPoint position="<?lua print(math.random() * 500 - 250) ?>,<?lua print(math.random() * 500 - 250) ?>,<?lua print(math.random() * 500 - 250) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     <?lua end ?>
-    
-    <Destroyer
+
+    <Dock position="-50,-100,50">
+            <effects>
+                <DockToShip target="asdf" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event="dockMe" />
+                </execute>
+            </events>
+            <attached>
+                <DistanceTrigger position="0,0,0" distance="20" target="Pawn" beaconMode="exclude" targetname="beacon1" name="dockMe" />
+                <Billboard material="Examples/Flare" colour="1.0, 0, 0" />
+            </attached>
+        </Dock>
+
+
+      <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipassffcameras
+   engine                 = spaceshipassffengine
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   primaryThrust     = 100;
+   auxilaryThrust    = 30;
+   rotationThrust    = 25;
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <attached>
+        <DistanceTriggerBeacon name="beacon1" />
+        <DockingTarget name="asdf" />
+
+      <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
+      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+      <DistanceTriggerBeacon name="PlayerDistanceTrigger" /> <!--added DistanceTrigger-->
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
+      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
+      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
+      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
+    </collisionShapes>
+<?lua
+  include("includes/weaponSettingsAssff.oxi")
+?>
+  </SpaceShip>
+
+
+    <!--  <Destroyer
       position          = "100,150,0"
       collisionType     = dynamic
@@ -43,20 +103,9 @@
 
       <attached>
-        <Dock>
-            <effects>
-                <DockToShip />
-            </effects>
-            <events>
-                <execute>
-                    <EventListener event="dockMe" />
-                </execute>
-            </events>
-            <attached>
-                <DistanceTrigger position="0,0,0" distance="20" target="Pawn" beaconMode="exclude" targetname="beacon1" name="dockMe" />
-                <Billboard material="Examples/Flare" colour="1.0, 0, 0" />
-            </attached>
-        </Dock>
+        
         <DistanceTriggerBeacon name="beacon1" />
-      
+        <DockingTarget name="asdf" />
+
+
         <TeamSpawnPoint team=1 position="150,0,7" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
         <TeamSpawnPoint team=1 position="0,0,7" lookat="-1,0,0" roll="90"  yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
@@ -145,5 +194,5 @@
       </collisionShapes>
     </Destroyer>
-    
+    //-->
 
   </Scene>
Index: code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	(revision 8257)
@@ -1,3 +1,4 @@
 SET_SOURCE_FILES(DOCKING_SRC_FILES
+  DockingTarget.cc
   DockingEffect.cc
   DockToShip.cc
Index: code/branches/dockingsystem2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.cc	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.cc	(revision 8257)
@@ -73,6 +73,4 @@
     bool Dock::execute(bool bTriggered, BaseObject* trigger)
     {
-        //TODO: Handle DistanceMultiTrigger
-
         PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
         Pawn* pawn = NULL;
@@ -104,19 +102,9 @@
         }
 
-        // Try to get HumanPlayer
-        if(!player->isHumanPlayer()) {
-            COUT(0) << "Docking::execute Not triggered by a human." << std::endl;
-            return false;
-        }
-        HumanPlayer* human = orxonox_cast<HumanPlayer*>(player);
-        if(human == NULL) {
-            COUT(0) << "Docking::execute Player was not as human as expected.." << std::endl;
-        }
-        COUT(0) << "Dock triggered by player: " << human->getName() << ".." << std::endl;
+        COUT(0) << "Dock triggered by player: " << player->getName() << ".." << std::endl;
 
-        //TODO: This is waaay too oversimplified
         if(bTriggered) {
             DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
-            //DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
+            DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
         } else {
             DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
Index: code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	(revision 8257)
@@ -51,4 +51,20 @@
     }
 
+
+    void DockToShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) {
+        SUPER(DockToShip, XMLPort, xmlelement, mode);
+
+        XMLPortParam(DockToShip, "target", setTargetId, getTargetId, xmlelement, mode);
+    }
+
+    void DockToShip::setTargetId(std::string str) {
+        this->target = str;
+    }
+
+    std::string DockToShip::getTargetId() {
+        return this->target;
+    }
+
+
     bool DockToShip::docking(PlayerInfo* player)
     {
@@ -60,4 +76,19 @@
     {
         COUT(0) << "DockToShip::attach" << endl;
+
+        DockingTarget *target = DockingEffect::findTarget(this->target);
+        if (target == NULL) {
+            COUT(0) << "Can't retrieve target for '" << this->target << "'.." << std::endl;
+            return false;
+        }
+
+        ControllableEntity *dockTo = (ControllableEntity*) target->getParent();
+        if (dockTo == NULL) {
+            COUT(0) << "Parent is not a ControllableEntity.." << std::endl;
+            return false;
+        }
+
+        player->startTemporaryControl(dockTo);
+
         return true;
     }
Index: code/branches/dockingsystem2/src/modules/docking/DockToShip.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.h	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.h	(revision 8257)
@@ -39,4 +39,6 @@
 #include "DockToShip.h"
 
+#include "worldentities/ControllableEntity.h"
+
 
 namespace orxonox
@@ -58,7 +60,14 @@
             virtual ~DockToShip();
 
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void setTargetId(std::string str);
+            virtual std::string getTargetId();
+
             virtual bool docking(PlayerInfo* player); //!< Called when docking starts
             virtual bool attach(PlayerInfo* player); //!< Called after docking animation
             virtual bool release(PlayerInfo* player); //!< Called when player wants undock
+
+        private:
+            std::string target;
     };
 
Index: code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	(revision 8257)
@@ -33,5 +33,4 @@
 
 #include "DockingEffect.h"
-#include "core/CoreIncludes.h"
 
 namespace orxonox
@@ -71,3 +70,13 @@
         return check;
     }
+
+    DockingTarget *DockingEffect::findTarget(std::string name) {
+        for (ObjectList<DockingTarget>::iterator it = ObjectList<DockingTarget>::begin();
+                                 it != ObjectList<DockingTarget>::end(); ++it)
+        {
+            if ((*it)->getName().compare(name) == 0)
+                return (*it);
+        }
+        return NULL;
+    }
 }
Index: code/branches/dockingsystem2/src/modules/docking/DockingEffect.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	(revision 8257)
@@ -36,5 +36,11 @@
 #define _DockingEffect_H__
 
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "infos/PlayerInfo.h"
+
 #include "DockingPrereqs.h"
+#include "DockingTarget.h"
 
 #include <list>
@@ -68,7 +74,8 @@
             virtual bool docking(PlayerInfo* player) = 0; //!< Called when docking starts
             virtual bool attach(PlayerInfo* player) = 0; //!< Called after docking animation
-            virtual bool release(PlayerInfo* player) = 0; //!< Called when player wants undock
+            virtual bool release(PlayerInfo* player) = 0; //!< Called when player wants to undock
 
             static bool invokeEffect(docking::event event, PlayerInfo* player, std::list<DockingEffect*> & effects); //!< Invokes the event specific method of all DockingEffects in the list
+            static DockingTarget *findTarget(std::string name); //!< Iterates through all DockingTarget objects to find the one with name=target
     };
 
Index: code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	(revision 8255)
+++ code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	(revision 8257)
@@ -66,4 +66,5 @@
 {
     class Dock;
+    class DockingTarget;
     class DockingEffect;
     class DockToShip;
Index: code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc	(revision 8257)
+++ code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc	(revision 8257)
@@ -0,0 +1,68 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DockingTarget.cc
+	@brief Docking system main class
+*/
+
+#include "DockingTarget.h"
+#include "core/XMLPort.h"
+
+
+namespace orxonox
+{
+    CreateFactory(DockingTarget);
+
+    DockingTarget::DockingTarget(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(DockingTarget);
+    }
+
+    DockingTarget::~DockingTarget()
+    {
+    }
+
+
+    void DockingTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DockingTarget, XMLPort, xmlelement, mode);
+        XMLPortParam(DockingTarget, "name", setName, getName, xmlelement, mode);
+
+        COUT(0) << "DockingTarget with name '" << this->getName() << "' created.." << std::endl;
+    }
+
+
+    void DockingTarget::setName(std::string str) {
+        this->name = str;
+    }
+
+    std::string DockingTarget::getName() {
+        return this->name;
+    }
+}
Index: code/branches/dockingsystem2/src/modules/docking/DockingTarget.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingTarget.h	(revision 8257)
+++ code/branches/dockingsystem2/src/modules/docking/DockingTarget.h	(revision 8257)
@@ -0,0 +1,71 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki 
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DockingTarget.h
+    @brief Definition of the DockingTarget class.
+    @ingroup Docking
+*/
+
+#ifndef _DockingTarget_H__
+#define _DockingTarget_H__
+
+#include "DockingPrereqs.h"
+
+#include "core/BaseObject.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        DockingTargets for @ref orxonox::Docking "Docks".
+
+    @author
+        Sven Stucki
+
+    @ingroup Docking
+    */
+    class _DockingExport DockingTarget : public StaticEntity
+    {
+        private:
+            std::string name;
+
+        public:
+            DockingTarget(BaseObject* creator);
+            virtual ~DockingTarget();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void setName(std::string str);
+            virtual std::string getName();
+    };
+
+}
+
+#endif /* _DockingTarget_H__ */
