Index: code/branches/pickup3/src/modules/CMakeLists.txt
===================================================================
--- code/branches/pickup3/src/modules/CMakeLists.txt	(revision 6418)
+++ code/branches/pickup3/src/modules/CMakeLists.txt	(revision 6419)
@@ -29,4 +29,5 @@
 ADD_SUBDIRECTORY(objects)
 ADD_SUBDIRECTORY(overlays)
+ADD_SUBDIRECTORY(pickup)
 ADD_SUBDIRECTORY(pong)
 ADD_SUBDIRECTORY(questsystem)
Index: code/branches/pickup3/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/branches/pickup3/src/modules/pickup/CMakeLists.txt	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/CMakeLists.txt	(revision 6419)
@@ -0,0 +1,18 @@
+SET_SOURCE_FILES(PICKUP_SRC_FILES
+  PickupCollection.cc
+  PickupSpawner.cc
+)
+
+ORXONOX_ADD_LIBRARY(pickup
+  MODULE
+  FIND_HEADER_FILES
+  TOLUA_FILES
+  DEFINE_SYMBOL
+    "PICKUP_SHARED_BUILD"
+  PCH_FILE
+    PickupPrecompiledHeaders.h
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${PICKUP_SRC_FILES}
+)
+
Index: code/branches/pickup3/src/modules/pickup/DroppedItem.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/DroppedItem.cc	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/DroppedItem.cc	(revision 6419)
@@ -0,0 +1,114 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DroppedItem.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "BaseItem.h"
+#include "graphics/Billboard.h"
+#include "graphics/Model.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(DroppedItem); //TODO: This isn't needed, is it?
+
+    /**
+    @brief
+        Constructor. Registers object and sets default values.
+    */
+    DroppedItem::DroppedItem(BaseObject* creator) : PickupSpawner(creator)
+    {
+        RegisterObject(DroppedItem);
+    }
+
+    DroppedItem::DroppedItem(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems) : PickupSpawner(creator, item, triggerDistance, respawnTime, maxSpawnedItems)
+    {
+        RegisterObject(DroppedItem);
+        this->item_ = item;
+    }
+
+    /**
+    @brief
+        Default destructor.
+    */
+    DroppedItem::~DroppedItem()
+    {
+        
+    }
+
+    BaseItem* DroppedItem::getItem(void)
+    {
+        return this->item_;
+    }
+
+    /**
+    @brief
+        
+    */
+    //TODO: Comment.
+    //Each pickup should have a XML template where the Model and Billboard, and so on, is specified.
+    /*static*/ DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour, float timeToLive)
+    {
+        //TODO: triggerDistance?
+        float triggerDistance = 20.0;
+        DroppedItem* droppedItem = new DroppedItem(item, item, triggerDistance, 0, 1);
+        
+        //TODO: Do this somehwere else?
+        Model* model = new Model(item);
+        Billboard* billboard = new Billboard(item);
+
+        model->setMeshSource("sphere.mesh");
+        model->setScale(3.0f);
+
+        billboard->setMaterial("Examples/Flare");
+        billboard->setColour(flareColour);
+        billboard->setScale(0.5f);
+
+        droppedItem->setPosition(position);
+        droppedItem->attach(model);
+        droppedItem->attach(billboard);
+
+        COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << ',' << position.y << ',' << position.z << ")." << std::endl;
+
+        return droppedItem;
+    }
+
+    /**
+    @brief
+
+    */
+    //TODO: See one function above.
+    DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, Pawn* pawn, const ColourValue& flareColour, float timeToLive)
+    {
+        Vector3 after = pawn->getPosition() + pawn->getOrientation() * Vector3(0.0f, 0.0f, 50.0f);
+        return DroppedItem::createDefaultDrop(item, after, flareColour, timeToLive);
+    }
+}
Index: code/branches/pickup3/src/modules/pickup/DroppedItem.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/DroppedItem.h	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/DroppedItem.h	(revision 6419)
@@ -0,0 +1,63 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of DroppedItem
+*/
+
+#ifndef _DroppedItem_H__
+#define _DroppedItem_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "PickupSpawner.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DroppedItem : public PickupSpawner
+    {
+        public:
+            DroppedItem(BaseObject* creator);
+            DroppedItem(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems);
+            virtual ~DroppedItem();
+
+            static DroppedItem* createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour = ColourValue(0.5f, 1.0f, 0.3f), float timeToLive = 0);
+            static DroppedItem* createDefaultDrop(BaseItem* item, Pawn* pawn, const ColourValue& flareColour = ColourValue(0.5f, 1.0f, 0.3f), float timeToLive = 0);
+
+        protected:
+            virtual BaseItem* getItem(void);
+
+        private:
+
+            BaseItem* item_; //!< The dropped item.
+
+    };
+}
+
+#endif /* _DroppedItem_H__ */
Index: code/branches/pickup3/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollection.cc	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/PickupCollection.cc	(revision 6419)
@@ -0,0 +1,231 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of PickupCollection.
+*/
+
+#include "PickupCollection.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "interfaces/PickupCarrier.h"
+
+namespace orxonox
+{
+ 
+    /**
+    @brief
+        Default Constructor.
+    */
+    PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(PickupCollection);
+    }
+    
+    /**
+    @brief
+        Destructor.
+    */
+    PickupCollection::~PickupCollection()
+    {
+        //! Destroy all Pickupables constructing this PickupCollection.
+        for(std::list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            delete *it;
+        }
+    }
+    
+    /**
+    @brief
+        Creates an instance of this Class through XML.
+    */
+    void PickupCollection::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PickupCollection, XMLPort, xmlelement, mode);
+        
+        //TODO: Does this work? Problem could be, that Pickupable itself cannot be instantiated through XML...
+        XMLPortObject(PickupCollection, PickupCollection, "pickupables", addPickupable, getPickupable, xmlelement, mode);
+    }
+    
+    /**
+    @brief
+        Add the input Pickupable to list of Pickupables combined by this PickupCollection.
+    @param pickup
+        The Pickupable to be added.
+    @return
+        Returns true if successful,
+    */
+    bool PickupCollection::addPickupable(Pickupable* pickup)
+    {
+        if(pickup == NULL)
+            return false;
+        
+        this->pickups_.insert(pickup);
+        return true;
+    }
+    
+    /**
+    @brief
+        Get the Pickupable at the given index.
+    @param index
+        The index the Pickupable is fetched from.
+    @return
+        Returns a pointer to the Pickupable at the index given by index.
+    */
+    Pickupable* PickupCollection::getPickupable(unsigned int index)
+    {
+        return this->pickups_[index]; //TODO. Does this work?
+    }
+    
+    //TODO: Steal description from Pickupable.
+    void PickupCollection::changedUsed(void)
+    {
+        SUPER(PickupCollection, changedUsed);
+        
+        //! Change used for all Pickupables this PickupCollection consists of.
+        for(std::list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            (*it)->changedUsed();
+        }
+    }
+    
+    /**
+    @brief
+        Puts the PickupCollection in use.
+    @return
+        Returns true if successful.
+    */
+    //TODO: Revert if one fails? (same for unused)
+    bool PickupCollection::use(void)
+    {
+        if(this->isUsed())
+            return false;
+        
+        bool success = true;
+        //! Set all Pickupables to used.
+        for(std::list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            if(!(*it)->use())
+            {
+                success = false;
+            }
+        }
+        
+        this->changedUsed();
+        
+        return success;
+    }
+    
+    /**
+    @brief
+        Puts the PickupCollection out of use.
+    @return
+        Returns true if successful.
+    */
+    bool PickupCollection::unuse(void)
+    {
+        if(!this->isUsed())
+            return false;
+        
+        bool success = true;
+        //! Set all Pickupables to unused.
+        for(std::list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            if(!(*it)->unuse())
+            {
+                success = false;
+            }
+        }
+        
+        this->changedUsed();
+        
+        return success;
+    }
+
+    /**
+    @brief
+        Is invoked when the pickup is picked up.
+    @param carrier
+        The PickupCarrier that is picking up this pickup.
+    @return
+        Returns true if successful.
+    */
+    //TODO: Something should happen in the carrier as well, maybe just in the carrier. Owner might not be correct if the carrier hands the pickup down or up. Maybe even a Pawn as input instead fo a carrier. Or do this in Spawner?
+    bool PickupCollection::pickup(PickupCarrier* carrier)
+    {
+        if(this->getOwner() != NULL)
+        {
+            COUT(2) << "Pickup wanted to get picked up by a new carrier, but it already has a carrier." << std::endl;
+            return false;
+        }
+        for(std::list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            (*it)->setOwner(carrier);
+        }
+        
+        this->setOwner(carrier);
+        
+        return true;
+    }
+    
+    /**
+    @brief
+        Drop the pickup.
+    @return
+        Return true if successful.
+    */
+    bool PickupCollection::drop(void)
+    {
+        this->unuse();
+        this->setOwner(NULL);
+        
+        //TODO: Create new Pickupspawner/DroppedPickup
+        return true;
+    }
+    
+    //TODO: Steal description from Pickupable.
+    Pickupable* PickupCollection::clone()
+    {
+        Template* collectionTemplate = Template::getTemplate(this->getIdentifier()->getName());
+        BaseObject* newObject = collectionTemplate->getBaseclassIdentifier()->fabricate(this);
+        
+        PickupCollection* newCollection = dynamic_cast<PickupCollection*>(newObject);
+        for(std::list<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            Pickupable* newPickup = (*it)->clone();
+            newCollection->pickups_.push_back(newPickup);
+        }
+        
+        Pickupable* pickup = dynamic_cast<Pickupable*>(newCollection);
+        return pickup;
+    }
+    
+}
Index: code/branches/pickup3/src/modules/pickup/PickupCollection.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollection.h	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/PickupCollection.h	(revision 6419)
@@ -0,0 +1,81 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PickupCollection_H__
+#define _PickupCollection_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include "interfaces/Pickupable.h"
+#include "core/BaseObject.h"
+#include "core/XMLPort.h"
+
+#include <list>
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The PickupCollection combines different Pickupables to a coherent, single pickup and makes the seem (from the outside looking in) just as if they were just one Pickupable.
+    @author
+        Damian 'Mozork' Frick
+    */
+    //TODO: Isn't private inheritance sufficient?
+    class _PickupExport PickupCollection : public Pickupable, public BaseObject
+    {
+        
+        public:
+            
+            PickupCollection(BaseObject* creator);
+            virtual ~PickupCollection();
+            
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void changedUsed(void);
+            
+            virtual bool use(void);
+            virtual bool unuse(void);
+            
+            virtual bool pickup(PickupCarrier* carrier);
+            virtual bool drop(void);
+            
+            virtual Pickupable* clone(void);
+            
+            bool addPickupable(Pickupable* pickup);
+            Pickupable* getPickupable(unsigned int index);
+            
+        private:
+            
+            std::list<Pickupable*> pickups_;
+        
+    };
+    
+}
+
+#endif /* _PickupCollection_H__ */
Index: code/branches/pickup3/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupPrereqs.h	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/PickupPrereqs.h	(revision 6419)
@@ -0,0 +1,73 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the questsystem module
+*/
+
+#ifndef _PickupPrereqs_H__
+#define _PickupPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef QUESTSYSTEM_SHARED_BUILD
+#    define _PickupExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _PickupExport
+#    else
+#      define _PickupExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _PickupExport  __attribute__ ((visibility("default")))
+#else
+#  define _PickupExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+
+    class PickupCollection;
+    class PickupSpawner;
+    
+}
+
+#endif /* _PickupPrereqs_H__ */
Index: code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	(revision 6419)
@@ -0,0 +1,295 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of PickupSpawner.
+*/
+
+#include "PickupSpawner.h"
+
+#include "core/CoreIncludes.h"
+//#include "core/GUIManager.h"     // HACK; see below
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+//#include "PickupInventory.h"    // HACK; Only for hack, remove later
+
+
+namespace orxonox
+{
+
+//     const float PickupSpawner::bounceSpeed_s = 6.0f;
+//     const float PickupSpawner::rotationSpeed_s = 1.0f;
+//     const float PickupSpawner::bounceDistance_s = 4.0f;
+
+    CreateFactory(PickupSpawner);
+
+    /**
+    @brief
+        Constructor. Registers the PickupSpawner.
+    @param creator
+        Pointer to the object which created this item.
+    */
+    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator)
+    {
+        this->initialize();
+    }
+
+    PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator)
+    {
+        this->initialize();
+  
+        this->pickup_ = pickup;
+
+        this->triggerDistance_ = triggerDistance;
+        this->respawnTime_ = respawnTime;
+        this->setMaxSpawnedItems(maxSpawnedItems);
+    }
+
+    void PickupSpawner::initialize(void)
+    {
+        RegisterObject(PickupSpawner);
+
+        this->pickup_ = NULL;
+        
+        this->triggerDistance_ = 20;
+        this->respawnTime_ = 0;
+        this->tickSum_ = 0;
+        this->maxSpawnedItems_ = INF;
+        this->spawnsRemaining_ = INF;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    PickupSpawner::~PickupSpawner()
+    {
+        
+    }
+
+    /**
+    @brief
+        Method for creating a PickupSpawner through XML.
+    @param xmlelement
+        XML element which contains the PickupSpawner.
+    @param mode
+        XMLPort mode.
+    */
+    void PickupSpawner::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PickupSpawner, XMLPort, xmlelement, mode);
+
+        XMLPortObject(PickupSpawner, Pickupable, "pickup", addPickupable, getPickupable, xmlelement, mode);
+        
+        XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
+        XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
+        XMLPortParam(PickupSpawner, "maxSpawnedItems", setMaxSpawnedItems, getMaxSpawnedItems, xmlelement, mode);
+
+        //TODO: Kill hack.
+        // HACKs
+        // Load the GUI image as soon as the PickupSpawner gets loaded
+        //  = less delays while running
+//         BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
+//         BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
+//         if (asItem)
+//         {
+//             asItem->addTemplate(this->itemTemplate_);
+//             PickupInventory::getImageForItem(asItem);
+//             newObject->destroy();
+//         }
+
+        //  & load the GUI itself too, along with some empty windows
+        //   = even less delays
+//         GUIManager::showGUI("PickupInventory");
+//         GUIManager::hideGUI("PickupInventory");
+//         PickupInventory::getSingleton();
+    }
+    
+    void PickupSpawner::addPickupable(Pickupable* pickup)
+    {
+        if(this->pickup_ != NULL)
+        {
+            COUT(1) << "addPickupable called, with this->pickup_ already set." << std::endl;
+            return;
+        }
+        if(pickup == NULL)
+        {
+            COUT(1) << "Argument of addPickupable is NULL." << std::endl;
+            return;
+        }
+        
+        this->pickup_ = pickup;
+    }
+    
+    Pickupable* PickupSpawner::getPickupable(void)
+    {
+        return this->pickup_;
+    }
+
+    /**
+    @brief
+        Invoked when the activity has changed. Sets visibility of attached objects.
+    */
+//     void PickupSpawner::changedActivity()
+//     {
+//         SUPER(PickupSpawner, changedActivity);
+// 
+//         for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
+//             (*it)->setVisible(this->isActive());
+//     }
+
+    void PickupSpawner::setMaxSpawnedItems(int items)
+    {
+        this->maxSpawnedItems_ = items;
+        this->spawnsRemaining_ = items;
+    }
+
+    /**
+    @brief
+        Tick, checks if any Pawn is close enough to trigger.
+    @param dt
+        Time since last tick.
+    */
+    //TODO: Replace this with a real DistanceTrigger?
+    void PickupSpawner::tick(float dt)
+    {
+        //! If the PickupSpawner is active.
+        if (this->isActive())
+        {
+            //! Iterate trough all Pawns.
+            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+            {
+                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
+                //! If a Pawn, that fits the target-range of the item spawned by this Pickup, is in trigger-distance.
+                if (distance.length() < this->triggerDistance_ && this->pickup_->isTarget(*it))
+                {
+                    this->trigger(*it);
+                }
+            }
+
+            //! Animation.
+//             this->yaw(Radian(rotationSpeed_s*dt));
+//             this->tickSum_ += bounceSpeed_s*dt;
+//             this->translate(Vector3(0,bounceDistance_s*dt*sin(this->tickSum_),0));
+//             if (this->tickSum_ > 2*Ogre::Math::PI)
+//                 this->tickSum_ -= 2*Ogre::Math::PI;
+        }
+    }
+
+    /**
+    @brief
+        Trigger the PickupSpawner.
+
+        Adds the pickup to the Pawn that triggered,
+        sets the timer to re-activate and deactives the PickupSpawner.
+
+    @param pawn
+        Pawn which triggered the PickupSpawner.
+    */
+    void PickupSpawner::trigger(Pawn* pawn)
+    {
+        //TODO: If private, isActive doesn't need to be tested anymore.
+        if (this->isActive()) //!< Checks whether PickupItem is active.
+        {
+            Pickupable* pickup = this->getPickup();
+            if (pickup != NULL) //!< If everything went ok, and pickup is not NULL.
+            {
+                PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
+                if(carrier == NULL)
+                {
+                    COUT(1) << "This is bad. Pawn isn't PickupCarrier." << std::endl;
+                    return;
+                }
+                
+                if(pickup->pickup(carrier))
+                {
+                    COUT(3) << "Pickup got picked up." << std::endl;
+
+                    this->decrementSpawnsRemaining();
+                }
+                else
+                {
+                    pickup->destroy();
+                }
+            }
+        }
+    }
+    
+    void PickupSpawner::decrementSpawnsRemaining(void)
+    {
+        if(this->spawnsRemaining_ != INF)
+        {
+            this->spawnsRemaining_--;
+        }
+        if(this->spawnsRemaining_ != 0 && this->respawnTime_ > 0)
+        {
+            //TODO: Nicer?
+            this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
+
+            this->setActive(false);
+            this->fireEvent();
+        }
+        else
+        {
+            COUT(3) << "PickupSpawner empty, selfdistruct initialized." << std::endl;
+            this->setActive(false);
+            this->destroy(); //TODO: Implement destroy().
+        }
+    }
+
+    /**
+    @brief
+        Creates a new Pickupable.
+    @return
+        The Pickupable created.
+    */    
+    Pickupable* PickupSpawner::getPickup(void)
+    {
+        if(this->spawnsRemaining_ == 0)
+        {
+            COUT(1) << "Massive Error: PickupSpawner still alive until having spawned last item." << std::endl;
+            return NULL;
+        }
+        
+        Pickupable* pickup = this->pickup_->clone();
+        return pickup;
+    }
+
+    /**
+    @brief
+        Invoked by the timer, re-activates the PickupSpawner.
+    */
+    void PickupSpawner::respawnTimerCallback()
+    {
+        COUT(3) << "PickupSpawner reactivated." << std::endl;
+
+        this->setActive(true);
+    }
+}
Index: code/branches/pickup3/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupSpawner.h	(revision 6419)
+++ code/branches/pickup3/src/modules/pickup/PickupSpawner.h	(revision 6419)
@@ -0,0 +1,129 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of PickupSpawner.
+*/
+
+#ifndef _PickupSpawner_H__
+#define _PickupSpawner_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/StaticEntity.h"
+#include "interfaces/Pickupable.h"
+
+namespace orxonox
+{
+    /**
+        @brief PickupSpawner.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport PickupSpawner : public StaticEntity, public Tickable
+    {
+        public:
+            //TODO: Add limit of items spawned here.
+            PickupSpawner(BaseObject* creator);
+            PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems);
+            virtual ~PickupSpawner();
+
+            virtual void changedActivity();                                 //!< Invoked when activity has changed (set visibilty).
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
+            virtual void tick(float dt);
+
+            /**
+                @brief Get the distance in which to trigger.
+                @return Returns the distance in which this gets triggered.
+            */
+            inline float getTriggerDistance() const
+                { return this->triggerDistance_; }
+            /**
+                @brief Set the distance in which to trigger.
+                @param value The new distance in which to trigger.
+            */
+            inline void setTriggerDistance(float value)
+                { this->triggerDistance_ = value; }
+
+            /**
+                @brief Get the time to respawn.
+                @returns Returns the time after which this gets re-actived.
+            */
+            inline float getRespawnTime() const
+                { return this->respawnTime_; }
+            /**
+                @brief Set the time to respawn.
+                @param time New time after which this gets re-actived.
+            */
+            inline void setRespawnTime(float time)
+                { this->respawnTime_ = time; }
+
+
+            inline int getMaxSpawnedItems(void)
+                { return this->maxSpawnedItems_; }
+            void setMaxSpawnedItems(int items);
+
+        protected:
+            virtual Pickupable* getPickup(void);
+            
+            void addPickupable(Pickupable* pickup);
+            Pickupable* getPickupable(void);
+            
+            void decrementSpawnsRemaining(void);
+
+        private:
+            void initialize(void);
+            
+            void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
+            void respawnTimerCallback();                                    //!< Method called when the timer runs out.
+
+            
+            Pickupable* pickup_;
+
+            int maxSpawnedItems_;                   //!< Maximum number of items spawned by this PickupSpawner.
+            int spawnsRemaining_;                   //!< Number of items that can be spawned by this PickupSpawner until it selfdestructs.
+
+            float triggerDistance_;                 //!< Distance in which this gets triggered.
+
+            /* Pickup animation */
+            float tickSum_;                         //!< Adds up tick to use in sine movement
+            static const float bounceSpeed_s;       //!< Speed of pickup to bounce up and down
+            static const float bounceDistance_s;    //!< Distance the pickup bounces up and down
+            static const float rotationSpeed_s;     //!< Rotation speed of pickup
+
+            float respawnTime_;                     //!< Time after which this gets re-actived.
+            Timer respawnTimer_;                    //!< Timer used for re-activating.
+
+            static const int INF = -1;             //!< Constant for infinity.
+    };
+}
+
+#endif /* _PickupSpawner_H__ */
Index: code/branches/pickup3/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/branches/pickup3/src/modules/weapons/projectiles/Projectile.cc	(revision 6418)
+++ code/branches/pickup3/src/modules/weapons/projectiles/Projectile.cc	(revision 6419)
@@ -124,6 +124,7 @@
 
             float dmg = this->damage_;
-            if (this->owner_)
-                dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
+            //TODO: Remove.
+//             if (this->owner_)
+//                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
 
             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
