Index: code/branches/questsystem2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/questsystem2/src/orxonox/CMakeLists.txt	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/CMakeLists.txt	(revision 2146)
@@ -80,4 +80,5 @@
   objects/quest/QuestDescription.cc
   objects/quest/QuestEffect.cc
+  objects/quest/QuestEffectBeacon.cc
   objects/quest/QuestHint.cc
   objects/quest/QuestItem.cc
Index: code/branches/questsystem2/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/questsystem2/src/orxonox/OrxonoxPrereqs.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/OrxonoxPrereqs.h	(revision 2146)
@@ -97,4 +97,5 @@
     class QuestDescription;
     class QuestEffect;
+    class QuestEffectBeacon;
     class QuestHint;
     class QuestItem;
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc	(revision 2146)
@@ -31,7 +31,9 @@
 
 #include <string>
+
 #include "core/CoreIncludes.h"
 #include "util/Exception.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "QuestManager.h"
 #include "Quest.h"
@@ -69,5 +71,5 @@
         Returns true if the effect was successfully invoked.
     */
-    bool AddQuest::invoke(Player* player)
+    bool AddQuest::invoke(ControllableEntity* player)
     {
         if(player == NULL)
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h	(revision 2146)
@@ -39,6 +39,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -55,5 +53,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual bool invoke(Player* player); //!< Invokes the effect.
+            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
 
     };
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc	(revision 2146)
@@ -33,4 +33,5 @@
 #include "util/Exception.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "QuestManager.h"
 #include "QuestItem.h"
@@ -80,5 +81,5 @@
         Returns true if the effect was successfully invoked.
     */
