Index: /code/branches/newlevel2012/data/levels/includes/towerWeaponSettings.oxi
===================================================================
--- /code/branches/newlevel2012/data/levels/includes/towerWeaponSettings.oxi	(revision 9212)
+++ /code/branches/newlevel2012/data/levels/includes/towerWeaponSettings.oxi	(revision 9213)
@@ -1,6 +1,6 @@
      <weaponslots>
       <WeaponSlot position="-15.0,-1.5,0" />
-      <!--WeaponSlot position=" 15.0,-1.5,0" /-->
-      <!--WeaponSlot position="    0,   0,0" /-->
+      <WeaponSlot position=" 15.0,-1.5,0" />
+      <WeaponSlot position="    0,   0,0" />
     </weaponslots>
     <weaponsets>
@@ -20,14 +20,14 @@
         <Weapon>
           <attached>
-            <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" scale=1/>
-            <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" scale=1 />
-            <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,0.3" scale=100 />
+            <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" scale=20/>
+            <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" scale=20 />
+            <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale=20 />
           </attached>
-          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
-          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0.005 damage=31.4159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=314.159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
           <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
         </Weapon>
         
-        <!--Weapon>
+        <Weapon>
           <attached>
             <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
@@ -38,9 +38,9 @@
           <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
           <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
-        </Weapon-->
-        <!--Weapon>
+        </Weapon>
+        <Weapon>
           <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
           <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
-        </Weapon-->
+        </Weapon>
         
       </WeaponPack>
Index: /code/branches/newlevel2012/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- /code/branches/newlevel2012/data/levels/templates/spaceshipPirate.oxt	(revision 9212)
+++ /code/branches/newlevel2012/data/levels/templates/spaceshipPirate.oxt	(revision 9213)
@@ -35,9 +35,10 @@
    angularDamping    = 0.9999999
   >
+
     <engines>
       <MultiStateEngine position=" 0, 0, 0" template=spaceshippirateengine />
     </engines>
     <attached>
-      <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="pirate.mesh" />
+      <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=20 mesh="pirate.mesh" />
       <BlinkingBillboard position=" 12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 />
       <BlinkingBillboard position="-12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 phase="90"/>
Index: /code/branches/newlevel2012/data/levels/templates/tower.oxt
===================================================================
--- /code/branches/newlevel2012/data/levels/templates/tower.oxt	(revision 9212)
+++ /code/branches/newlevel2012/data/levels/templates/tower.oxt	(revision 9213)
@@ -9,11 +9,16 @@
 
    collisionType     = "dynamic"
-   team = 13
+   team = 2
+
 
   >
 
-     <controller>
+   
+
+  <controller>
         <WaypointPatrolController alertnessradius=10000 team=5>
-       
+       		 <waypoints>
+            <Model mesh="cube.mesh" scale=20 position=" 700, 200, 100" />
+          </waypoints>
         </WaypointPatrolController>
       </controller>
@@ -21,5 +26,5 @@
 
     <attached>
-      <Model position="0,0,0" scale=50 mesh="Tower_ME.mesh" />
+      <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
     </attached>
 
Index: /code/branches/newlevel2012/data/levels/towerDefense.oxw
===================================================================
--- /code/branches/newlevel2012/data/levels/towerDefense.oxw	(revision 9212)
+++ /code/branches/newlevel2012/data/levels/towerDefense.oxw	(revision 9213)
@@ -76,10 +76,10 @@
  	<!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->
  	
-	<SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=10>
+	<SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=2 team=1 >
       <templates>
         <Template link=spaceshipassff />
       </templates>
       <controller>
-        <WaypointController accuracy=40>
+        <WaypointController accuracy=60>
           <waypoints>
 			  <!-- 1,3 10,3 10,11, 13,11 -->
