Index: code/branches/pickups2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/pickups2/src/orxonox/CMakeLists.txt	(revision 2226)
+++ code/branches/pickups2/src/orxonox/CMakeLists.txt	(revision 2227)
@@ -67,5 +67,9 @@
   objects/worldentities/ParticleEmitter.cc
   objects/worldentities/ParticleSpawner.cc
+  objects/pickup/PickupSpawner.cc
 #  objects/worldentities/Backlight.cc
+
+  objects/pickup/Item.cc
+  objects/pickup/Turbo.cc
 
   objects/quest/AddQuest.cc
Index: code/branches/pickups2/src/orxonox/objects/pickup/Item.cc
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/Item.cc	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/Item.cc	(revision 2227)
@@ -0,0 +1,46 @@
+/* has to be added to player
+   multimap<std::string, Item*> Equipment;*/
+
+#include "Item.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/String.h"
+#include "objects/worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+Item::Item(BaseObject* creator) : BaseObject(creator)
+{
+	RegisterObject(Item);
+
+	this->playerBaseClass_ = 0;
+}
+
+Item::~Item()
+{
+}
+    void Item::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Item, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Item, "playerclass", setPlayerBaseClassName, getPlayerBaseClassName, xmlelement, mode);
+    }
+
+void Item::addTo (Pawn* player)
+{
+	//player->Equipment.insert ( std::pair<std::string, Item*>(this->itemname,this) );
+}
+
+void Item::setPlayerBaseClassName(const std::string& name)
+{
+	this->playerBaseClass_ = ClassByString(name);
+}
+
+const std::string& Item::getPlayerBaseClassName() const
+{
+	if (this->playerBaseClass_)
+		return this->playerBaseClass_->getName();
+	else
+		return BLANKSTRING;
+}
+}
Index: code/branches/pickups2/src/orxonox/objects/pickup/Item.h
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/Item.h	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/Item.h	(revision 2227)
@@ -1,20 +1,34 @@
+#ifndef _Item_H__
+#define _Item_H__
+
+#include "core/BaseObject.h"
+#include "OrxonoxPrereqs.h"
+
 namespace orxonox
 {
-	class _OrxonoxExport Item
+	class _OrxonoxExport Item : public BaseObject
 	{
 	public:
-	virtual bool pickedUp(Pawn* player);
-	virtual bool dropped(Pawn* player); //erst bei festen Items
+	Item( BaseObject* creator);
+	virtual ~Item();
+
+	virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+	virtual bool pickedUp(Pawn* player) { return true; }
+	virtual bool dropped(Pawn* player) { return true; } //erst bei festen Items
 	void addTo(Pawn* player);
-	void removeFrom(Pawn* player);
-	string getPlayerBaseClass();
-	Item( BaseObject* creator);
-	~Item();
+
+	inline void setPlayerBaseClass(Identifier* identifier)
+		{ this->playerBaseClass_ = identifier; }
+	inline Identifier* getPlayerBaseClass() const
+		{ return this->playerBaseClass_; }
 	
 	private:
-	Identifier* PlayerBaseClass; //class(...)
-	
-	
-	}
+	void setPlayerBaseClassName(const std::string& name);
+	const std::string& getPlayerBaseClassName() const;
+
+	Identifier* playerBaseClass_; //class(...)
+	};
 }
 	
+#endif /* _Item_H__ */
Index: code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.cc	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.cc	(revision 2227)
@@ -1,4 +1,8 @@
 #include "PickupSpawner.h"
+#include "Item.h"
+#include "objects/worldentities/pawns/Pawn.h"
+#include "objects/worldentities/triggers/DistanceTrigger.h"
 #include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
 #include "core/Template.h"
 
@@ -12,4 +16,30 @@
 
 	this->template_ = 0;
+	this->distance_ = 50;
+}
+
+PickupSpawner::~PickupSpawner()
+{
+}
+
+void PickupSpawner::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+{
+	SUPER(PickupSpawner, XMLPort, xmlelement, mode);
+
+	XMLPortParam(PickupSpawner, "item", setItemTemplate, getItemTemplate, xmlelement, mode);
+	XMLPortParam(PickupSpawner, "distance", setDistance, getDistance, xmlelement, mode).defaultValues(50.0f);
+}
+
+void PickupSpawner::tick(float dt)
+{
+  if (this->isActive())
+  {
+    for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+    {
+      Vector3 distanceVec = it->getWorldPosition() - this->getWorldPosition();
+      if (distanceVec.length() < this->distance_)
+        this->triggering(*it);
+    }
+  }
 }
 
@@ -20,35 +50,24 @@
 }
 