-    bool AddQuestHint::invoke(Player* player)
+    bool AddQuestHint::invoke(ControllableEntity* player)
     {
         if(player == NULL)
@@ -91,5 +92,5 @@
         {
             QuestHint* hint = QuestManager::findHint(this->hintId_);
-            if(!hint->activate(player))
+            if(!hint->setActive(player))
             {
                 return false;
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h	(revision 2146)
@@ -38,6 +38,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -54,5 +52,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual bool invoke(Player* player); //!< Invokes the effect.
+            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
 
         private:
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc	(revision 2146)
@@ -32,4 +32,5 @@
 #include "core/CoreIncludes.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "Rewardable.h"
 
@@ -92,5 +93,5 @@
         Returns true if the effect was invoked successfully.
     */
-    bool AddReward::invoke(Player* player)
+    bool AddReward::invoke(ControllableEntity* player)
     {
         bool check = true;
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h	(revision 2146)
@@ -39,6 +39,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -55,5 +53,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual bool invoke(Player* player); //!< Invokes the effect.
+            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
 
         private:
Index: code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h	(revision 2146)
@@ -39,6 +39,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -55,5 +53,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual bool invoke(Player* player) = 0; //!< Invokes the effect.
+            virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.
 
         protected:
Index: code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc	(revision 2146)
@@ -33,4 +33,5 @@
 #include "util/Exception.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "QuestManager.h"
 #include "Quest.h"
@@ -66,5 +67,5 @@
         Returns true if the effect was invoked successfully.
     */
-    bool CompleteQuest::invoke(Player* player)
+    bool CompleteQuest::invoke(ControllableEntity* player)
     {
         if(player == NULL)
Index: code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h	(revision 2146)
@@ -39,6 +39,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -55,5 +53,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual bool invoke(Player* player); //!< Invokes the effect.
+            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
 
     };
Index: code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc	(revision 2146)
@@ -33,4 +33,5 @@
 #include "util/Exception.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "QuestManager.h"
 #include "Quest.h"
@@ -66,5 +67,5 @@
         Returns true if the effect was invoked successfully.
     */
-    bool FailQuest::invoke(Player* player)
+    bool FailQuest::invoke(ControllableEntity* player)
     {
         if(player == NULL)
Index: code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h	(revision 2146)
@@ -39,6 +39,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -55,5 +53,5 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            virtual bool invoke(Player* player); //!< Invokes the effect.
+            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
 
     };
Index: code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc	(revision 2146)
@@ -26,11 +26,20 @@
  *
  */
+ 
+/**
+    @file GlobalQuest.cc
+    @brief
+	Implementation of the GlobalQuest class.
+*/
 
 #include "OrxonoxStableHeaders.h"
 #include "GlobalQuest.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "core/CoreIncludes.h"
 #include "util/Exception.h"
 
+#include "QuestEffect.h"
+
 namespace orxonox {
 
@@ -39,11 +48,18 @@
     /**
     @brief
-        Constructor.
+        Constructor. Initializes the object.
     */
     GlobalQuest::GlobalQuest(BaseObject* creator) : Quest(creator)
     {
+        this->initialize();
+    }
+    
+    /**
+    @brief
+        Initializes the object.
+    */
+    void GlobalQuest::initialize(void)
+    {
         RegisterObject(GlobalQuest);
-
-        this->initialize();
     }
 
@@ -56,15 +72,74 @@
 
     }
-
+    
+    /**
+    @brief
+        Method for creating a GlobalQuest object through XML.
+    */
     void GlobalQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(GlobalQuest, XMLPort, xmlelement, mode);
+        
+        XMLPortObject(GlobalQuest, QuestEffect, "reward-effects", addRewardEffect, getRewardEffects, xmlelement, mode);
 
         COUT(3) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
     }
-
-    void GlobalQuest::initialize(void)
-    {
-        RegisterObject(GlobalQuest);
+    
+    /**
+    @brief
+        Fails the quest for all players.
+        Invokes the failEffects on all the players possessing this quest.
+    @param player
+        The player failing it.
+    @return
+        Returns true if the quest could be failed, false if not.
+    */
+    bool GlobalQuest::fail(ControllableEntity* player)
+    {
+        if(this->isFailable(player)) //!< Check whether the quest can be failed.
+        {
+            this->setStatus(player, questStatus::failed);
+            
+            //! Iterate through all players possessing this quest.
+            for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
+            {
+                QuestEffect::invokeEffects(*it, this->failEffects_);
+            }
+
+            return true;
+        }
+        
+        COUT(2) << "A non-completable quest was trying to be failed." << std::endl;
+        return false;
+    }
+
+    /**
+    @brief
+        Completes the quest for all players.
+        Invokes the completeEffects on all the players possessing this quest.
+        Invokes the reward effects on the player completing the quest.
+    @param player
+        The player completing it.
+    @return
+        Returns true if the quest could be completed, false if not.
+    */
+    bool GlobalQuest::complete(ControllableEntity* player)
+    {
+        if(this->isCompletable(player)) //!< Check whether the quest can be completed.
+        {
+            this->setStatus(player, questStatus::completed);
+            
+            //! Iterate through all players possessing the quest.
+            for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
+            {
+                QuestEffect::invokeEffects(*it, this->completeEffects_);
+            }
+            
+            QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward effects on the player completing the quest.
+            return true;
+        }
+        
+        COUT(2) << "A non-completable quest was trying to be completed." << std::endl;
+        return false;
     }
 
@@ -79,5 +154,5 @@
         Throws an exception if either isInactive() of isActive() throws one.
     */
-    bool GlobalQuest::isStartable(const Player* player) const
+    bool GlobalQuest::isStartable(const ControllableEntity* player) const
     {
         return this->isInactive(player) ||  this->isActive(player);
@@ -94,5 +169,5 @@
         Throws an Exception if isActive() throws one.
     */
-    bool GlobalQuest::isFailable(const Player* player) const
+    bool GlobalQuest::isFailable(const ControllableEntity* player) const
     {
         return this->isActive(player);
@@ -110,5 +185,5 @@
         Throws an Exception if isActive() throws one.
     */
-    bool GlobalQuest::isCompletable(const Player* player) const
+    bool GlobalQuest::isCompletable(const ControllableEntity* player) const
     {
         return this->isActive(player);
@@ -123,22 +198,19 @@
         Throws an Exception if player is NULL.
     */
-    questStatus::Enum GlobalQuest::getStatus(const Player* player) const
-    {
-        if(player == NULL)
-        {
-            ThrowException(Argument, "The input Player* is NULL.");
-        }
-
-        //TDO: Does this really work???
-        std::set<Player*>::const_iterator it = this->players_.find((Player*)(void*)player);
-        if (it != this->players_.end())
+    questStatus::Enum GlobalQuest::getStatus(const ControllableEntity* player) const
+    {
+        if(player == NULL) //!< We don't want NULL-Pointers!
+        {
+            ThrowException(Argument, "The input ControllableEntity* is NULL.");
+        }
+
+        //! Find the player.
+        std::set<ControllableEntity*>::const_iterator it = this->players_.find((ControllableEntity*)(void*)player);
+        if (it != this->players_.end()) //!< If the player was found.
         {
             return this->status_;
         }
-        else
-        {
-           return questStatus::inactive;
-        }
-
+
+	return questStatus::inactive;
     }
 
@@ -154,19 +226,65 @@
         Returns false if player is NULL.
     */
-    bool GlobalQuest::setStatus(Player* player, const questStatus::Enum & status)
-    {
-        if(player == NULL)
+    bool GlobalQuest::setStatus(ControllableEntity* player, const questStatus::Enum & status)
+    {
+        if(player == NULL) //!< We don't want NULL-Pointers!
         {
             return false;
         }
 
-        std::set<Player*>::const_iterator it = this->players_.find(player);
+        //! Find the player.
+        std::set<ControllableEntity*>::const_iterator it = this->players_.find(player);
         if (it == this->players_.end()) //!< Player is not yet in the list.
         {
-            this->players_.insert(player);
-        }
-        this->status_ = status;
+            this->players_.insert(player); //!< Add the player to the set.
+        }
+        
+        this->status_ = status; //!< Set the status, which is global, remember...?
         return true;
     }
+    
+    /**
+    @brief
+        Adds a reward effect to the list of reward effects.
+    @param effect
+        The effect to be added.
+    @return
+        Returns true if successful.
+    */
+    bool GlobalQuest::addRewardEffect(QuestEffect* effect)
+    {
+        if(effect == NULL) //!< We don't want NULL-Pointers!
+        {
+            COUT(2) << "The reward effect to be added to quest {" << this->getId() << "} was NULL." << std::endl;
+            return false;
+        }
+
+        this->rewards_.push_back(effect); //!< Add the effect to the list.
+
+        COUT(3) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl;
+        return true;
+    }
+    
+    /**
+    @brief
+        Returns the reward effect at the given index.
+    @param index
+        The index.
+    @return
+        Returns the QuestEffect at the given index.
+    */
+    const QuestEffect* GlobalQuest::getRewardEffects(unsigned int index) const
+    {
+        int i = index;
+        for (std::list<QuestEffect*>::const_iterator effect = this->rewards_.begin(); effect != this->rewards_.end(); ++effect)
+        {
+            if(i == 0)
+            {
+               return *effect;
+            }
+            i--;
+        }
+        return NULL;
+    }
 
 
Index: code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h	(revision 2146)
@@ -26,4 +26,10 @@
  *
  */
+ 
+/**
+    @file GlobalQuest.h
+    @brief
+	Definition of the GlobalQuest class.
+*/
 
 #ifndef _GlobalQuest_H__
@@ -33,4 +39,5 @@
 
 #include <set>
+#include <list>
 
 #include "core/XMLPort.h"
@@ -39,10 +46,39 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
         Global quests are quests, that have the same status for all players.
-        This means, that when a player successfully completes this quest, it is completed for all players that have it.
+        This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it.
+        
+        Creating a GlobalQuest through XML goes as follows:
+        
+        <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
+            <QuestDescription title="Title" description="Description." /> //The description of the quest.
+            <subquests>
+		<Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
+		...
+		<Quest id="questIdn" />
+	    </subquests>
+	    <hints>
+		<QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
+		...
+		<QuestHint id="hintIdn" />
+	    </hints>
+            <fail-effects>
+                <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is failed, see QuestEffect for the full XML representation.
+                ...
+                <QuestEffect />
+            </fail-effects>
+            <complete-effects>
+                <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is completed, see QuestEffect for the full XML representation.
+                ...
+                <QuestEffect />
+            </complete-effects>
+            <reward-effects>
+                <QuestEffect /> //A list of QuestEffects, invoked on the player completing this quest. See QuestEffect for the full XML representation.
+                ...
+                <QuestEffect />
+            </reward-effects>
+        </GlobalQuest>
     @author
         Damian 'Mozork' Frick
@@ -54,19 +90,26 @@
             virtual ~GlobalQuest();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
+            
+            virtual bool fail(ControllableEntity* player); //!< Fails the quest.
+            virtual bool complete(ControllableEntity* player); //!< Completes the quest.
 
         protected:
-            virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started.
-            virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed.
-            virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed.
+            virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.
+            virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.
+            virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.
 
-            virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player.
-            virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
+            virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.
+            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
 
         private:
-            std::set<Player*> players_; //!< The set of players which possess this quest.
+            std::set<ControllableEntity*> players_; //!< The set of players which possess this quest.
             questStatus::Enum status_; //!< The status of this quest.
+            std::list<QuestEffect*> rewards_; //!< Reward effects only invoked on the player completing the quest.
+            
+            bool addRewardEffect(QuestEffect* effect); //!< Adds a reward effect to the list of reward effects.
+            const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward effect at the given index.
 
-            void initialize(void);
+            void initialize(void); //!< Initializes the object.
 
     };
Index: code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc	(revision 2146)
@@ -27,4 +27,10 @@
  */
 
+/**
+    @file LocalQuest.cc
+    @brief
+	Implementation of the LocalQuest class.
+*/
+
 #include "OrxonoxStableHeaders.h"
 #include "LocalQuest.h"
@@ -33,13 +39,27 @@
 #include "util/Exception.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
+#include "QuestEffect.h"
+
 namespace orxonox {
 
     CreateFactory(LocalQuest);
 
+    /**
+    @brief
+        Constructor. Initializes the object.
+    */
     LocalQuest::LocalQuest(BaseObject* creator) : Quest(creator)
     {
+        this->initialize();
+    }
+    
+    /**
+    @brief
+        Initializes the object.
+    */
+    void LocalQuest::initialize(void)
+    {
         RegisterObject(LocalQuest);
-
-        this->initialize();
     }
 
@@ -53,4 +73,8 @@
     }
 
+    /**
+    @brief
+        Method for creating a LocalQuest object through XML.
+    */
     void LocalQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
@@ -60,7 +84,46 @@
     }
 
-    void LocalQuest::initialize(void)
-    {
-        RegisterObject(LocalQuest);
+    /**
+    @brief
+        Fails the quest for a given player.
+        Invokes all the failEffects on the player.
+    @param player
+        The player.
+    @return
+        Returns true if the quest could be failed, false if not.
+    */
+    bool LocalQuest::fail(ControllableEntity* player)
+    {
+        if(this->isFailable(player)) //!< Checks whether the quest can be failed.
+        {
+            this->setStatus(player, questStatus::failed);
+            QuestEffect::invokeEffects(player, this->failEffects_); //!< Invoke the failEffects.
+            return true;
+        }
+        
+        COUT(2) << "A non-failable quest was trying to be failed." << std::endl;
+        return false;
+    }
+
+    /**
+    @brief
+        Completes the quest for a given player.
+	Invokes all the completeEffects on the player.
+    @param player
+        The player.
+    @return
+        Returns true if the quest could be completed, false if not.
+    */
+    bool LocalQuest::complete(ControllableEntity* player)
+    {
+        if(this->isCompletable(player)) //!< Checks whether the quest can be completed.
+        {
+            this->setStatus(player, questStatus::completed);
+            QuestEffect::invokeEffects(player, this->completeEffects_); //!< Invoke the completeEffects.
+            return true;
+        }
+        
+        COUT(2) << "A non-completable quest was trying to be completed." << std::endl;
+        return false;
     }
 
@@ -73,7 +136,7 @@
         Returns true if the quest can be started, false if not.
     @throws
-        Throws an exception if isInactive(Player*) throws one.
-    */
-    bool LocalQuest::isStartable(const Player* player) const
+        Throws an exception if isInactive(ControllableEntity*) throws one.
+    */
+    bool LocalQuest::isStartable(const ControllableEntity* player) const
     {
         return this->isInactive(player);
@@ -88,7 +151,7 @@
         Returns true if the quest can be failed, false if not.
     @throws
-        Throws an exception if isActive(Player*) throws one.
-    */
-    bool LocalQuest::isFailable(const Player* player) const
+        Throws an exception if isActive(ControllableEntity*) throws one.
+    */
+    bool LocalQuest::isFailable(const ControllableEntity* player) const
     {
         return this->isActive(player);
@@ -103,7 +166,7 @@
         Returns true if the quest can be completed, false if not.
     @throws
-        Throws an exception if isInactive(Player*) throws one.
-    */
-    bool LocalQuest::isCompletable(const Player* player) const
+        Throws an exception if isInactive(ControllableEntity*) throws one.
+    */
+    bool LocalQuest::isCompletable(const ControllableEntity* player) const
     {
         return this->isActive(player);
@@ -120,17 +183,18 @@
         Throws an Exception if player is NULL.
     */
-    questStatus::Enum LocalQuest::getStatus(const Player* player) const
-    {
-        if(player == NULL)
-        {
-            ThrowException(Argument, "The input Player* is NULL.");
-        }
-
-        std::map<Player*, questStatus::Enum>::const_iterator it = this->playerStatus_.find((Player*)(void*)player); //Thx. to x3n for the (Player*)(void*) 'hack'.
-        if (it != this->playerStatus_.end())
+    questStatus::Enum LocalQuest::getStatus(const ControllableEntity* player) const
+    {
+        if(player == NULL) //!< No player has no defined status.
+        {
+            ThrowException(Argument, "The input ControllableEntity* is NULL.");
+        }
+
+        std::map<ControllableEntity*, questStatus::Enum>::const_iterator it = this->playerStatus_.find((ControllableEntity*)(void*)player); //Thx. to x3n for the (ControllableEntity*)(void*) 'hack'.
+        if (it != this->playerStatus_.end()) //!< If there is a player in the map.
         {
             return it->second;
         }
-        return questStatus::inactive;
+        
+        return questStatus::inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
     }
 
@@ -138,18 +202,19 @@
     @brief
         Sets the status for a specific player.
-        But be careful wit this one, the status will just be set without checking for its validity. You have to know what you're doing.
-    @param player
-        The player.
+        But be careful wit this one, the status will just be set without checking for its validity. You have to know what you're doing. Really!
+    @param player
+        The player the status should be set for.
     @param status
-        The status.
+        The status to be set.
     @return
         Returns false if player is NULL.
     */
-    bool LocalQuest::setStatus(Player* player, const questStatus::Enum & status)
-    {
-        if(player == NULL)
+    bool LocalQuest::setStatus(ControllableEntity* player, const questStatus::Enum & status)
+    {
+        if(player == NULL) //!< We can't set a status for no player.
         {
             return false;
         }
+        
         this->playerStatus_[player] = status;
         return true;
Index: code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h	(revision 2146)
@@ -26,4 +26,10 @@
  *
  */
+ 
+/**
+    @file LocalQuest.h
+    @brief
+	Definition of the LocalQuest class.
+*/
 
 #ifndef _LocalQuest_H__
@@ -40,9 +46,34 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
         Handles quests which have different states for different players.
+        LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest.
+        
+        Creating a LocalQuest through XML goes as follows:
+        
+        <LocalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
+            <QuestDescription title="Title" description="Description." /> //The description of the quest.
+            <subquests>
+		<Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
+		...
+		<Quest id="questIdn" />
+	    </subquests>
+	    <hints>
+		<QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
+		...
+		<QuestHint id="hintIdn" />
+	    </hints>
+            <fail-effects>
+                <QuestEffect /> //A list of QuestEffects, invoked when the Quest is failed, see QuestEffect for the full XML representation.
+                ...
+                <QuestEffect />
+            </fail-effects>
+            <complete-effects>
+                <QuestEffect /> //A list of QuestEffects, invoked when the Quest is completed, see QuestEffect for the full XML representation.
+                ...
+                <QuestEffect />
+            </complete-effects>
+        </LocalQuest>
     @author
         Damian 'Mozork' Frick
@@ -54,21 +85,23 @@
             virtual ~LocalQuest();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
+            
+            virtual bool fail(ControllableEntity* player); //!< Fails the quest.
+            virtual bool complete(ControllableEntity* player); //!< Completes the quest.
 
         protected:
-            virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started.
-            virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed.
-            virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed.
+            virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.
+            virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.
+            virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.
 
-            virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player.
-            virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
+            virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.
+            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
 
         private:
-            std::map<Player*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
+            std::map<ControllableEntity*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
 
-            void initialize(void);
+            void initialize(void); //!< Initializes the object.
 
     };
-
 
 }
Index: code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc	(revision 2146)
@@ -26,4 +26,10 @@
  *
  */
+ 
+/**
+    @file Quest.cc
+    @brief
+	Implementation of the Quest class.
+*/
 
 #include "OrxonoxStableHeaders.h"
@@ -32,4 +38,5 @@
 #include "core/CoreIncludes.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "QuestManager.h"
 #include "QuestDescription.h"
@@ -39,9 +46,23 @@
 namespace orxonox {
 
+    /**
+    @brief
+        Constructor. Initializes object.
+    */
     Quest::Quest(BaseObject* creator) : QuestItem(creator)
     {
+        this->initialize();
+    }
+    
+    /**
+    @brief
+        Initializes the object. Needs to be called first in every constructor of this class.
+        Sets defaults.
+    */
+    void Quest::initialize(void)
+    {
         RegisterObject(Quest);
 
-        this->initialize();
+        this->parentQuest_ = NULL;
     }
 
@@ -55,25 +76,18 @@
     }
 
+    /**
+    @brief
+        Method for creating a Quest object through XML.
+    */
     void Quest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(Quest, XMLPort, xmlelement, mode);
 
-        XMLPortObject(Quest, Quest, "", addSubQuest, getSubQuests, xmlelement, mode);
-        XMLPortObject(Quest, QuestHint, "", addHint, getHints, xmlelement, mode);
+        XMLPortObject(Quest, Quest, "subquests", addSubQuest, getSubQuests, xmlelement, mode);
+        XMLPortObject(Quest, QuestHint, "hints", addHint, getHints, xmlelement, mode);
         XMLPortObject(Quest, QuestEffect, "fail-effects", addFailEffect, getFailEffects, xmlelement, mode);
         XMLPortObject(Quest, QuestEffect, "complete-effects", addCompleteEffect, getCompleteEffects, xmlelement, mode);
 
         QuestManager::registerQuest(this); //Registers the quest with the QuestManager.
-    }
-
-    /**
-    @brief
-        Initializes the object. Needs to be called first in every constructor of this class.
-    */
-    void Quest::initialize(void)
-    {
-        RegisterObject(Quest);
-
-        this->parentQuest_ = NULL;
     }
 
@@ -88,5 +102,5 @@
     bool Quest::setParentQuest(Quest* quest)
     {
-        if(quest == NULL)
+        if(quest == NULL) //!< We don't want to set NULL-Pointers.
         {
             COUT(2) << "The parentquest to be added to quest {" << this->getId() << "} was NULL." << std::endl;
@@ -110,5 +124,5 @@
     bool Quest::addSubQuest(Quest* quest)
     {
-        if(quest == NULL)
+        if(quest == NULL) //!< We don't want to set NULL-Pointers.
         {
             COUT(2) << "The subquest to be added to quest {" << this->getId() << "} was NULL." << std::endl;
@@ -116,6 +130,6 @@
         }
 
-        quest->setParentQuest(this);
-        this->subQuests_.push_back(quest);
+        quest->setParentQuest(this); //!< Sets the current quest (this) as parent quest for the added subquest.
+        this->subQuests_.push_back(quest); //!< Adds the quest to the end of the list of subquests.
 
         COUT(3) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
@@ -134,5 +148,5 @@
     bool Quest::addHint(QuestHint* hint)
     {
-        if(hint == NULL)
+        if(hint == NULL) //!< We don't want to set NULL-Pointers. Seriously!
         {
             COUT(2) << "A NULL-QuestHint was trying to be added." << std::endl;
@@ -140,6 +154,6 @@
         }
 
-        this->hints_.push_back(hint);
-        hint->setQuest(this);
+        hint->setQuest(this); //!< Sets the current quest (this) as quest for the added hint.
+        this->hints_.push_back(hint); //!< Adds the hint to the end of the list of hints.
 
         COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
@@ -149,9 +163,13 @@
     /**
     @brief
-
+        Adds an effect to the list of failEffects.
+    @param effect
+        The QuestEffect to be added.
+    @return
+        Returns true if successful.
     */
     bool Quest::addFailEffect(QuestEffect* effect)
     {
-        if(effect == NULL)
+        if(effect == NULL) //!< We don't want to set NULL-Pointers.
         {
             COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
@@ -159,5 +177,5 @@
         }
 
-        this->failEffects_.push_back(effect);
+        this->failEffects_.push_back(effect); //!< Adds the effect to the end of the list of failEffects.
 
         COUT(3) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
@@ -167,9 +185,13 @@
     /**
     @brief
-
+        Adds an effect to the list of completeEffects.
+    @param effect
+        The QuestEffect to be added.
+    @return
+        Returns true if successful.
     */
     bool Quest::addCompleteEffect(QuestEffect* effect)
     {
-        if(effect == NULL)
+        if(effect == NULL) //!< We don't want to set NULL-Pointers.
         {
             COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
@@ -177,5 +199,5 @@
         }
 
-        this->completeEffects_.push_back(effect);
+        this->completeEffects_.push_back(effect); //!< Adds the effect to the end of the list of completeEffects.
 
         COUT(3) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
@@ -185,5 +207,7 @@
     /**
     @brief
-
+        Returns the parent quest of the quest.
+    @return
+        Returns the parent quest of the quest.
     */
     const Quest* Quest::getParentQuest(void)
@@ -194,12 +218,18 @@
     /**
     @brief
-
+        Returns the sub quest of the given index.
+    @param
+        The index.
+    @return
+        Returns the subquest of the given index. NULL if there is no element on the given index.
     */
     const Quest* Quest::getSubQuests(unsigned int index) const
     {
         int i = index;
+        
+        //! Iterate through all subquests.
         for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
         {
-            if(i == 0)
+            if(i == 0) //!< We're counting down...
             {
                return *subQuest;
@@ -207,17 +237,24 @@
             i--;
         }
-        return NULL;
-    }
-
-    /**
-    @brief
-
+        
+        return NULL; //!< If the index is greater than the number of elements in the list.
+    }
+
+    /**
+    @brief
+        Returns the hint of the given index.
+    @param
+        The index.
+    @return
+        Returns the hint of the given index. NULL if there is no element on the given index.
     */
     const QuestHint* Quest::getHints(unsigned int index) const
     {
         int i = index;
+        
+        //! Iterate through all hints.
         for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
         {
-            if(i == 0)
+            if(i == 0) //!< We're counting down...
             {
                return *hint;
@@ -225,17 +262,23 @@
             i--;
         }
-        return NULL;
-    }
-
-    /**
-    @brief
-
+        return NULL; //!< If the index is greater than the number of elements in the list.
+    }
+
+    /**
+    @brief
+        Returns the failEffect of the given index.
+    @param
+        The index.
+    @return
+        Returns the failEffect of the given index. NULL if there is no element on the given index.
     */
     const QuestEffect* Quest::getFailEffects(unsigned int index) const
     {
         int i = index;
+        
+        //! Iterate through all failEffects.
         for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
         {
-            if(i == 0)
+            if(i == 0) //!< We're counting down...
             {
                return *effect;
@@ -243,17 +286,23 @@
             i--;
         }
-        return NULL;
-    }
-
-    /**
-    @brief
-
+        return NULL; //!< If the index is greater than the number of elements in the list.
+    }
+
+    /**
+    @brief
+        Returns the completeEffect of the given index.
+    @param
+        The index.
+    @return
+        Returns the completeEffect of the given index. NULL if there is no element on the given index.
     */
     const QuestEffect* Quest::getCompleteEffects(unsigned int index) const
     {
         int i = index;
+        
+        //! Iterate through all completeEffects.
         for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
         {
-            if(i == 0)
+            if(i == 0) //!< We're counting down...
             {
                return *effect;
@@ -261,5 +310,5 @@
             i--;
         }
-        return NULL;
+        return NULL; //!< If the index is greater than the number of elements in the list.
     }
 
@@ -274,5 +323,5 @@
         Throws an exception if getStatus throws one.
     */
-    bool Quest::isInactive(const Player* player) const
+    bool Quest::isInactive(const ControllableEntity* player) const
     {
         return this->getStatus(player) == questStatus::inactive;
@@ -289,5 +338,5 @@
         Throws an exception if getStatus throws one.
     */
-    bool Quest::isActive(const Player* player) const
+    bool Quest::isActive(const ControllableEntity* player) const
     {
 
@@ -305,5 +354,5 @@
         Throws an exception if getStatus throws one.
     */
-    bool Quest::isFailed(const Player* player) const
+    bool Quest::isFailed(const ControllableEntity* player) const
     {
         return this->getStatus(player) == questStatus::failed;
@@ -320,5 +369,5 @@
         Throws an exception if getStatus throws one.
     */
-    bool Quest::isCompleted(const Player* player) const
+    bool Quest::isCompleted(const ControllableEntity* player) const
     {
         return this->getStatus(player) == questStatus::completed;
@@ -327,5 +376,5 @@
     /**
     @brief
-        Starts the quest.
+        Starts the quest for an input player.
     @param player
         The player.
@@ -333,54 +382,15 @@
         Returns true if the quest could be started, false if not.
     */
-    bool Quest::start(Player* player)
-    {
-        if(this->isStartable(player))
+    bool Quest::start(ControllableEntity* player)
+    {
+        if(this->isStartable(player)) //!< Checks whether the quest can be started.
         {
             this->setStatus(player, questStatus::active);
             return true;
         }
+        
         COUT(2) << "A non-startable quest was trying to be started." << std::endl;
         return false;
     }
 
-    /**
-    @brief
-        Fails the quest.
-    @param player
-        The player.
-    @return
-        Returns true if the quest could be failed, false if not.
-    */
-    bool Quest::fail(Player* player)
-    {
-        if(this->isFailable(player))
-        {
-            this->setStatus(player, questStatus::failed);
-            QuestEffect::invokeEffects(player, this->failEffects_);
-            return true;
-        }
-        COUT(2) << "A non-failable quest was trying to be failed." << std::endl;
-        return false;
-    }
-
-    /**
-    @brief
-        Completes the quest.
-    @param player
-        The player.
-    @return
-        Returns true if the quest could be completed, false if not.
-    */
-    bool Quest::complete(Player* player)
-    {
-        if(this->isCompletable(player))
-        {
-            this->setStatus(player, questStatus::completed);
-            QuestEffect::invokeEffects(player, this->completeEffects_);
-            return true;
-        }
-        COUT(2) << "A non-completable quest was trying to be completed." << std::endl;
-        return false;
-    }
-
 }
Index: code/branches/questsystem2/src/orxonox/objects/quest/Quest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/Quest.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/Quest.h	(revision 2146)
@@ -26,5 +26,13 @@
  *
  */
-
+ 
+/**
+    @file Quest.h
+    @brief
+	Definition of the Quest class.
+	
+	The Quest is the parent class of LocalQuest and GlobalQuest.
+*/
+ 
 #ifndef _Quest_H__
 #define _Quest_H__
@@ -38,7 +46,9 @@
 #include "QuestItem.h"
 
+
 namespace questStatus
 {
 
+    //!Different states of a quest.
     enum Enum
     {
@@ -53,6 +63,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -60,4 +68,8 @@
         A quest has a list of subquests and a parentquest (if it is not a rootquest).
         Each quest exists only once but it has a different status (inactive, active, failed or completed) for each player.
+        A quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the quest.
+        A quest has a list of QuestEffects that are invoked when the quest is failed and also a list of effects that are invoked, when the quest is completed.
+        
+        Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better.
     @author
         Damian 'Mozork' Frick
@@ -69,5 +81,5 @@
             virtual ~Quest();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML.
 
             inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest.
@@ -76,34 +88,34 @@
                 { return this->subQuests_; }
 
-            bool isInactive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
-            bool isActive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'active'.
-            bool isFailed(const Player* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
-            bool isCompleted(const Player* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
+            bool isInactive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
+            bool isActive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'active'.
+            bool isFailed(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
+            bool isCompleted(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
 
-            bool start(Player* player); //!< Sets a quest to active.
-            bool fail(Player* player); //!< Fails the quest.
-            bool complete(Player* player); //!< Completes the quest.
+            bool start(ControllableEntity* player); //!< Sets a quest to active.
+	    virtual bool fail(ControllableEntity* player) = 0; //!< Fails the quest.
+            virtual bool complete(ControllableEntity* player) = 0; //!< Completes the quest.
 
         protected:
-            void initialize(void); //!< Initialized the object.
+            void initialize(void); //!< Initializes the object.
 
-            virtual bool isStartable(const Player* player) const = 0; //!< Checks whether the quest can be started.
-            virtual bool isFailable(const Player* player) const = 0; //!< Checks whether the quest can be failed.
-            virtual bool isCompletable(const Player* player) const = 0; //!< Checks whether the quest can be completed.
+            virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be started.
+            virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be failed.
+            virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be completed.
 
             bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.
             bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.
             bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.
-            bool addFailEffect(QuestEffect* effect);
-            bool addCompleteEffect(QuestEffect* effect);
+            bool addFailEffect(QuestEffect* effect); //!< Adds an effect to the list of failEffects.
+            bool addCompleteEffect(QuestEffect* effect); //!< Adds an effect to the list of completeEffects.
 
-            const Quest* getParentQuest(void);
-            const Quest* getSubQuests(unsigned int index) const;
-            const QuestHint* getHints(unsigned int index) const;
-            const QuestEffect* getFailEffects(unsigned int index) const;
-            const QuestEffect* getCompleteEffects(unsigned int index) const;
+            const Quest* getParentQuest(void); //!< Returns the parent quest of the quest.
+            const Quest* getSubQuests(unsigned int index) const; //!<Returns the sub quest of the given index.
+            const QuestHint* getHints(unsigned int index) const; //!< Returns the hint of the given index.
+            const QuestEffect* getFailEffects(unsigned int index) const; //!< Returns the failEffect of the given index.
+            const QuestEffect* getCompleteEffects(unsigned int index) const; //!Returns the completeEffect of the given index.
 
-            virtual questStatus::Enum getStatus(const Player* player) const = 0; //!< Returns the status of the quest for a specific player.
-            virtual bool setStatus(Player* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
+            virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the quest for a specific player.
+            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
 
             Quest* parentQuest_; //!< Pointer to the parent quest.
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc	(revision 2146)
@@ -32,4 +32,6 @@
 #include "core/CoreIncludes.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
+
 namespace orxonox {
 
@@ -63,5 +65,5 @@
         Returns false if there was an error, view console of log for further detail.
     */
-    bool QuestEffect::invokeEffects(Player* player, std::list<QuestEffect*> & effects)
+    bool QuestEffect::invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects)
     {
         bool check = true;
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h	(revision 2146)
@@ -38,6 +38,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
@@ -52,6 +50,6 @@
             virtual ~QuestEffect();
 
-            virtual bool invoke(Player* player) = 0; //!< Invokes the effect.
-            static bool invokeEffects(Player* player, std::list<QuestEffect*> & effects); //!< Invokes all effects in the list.
+            virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.
+            static bool invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects); //!< Invokes all effects in the list.
 
 
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc	(revision 2146)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc	(revision 2146)
@@ -0,0 +1,159 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "QuestEffectBeacon.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "orxonox/objects/worldentities/ControllableEntity.h"
+#include "QuestEffect.h"
+
+namespace orxonox {
+
+    CreateFactory(QuestEffectBeacon);
+
+    QuestEffectBeacon::QuestEffectBeacon(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(QuestEffectBeacon);
+        
+        this->status_ = QuestEffectBeaconStatus::active;
+        this->times_ = -1;
+    }
+
+
+    QuestEffectBeacon::~QuestEffectBeacon()
+    {
+    }
+    
+    void QuestEffectBeacon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(QuestEffectBeacon, XMLPort, xmlelement, mode);
+
+        XMLPortParam(QuestEffectBeacon, "times", setTimes, getTimes, xmlelement, mode);
+        XMLPortObject(QuestEffectBeacon, QuestEffect, "", addEffect, getEffects, xmlelement, mode);
+    }
+    
+    bool QuestEffectBeacon::execute(ControllableEntity* player)
+    {
+        if(!(this->isActive()))
+        {
+            return false;
+        }
+        if(player == NULL)
+        {
+            return false;
+        }
+        
+        bool check = QuestEffect::invokeEffects(player, this->effects_);
+        if(check)
+        {
+            this->decrementTimes();
+            return true;
+	}
+	
+	return false;
+    }
+    
+    bool QuestEffectBeacon::isActive(void)
+    {
+        return this->status_ == QuestEffectBeaconStatus::active;
+    }
+    
+    bool QuestEffectBeacon::decrementTimes(void)
+    {
+        if(!(this->isActive()))
+        {
+            return false;
+        }
+        if(this->times_ == -1)
+        {
+            return true;
+        }
+        
+        this->times_ = this->times_ - 1;
+	if(this->times_ == 0)
+	{
+            this->status_ = QuestEffectBeaconStatus::inactive;
+	}
+        
+        return true;
+    }
+    
+    
+    bool QuestEffectBeacon::setTimes(const int & n)
+    {
+        if(n < -1)
+        {
+            return false;
+        }
+        
+        this->times_ = n;
+        return true;
+    }
+    
+    
+    /**
+    @brief
+
+    */
+    bool QuestEffectBeacon::addEffect(QuestEffect* effect)
+    {
+        if(effect == NULL)
+        {
+            COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
+            return false;
+        }
+
+        this->effects_.push_back(effect);
+
+        COUT(3) << "An effect was added to a QuestEffectBeacon." << std::endl;
+        return true;
+    }
+    
+     /**
+    @brief
+
+    */
+    const QuestEffect* QuestEffectBeacon::getEffects(unsigned int index) const
+    {
+        int i = index;
+        for (std::list<QuestEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
+        {
+            if(i == 0)
+            {
+               return *effect;
+            }
+            i--;
+        }
+        return NULL;
+    }
+
+
+}
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h	(revision 2146)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h	(revision 2146)
@@ -0,0 +1,85 @@
+/*
+ *   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 _QuestEffectBeacon_H__
+#define _QuestEffectBeacon_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "orxonox/objects/worldentities/PositionableEntity.h"
+
+namespace QuestEffectBeaconStatus
+{
+
+    enum Enum
+    {
+        inactive,
+        active
+    };
+    
+}
+
+namespace orxonox {
+
+    /**
+    @brief
+        
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _OrxonoxExport QuestEffectBeacon : public PositionableEntity
+    {
+	public:
+	    QuestEffectBeacon(BaseObject* creator);
+	    virtual ~QuestEffectBeacon();
+	    
+	    virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+	    
+	    bool execute(ControllableEntity* player);
+	    
+	    bool isActive(void);
+	    
+	protected:
+            std::list<QuestEffect*> effects_;
+            int times_; //!< Number of times the beacon can be exectued.
+            QuestEffectBeaconStatus::Enum status_;
+            
+            bool decrementTimes(void);
+            
+            bool setTimes(const int & n);
+            bool addEffect(QuestEffect* effect);
+            
+            inline const int & getTimes(void) const
+                { return this->times_; }
+            const QuestEffect* getEffects(unsigned int index) const;
+    
+    };
+
+}
+
+#endif /* _QuestEffectBeacon_H__ */
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.cc	(revision 2146)
@@ -26,4 +26,10 @@
  *
  */
+ 
+/**
+    @file QuestHint.cc
+    @brief
+	Implementation of the QuestHint class.
+*/
 
 #include "OrxonoxStableHeaders.h"
@@ -33,4 +39,5 @@
 #include "util/Exception.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
 #include "Quest.h"
 
@@ -41,11 +48,18 @@
     /**
     @brief
-        Constructor.
+        Constructor. Initializes the object.
     */
     QuestHint::QuestHint(BaseObject* creator) : QuestItem(creator)
     {
+        this->initialize();
+    }
+    
+    /**
+    @brief
+        Initialize the object.
+    */
+    void QuestHint::initialize(void)
+    {
         RegisterObject(QuestHint);
-
-        this->initialize();
     }
 
@@ -59,9 +73,8 @@
     }
 
-    void QuestHint::initialize(void)
-    {
-        RegisterObject(QuestHint);
-    }
-
+    /**
+    @brief
+        Method for creating a QuestHint object through XML.
+    */
     void QuestHint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
@@ -82,17 +95,19 @@
         Returns true if the hint is active for the specified player.
     */
-    bool QuestHint::isActive(Player* player)
+    bool QuestHint::isActive(ControllableEntity* player)
     {
-        if(player == NULL)
+        if(player == NULL) //!< NULL-Pointers are ugly!
         {
-            ThrowException(Argument, "The input Player* is NULL.");
+            ThrowException(Argument, "The input ControllableEntity* is NULL.");
             return false;
         }
 
-        std::map<Player*, questHintStatus::Enum>::iterator it = this->playerStatus_.find(player);
-        if (it != this->playerStatus_.end())
+        //! Find the player.
+        std::map<ControllableEntity*, questHintStatus::Enum>::iterator it = this->playerStatus_.find(player);
+        if (it != this->playerStatus_.end()) //!< If the player is in the map.
         {
             return it->second;
         }
+        
         return questStatus::inactive;
     }
@@ -106,9 +121,9 @@
         Returns true if the activation was successful, false if there were problems.
     */
-    bool QuestHint::activate(Player* player)
+    bool QuestHint::setActive(ControllableEntity* player)
     {
-        if(this->quest_->isActive(player))
+        if(this->quest_->isActive(player)) //!< For a hint to get activated the quest must be active.
         {
-            if(!(this->isActive(player)))
+            if(!(this->isActive(player)))  //!< If the hint is already active, activation is pointless.
             {
                 this->playerStatus_[player] = questHintStatus::active;
@@ -121,4 +136,5 @@
             }
         }
+        
         COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
         return false;
@@ -129,9 +145,11 @@
         Sets the quest the QuestHitn belongs to.
     @param quest
+        The quest to be set as quest the hint is attached to.
     @return
+        Returns true if successful.
     */
     bool QuestHint::setQuest(Quest* quest)
     {
-        if(quest == NULL)
+        if(quest == NULL) //!< NULL-Pointer. Again..?
         {
             COUT(2) << "The input Quest* is NULL." << std::endl;
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h	(revision 2146)
@@ -26,4 +26,10 @@
  *
  */
+ 
+/**
+    @file QuestHint.h
+    @brief
+	Definition of the QuestHint class.
+*/
 
 #ifndef _QuestHint_H__
@@ -41,4 +47,5 @@
 {
 
+    //! The status of the hint.
     enum Enum
     {
@@ -52,11 +59,15 @@
 {
 
-    class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
-
     /**
     @brief
         Represents a hint in the game towards completing a Quest.
         Consists of title and description in textual form and must belong to a quest.
-        A QuestHit has a defined status (inactive or active, where inactive is default) for each player, which means each QuestHint exists only once for all players, it doesn't belong to a player, it just has different stati for each of them.
+        A QuestHit has a defined status (inactive or active, where inactive is default) for each player, which means each QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
+        
+        Creating a QuestHint through XML goes as follows:
+        
+        <QuestHint id="hintId">  //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
+            <QuestDesctription title="" description="" />
+        </QuestHint>
     @author
         Damian 'Mozork' Frick
@@ -69,21 +80,19 @@
             virtual ~QuestHint();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
 
-            bool isActive(Player* player); //!< Returns true if the hint is active for the input player.
+            bool isActive(ControllableEntity* player); //!< Returns true if the hint is active for the input player.
 
-            bool activate(Player* player); //!< Activates the hint for the input player.
-
+            bool setActive(ControllableEntity* player); //!< Activates the hint for the input player.
             bool setQuest(Quest* quest); //!< Sets the quest the hint belongs to.
 
-            inline Quest* getQuest(void)
+            inline Quest* getQuest(void) //!< Returns the quest the hint is attached to.
                { return this->quest_; }
 
         private:
+            Quest* quest_; //!< The quest the hint belongs to.
+            std::map<ControllableEntity*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
 
-            void initialize(void);
-
-            Quest* quest_; //!< The quest the hint belongs to.
-            std::map<Player*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
+            void initialize(void); //!< Initializes the object.
 
     };
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.cc	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.cc	(revision 2146)
@@ -26,4 +26,10 @@
  *
  */
+ 
+/**
+    @file QuestItem.cc
+    @brief
+	Implementation of the QuestItem class.
+*/
 
 #include "OrxonoxStableHeaders.h"
@@ -36,4 +42,8 @@
 namespace orxonox {
 
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
     QuestItem::QuestItem(BaseObject* creator) : BaseObject(creator)
     {
@@ -42,26 +52,5 @@
         this->initialize();
     }
-
-    /**
-    @brief
-        Destructor.
-    */
-    QuestItem::~QuestItem()
-    {
-
-    }
-
-    void QuestItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(QuestItem, XMLPort, xmlelement, mode);
-
-        XMLPortParam(QuestItem, "id", setId, getId, xmlelement, mode);
-        //Doesn't getDescription have to be of type getDescription(unsigned int) ?
-        //XMLPortObjectTemplate(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode, unsigned int);
-        XMLPortObject(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode);
-
-    }
-
-
+    
     /**
     @brief
@@ -76,20 +65,42 @@
     }
 
+    /**
+    @brief
+        Destructor.
+    */
+    QuestItem::~QuestItem()
+    {
+
+    }
+
+    /**
+    @brief
+        Method for creating a QuestItem object through XML.
+    */
+    void QuestItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(QuestItem, XMLPort, xmlelement, mode);
+
+        XMLPortParam(QuestItem, "id", setId, getId, xmlelement, mode);
+        XMLPortObject(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode);
+    }
+
+    /**
+    @brief
+        Sets the id of the QuestItem.
+	The id must be of GUID form. See 'http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure' for more information.
+    @param id
+        The id to be set.
+    */
     void QuestItem::setId(const std::string & id)
     {
-        if(!isId(id))
+        if(!isId(id)) //!< Checks whether the id is a valid id.
         {
             COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
             return;
         }
+        
         this->id_ = id;
     }
-
-    //const QuestDescription* QuestItem::getDescription(unsigned int index) const //!< Returns the description of the QuestItem.
-    //{
-    //    if(index != 0)
-    //        return NULL;
-    //    return this->description_;
-    //}
 
     /**
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h	(revision 2146)
@@ -26,4 +26,13 @@
  *
  */
+ 
+/**
+    @file QuestItem.h
+    @brief
+	Definition of the QuestItem class.
+	
+	The QuestItem is the parent class of Quest and QuestHint.
+*/
+
 
 #ifndef _QuestItem_H__
@@ -54,5 +63,5 @@
             virtual ~QuestItem();
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML.
 
             inline const std::string & getId(void) const //!< Returns the id of this quest.
@@ -60,11 +69,10 @@
             inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem.
                 { return this->description_; }
-            //const QuestDescription* getDescription(unsigned int index) const; //!< Returns the description of the QuestItem.
 
             static bool isId(const std::string & id); //!< Checks whether a given id is valid.
 
         protected:
-            void setId(const std::string & id);
-            inline void setDescription(QuestDescription* description)
+            void setId(const std::string & id); //!< Sets the id of the QuestItem.
+            inline void setDescription(QuestDescription* description) //!< Sets the description of the QuestItem.
                 { this->description_ = description; }
 
Index: code/branches/questsystem2/src/orxonox/objects/quest/Rewardable.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/Rewardable.h	(revision 2145)
+++ code/branches/questsystem2/src/orxonox/objects/quest/Rewardable.h	(revision 2146)
@@ -36,6 +36,4 @@
 namespace orxonox {
 
-    class Player; //Forward declaration, remove when fully integrated in objecthirarchy.
-
     /**
     @brief
@@ -51,5 +49,5 @@
             virtual ~Rewardable();
 
-            virtual bool reward(Player* player) = 0; //!<Method to transcribe a rewardable object to the player.
+            virtual bool reward(ControllableEntity* player) = 0; //!<Method to transcribe a rewardable object to the player.
 
     };