Index: /code/branches/newlevel2012/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- /code/branches/newlevel2012/src/modules/towerdefense/CMakeLists.txt	(revision 9212)
+++ /code/branches/newlevel2012/src/modules/towerdefense/CMakeLists.txt	(revision 9213)
@@ -5,4 +5,5 @@
   TowerDefenseHUDController.cc
   TowerDefensePlayerStats.cc
+  
 )
 
Index: /code/branches/newlevel2012/src/modules/towerdefense/Tower.cc
===================================================================
--- /code/branches/newlevel2012/src/modules/towerdefense/Tower.cc	(revision 9212)
+++ /code/branches/newlevel2012/src/modules/towerdefense/Tower.cc	(revision 9213)
@@ -28,5 +28,5 @@
         this->setCollisionType(WorldEntity::Dynamic);
 
-
+        //this->removeAllEngines();
 
         /*
Index: /code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.cc
===================================================================
--- /code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.cc	(revision 9213)
+++ /code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.cc	(revision 9213)
@@ -0,0 +1,144 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "TowerDefenseController.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(TowerDefenseController);
+
+    TowerDefenseController::TowerDefenseController(BaseObject* creator) : WaypointController(creator)
+    {
+        RegisterObject(TowerDefenseController);
+
+        this->alertnessradius_ = 500;
+
+        this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&TowerDefenseController::searchEnemy, this)));
+    }
+
+    void TowerDefenseController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TowerDefenseController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TowerDefenseController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
+    }
+
+    void TowerDefenseController::tick(float dt)
+    {
+        if (!this->isActive())
+            return;
+
+        if (this->target_)
+        {
+            this->aimAtTarget();
+
+            if (this->bHasTargetPosition_)
+                this->moveToTargetPosition();
+
+            if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
+                this->getControllableEntity()->fire(0);
+        }
+        else
+        {
+            SUPER(TowerDefenseController, tick, dt);
+        }
+    }
+
+
+    bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+    {
+        if (entity1 == entity2)
+            return true;
+
+        int team1 = -1;
+        int team2 = -1;
+
+        Controller* controller = 0;
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            FormationController* ac = orxonox_cast<FormationController*>(controller);
+            if (ac)
+                team1 = ac->getTeam();
+        }
+
+        if (entity2->getController())
+            controller = entity2->getController();
+        else
+            controller = entity2->getXMLController();
+        if (controller)
+        {
+            FormationController* ac = orxonox_cast<FormationController*>(controller);
+            if (ac)
+                team2 = ac->getTeam();
+        }
+
+
+
+        return (team1 == team2 && team1 != -1);
+    }
+
+
+
+
+
+    void TowerDefenseController::searchEnemy()
+    {
+        this->patrolTimer_.setInterval(rnd());
+
+        if (!this->getControllableEntity())
+            return;
+
+        Vector3 myposition = this->getControllableEntity()->getPosition();
+        float shortestsqdistance = (float)static_cast<unsigned int>(-1);
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        {
+            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+                continue;
+
+            float sqdistance = it->getPosition().squaredDistance(myposition);
+            if (sqdistance < shortestsqdistance)
+            {
+                shortestsqdistance = sqdistance;
+                this->target_ = (*it);
+            }
+        }
+
+        if (shortestsqdistance > (this->alertnessradius_ * this->alertnessradius_))
+            this->target_ = 0;
+    }
+}
Index: /code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.h
===================================================================
--- /code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.h	(revision 9213)
+++ /code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.h	(revision 9213)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TowerDefenseController_H__
+#define _TowerDefenseController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "WaypointController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TowerDefenseController : public WaypointController
+    {
+        public:
+            TowerDefenseController(BaseObject* creator);
+            virtual ~TowerDefenseController() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            inline void setAlertnessRadius(float radius)
+                { this->alertnessradius_ = radius; }
+            inline float getAlertnessRadius() const
+                { return this->alertnessradius_; }
+
+        protected:
+            void searchEnemy();
+
+            float alertnessradius_;
+            Timer patrolTimer_;
+    };
+}
+
+#endif /* _TowerDefenseController_H__ */