-    void PickupSpawner::processEvent(Event& event)
-    {
-        SUPER(PickupSpawner, processEvent, event);
-
-        SetSubclassEvent(PickupSpawner, "pickup", triggering, event, DistanceTrigger);
-    }
-
-void activateSpawner(bool active)
+void PickupSpawner::triggering(Pawn* player)
+{
+	if (this->isActive() && this->template_ && this->template_->getBaseclassIdentifier())
 	{
-	if active=true
-	this->isActive =true;
-	else
-	this->isActive = false;
-	}
-
-void triggering(bool active, DistanceTrigger* trigger)
-{
-	if (active= true && this->template_ && this->template_->getBaseclassIdentifier())
-	{
-		Pawn* player = trigger->getPlayer(); // getPlayer muss noch implementiert werden
-		if(player->isA(itemtemplate_->getPlayerBaseClass())) 
+		COUT(0) << "activated" << std::endl;
+		//if(player->isA(itemtemplate_->getPlayerBaseClass())) 
 		{
-		BaseObject* newobject = this->template_->getBaseclassIdentifier()->fabricate();
+		BaseObject* newobject = this->template_->getBaseclassIdentifier()->fabricate(this);
 		Item* newitem = dynamic_cast<Item*>(newobject);
 		if (newitem)
-		newitem->addTemplate(this->itemtemplate_);
-		newitem->pickedUp(player);
+		{
+			newitem->addTemplate(this->itemtemplate_);
+			if (newitem->pickedUp(player)== true)
+				this->setActive(false);
+			else
+				delete newobject;
 		}
-		else
-			delete newobject;
-		activateSpawner(false);
+		}
+		//else
+		//	delete newobject;
 	}
 }
Index: code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.h
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.h	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.h	(revision 2227)
@@ -1,7 +1,13 @@
+#ifndef _PickupSpawner_H__
+#define _PickupSpawner_H__
 
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/PositionableEntity.h"
+#include "objects/Tickable.h"
 
 namespace orxonox
 {
-	class _OrxonoxExport PickupSpawner: public PositionableEnity
+	class _OrxonoxExport PickupSpawner : public PositionableEntity, public Tickable
 	{
 	public:
@@ -9,21 +15,26 @@
 	virtual ~PickupSpawner();
 
+	virtual void tick(float dt);
+
         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-	virtual void processEvent(Event& event);
-	virtual void changedActivity();
-	virtual void triggering(bool active, DistanceTrigger* trigger); // Wenn ein Spieler in die Naehe kommt
-	void activateSpawner(bool active);
+	virtual void triggering(Pawn* trigger); // Wenn ein Spieler in die Naehe kommt
 
 	void setItemTemplate(const std::string& itemtemplate);
-	inline const sdt::string& getItemTemplate() const
+	inline const std::string& getItemTemplate() const
 		{ return this->itemtemplate_; }
+
+	inline void setDistance(float distance)
+		{ this->distance_ = distance; }
+	inline float getDistance() const
+		{ return this->distance_; }
 	
 	private:
 	std::string itemtemplate_;
 	Template* template_;
-	bool isActive;
-	}
-	
-	
+	float distance_;
+	};
+}
+
+#endif /* _PickupSpawner_H__ */
 	
 
@@ -43,3 +54,2 @@
 
 
-}
Index: code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipmentClasses.h
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipmentClasses.h	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipmentClasses.h	(revision 2227)
@@ -23,15 +23,15 @@
     {
         public:
-            void AddItem(Shipitem* toAddItem);
+            /*void AddItem(Shipitem* toAddItem);
             void RemoveItem(Shipitem* toRemoveItem);
             bool CheckifValid(Shipitem* toBeChecked);
             bool CheckifSpace();
             void SwitchItem(Permanent* toSwitchItem);
-            string GetNameofPermanent (subItemTypePermanent NametoGet); //holt den Namen des getragenen Items im jeweiligen Slot.
+            string GetNameofPermanent (subItemTypePermanent NametoGet);*/ //holt den Namen des getragenen Items im jeweiligen Slot.
 
         private:
-            multimap<std::string, ShipItem*> Equipment;
-            multimap<std::string, ShipItem*> Usable;
-            multimap<std::string, ShipItem*> Trunk;
+            multimap<std::string, Item*> Equipment;
+            multimap<std::string, Item*> Usable;
+            multimap<std::string, Item*> Trunk;
     };
 }
Index: code/branches/pickups2/src/orxonox/objects/pickup/Turbo.cc
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/Turbo.cc	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/Turbo.cc	(revision 2227)
@@ -1,13 +1,45 @@
+#include "Turbo.h"
+
+#include "objects/worldentities/pawns/SpaceShip.h"
 #include "core/Executor.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
 
 namespace orxonox
 {
+	
 
-	bool pickedUp(Pawn* player)
+	CreateFactory(Turbo);
+
+	Turbo::Turbo(BaseObject* creator) : Item(creator)
 	{
-		if(player-> isA(playerBaseClass))
+		RegisterObject(Turbo);
+
+		this->boost_ = 0;
+		this->duration_ = 0;
+		this->accboost_ = 1;
+	}
+
+	Turbo::~Turbo()
+	{
+	}
+
+    void Turbo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Turbo, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Turbo, "boost", setBoost, getBoost, xmlelement, mode);
+        XMLPortParam(Turbo, "duration", setDuration, getDuration, xmlelement, mode);
+        XMLPortParam(Turbo, "accboost", setAccBoost, getAccBoost, xmlelement, mode);
+    }
+
+	bool Turbo::pickedUp(Pawn* player)
+	{
+		if(player-> isA(this->getPlayerBaseClass()))
 			{
-			Spaceship* ship = dynamic_cast <SpaceShip*>(player);
-			setSpeedBoost(this->boost, this->duration, Spaceship* ship)
+			SpaceShip* ship = dynamic_cast <SpaceShip*>(player);
+			this->setSpeedBoost(ship);
+			if(duration_==0)
+			addTo(player);
 			return true;
 			}
@@ -17,25 +49,47 @@
 	
 	
-	void unsetSpeedBoost(int boost, Spaceship* ship)
+	void Turbo::unsetSpeedBoost(SpaceShip* ship)
 	{
-	ship->setMaxSpeed( ship->getMaxSpeed() - boost);
-	ship->setTransAcc( ship->getTransAcc()/ACCBOOST);
+	ship->setMaxSpeed( ship->getMaxSpeed() - this->boost_);
+	ship->setTransAcc( ship->getTransAcc()/this->accboost_);
+	COUT(3)<<"PickUp Timer expired"<<std::endl;
 	}
 
-	void setSpeedBoost(float boost, float duration, Spaceship* ship)
+	void Turbo::setSpeedBoost(SpaceShip* ship)
 	{
-	const float ACCBOOST =1.5
-	ship->setMaxSpeed( ship->getMaxSpeed() + boost);
-	ship->setTransAcc( ship->getTransAcc()*ACCBOOST);
-
-	turbotimer_.setTimer(duration, false, this, createExecutor(createFunctor(&Turbo::unsetSpeedBoost)))
+	ship->setMaxSpeed( ship->getMaxSpeed() + this->boost_);
+	ship->setTransAcc( ship->getTransAcc()*this->accboost_);
+	if( this->duration_ != 0)
+	{
+		ExecutorMember<Turbo>* executor = createExecutor(createFunctor(&Turbo::unsetSpeedBoost));
+		executor->setDefaultValues(ship);
+		turbotimer_.setTimer(this->duration_, false, this, executor);
+	}
 	
 	}
-	
+	bool Turbo::dropped(Pawn* player)
+	{
+		if (this->duration_ == 0)
+		{
+			//player->Equipment.erase ( std::pair<std::string, Item*>(this->itemname,this) );
+			SpaceShip* ship = dynamic_cast <SpaceShip*>(player);
+			this->unsetSpeedBoost(ship);
+		}
+		return true;
+	}
 	
 }
+/*<Template baseclass="Turbo" name=turboitem>
+      <Turbo playerclass="SpaceShip" boost=150 duration=10 accboost=10 />
+    </Template>
+
+    <PickupSpawner item=turboitem>
+      <attached>
+        <Billboard material="Examples/Flare" scale=0.2 colour="0.0, 0.0, 1.0, 1.0" />
+      </attached>
+    </PickupSpawner>*/
+
 	
 	
 	
 	
-	
Index: code/branches/pickups2/src/orxonox/objects/pickup/Turbo.h
===================================================================
--- code/branches/pickups2/src/orxonox/objects/pickup/Turbo.h	(revision 2226)
+++ code/branches/pickups2/src/orxonox/objects/pickup/Turbo.h	(revision 2227)
@@ -1,16 +1,49 @@
+#ifndef _Turbo_H__
+#define _Turbo_H__
+
 #include "tools/Timer.h"
+#include "Item.h"
+#include "OrxonoxPrereqs.h"
 
 namespace orxonox
 {
-	class _OrxonoxExport Turbo: public Item
+	class _OrxonoxExport Turbo : public Item
 	{
 	
 	public:
-	void setSpeedBoost(int boost, float duration, Spaceship* ship)
-	void unsetSpeedBoost(int boost, Spaceship* ship)
+	Turbo(BaseObject* creator);
+	virtual ~Turbo();
+
+	virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+	virtual bool pickedUp(Pawn* player);
+	virtual bool dropped(Pawn* player); //erst bei festen Items
+
+	void setSpeedBoost(SpaceShip* ship);
+	void unsetSpeedBoost(SpaceShip* ship);
+
+	inline void setBoost(float boost)
+		{ this->boost_ = boost; }
+	inline float getBoost() const
+		{ return this->boost_; }
+
+	inline void setDuration(float duration)
+		{ this->duration_ = duration; }
+	inline float getDuration() const
+		{ return this->duration_; }
+
+	
+	inline void setAccBoost(float accboost)
+		{ this->accboost_ = accboost; }
+	inline float getAccBoost() const
+		{ return this->accboost_; }
+
 	private:
 	Timer<Turbo> turbotimer_;
-	float boost;
-	float duration;
-	}
+	float boost_;
+	float duration_;
+	float accboost_;
+	};
 }
+
+#endif /* _Turbo_H__ */
