Index: trunk/src/world_entities/npcs/attractor_mine.cc
===================================================================
--- trunk/src/world_entities/npcs/attractor_mine.cc	(revision 9235)
+++ trunk/src/world_entities/npcs/attractor_mine.cc	(revision 9235)
@@ -0,0 +1,156 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "attractor_mine.h"
+
+
+#include "shader.h"
+#include "state.h"
+#include "debug.h"
+
+#include "player.h"
+#include "playable.h"
+
+#include "loading/factory.h"
+#include "loading/load_param.h"
+
+#include "effects/explosion.h"
+
+CREATE_FACTORY(AttractorMine, CL_ATTRACTOR_MINE);
+#include "script_class.h"
+CREATE_SCRIPTABLE_CLASS(AttractorMine, CL_ATTRACTOR_MINE,
+                        addMethod("setName", ExecutorLua1<BaseObject,const std::string&>(&BaseObject::setName))
+                       //Coordinates
+                        ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
+                        ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
+                        ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
+                        ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
+                       );
+
+
+
+
+AttractorMine::AttractorMine(const TiXmlElement* root)
+    : NPC(NULL)
+{
+  this->setClassID(CL_ATTRACTOR_MINE, "AttractorMine");
+
+  this->toList(OM_GROUP_02);
+
+  if ((float)rand()/RAND_MAX > .5f)
+    this->loadModel("models/ships/noxon_battle_drone.obj", .3);
+  else
+    this->loadModel("models/ships/noxon_battle_drone.obj", .2);
+
+  this->setDamage(30.0f);
+
+
+
+  this->shader = NULL;
+  if (likely(Shader::checkShaderAbility()))
+    this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
+
+  this->randomRotAxis = VECTOR_RAND(1);
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+AttractorMine::~AttractorMine ()
+{
+  if (this->shader)
+    Shader::unload(this->shader);
+}
+
+
+void AttractorMine::loadParams(const TiXmlElement* root)
+{
+  NPC::loadParams(root);
+
+}
+
+
+void AttractorMine::destroy(WorldEntity* killer)
+{
+  Explosion::explode(this, Vector(10,10,10));
+  this->toList(OM_DEAD);
+
+}
+
+
+
+/**
+ *  the entity is drawn onto the screen with this function
+ *
+ * This is a central function of an entity: call it to let the entity painted to the screen.
+ * Just override this function with whatever you want to be drawn.
+ */
+void AttractorMine::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  float matrix[4][4];
+
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  /* rotate */
+  this->getAbsDir ().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
+  //   if (this->shader != NULL && this->shader != Shader::getActiveShader())
+  //     shader->activateShader();
+
+  this->getModel()->draw();
+  //   shader->deactivateShader();
+
+
+  /*  if (this->model)
+      this->model->draw();*/
+  glPopMatrix();
+}
+
+
+void AttractorMine::tick(float dt)
+{
+  PNode* attractNode = State::getPlayer()->getPlayable();
+  if (attractNode != NULL)
+  {
+    if (this->distance(attractNode) < 80)
+    {
+      Vector dist = (attractNode->getAbsCoor() -  this->getAbsCoor());
+      float distance = dist.len();
+      this->velocity += dist * (( 250.0 - distance) / distance * dt);
+    }
+  }
+
+  this->shiftCoor(this->velocity * dt);
+
+  //  Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
+
+  //if (directin.len() < 100)
+  //  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
+  this->shiftDir(Quaternion(.5 * dt, this->randomRotAxis));
+
+}
+
+
+
Index: trunk/src/world_entities/npcs/attractor_mine.h
===================================================================
--- trunk/src/world_entities/npcs/attractor_mine.h	(revision 9235)
+++ trunk/src/world_entities/npcs/attractor_mine.h	(revision 9235)
@@ -0,0 +1,32 @@
+
+#ifndef _ATTRACTOR_MINE_H
+#define _ATTRACTOR_MINE_H
+
+#include "npc.h"
+
+class AI;
+class Shader;
+
+class AttractorMine : public NPC {
+
+ public:
+  AttractorMine (const TiXmlElement* root = NULL);
+  virtual ~AttractorMine ();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void addAI(AI* ai);
+
+  virtual void destroy(WorldEntity* killer);
+
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+ private:
+   Vector   randomRotAxis;
+   Shader*  shader;
+
+   Vector   velocity;
+};
+
+#endif /* _ATTRACTOR_MINE_H */
Index: trunk/src/world_entities/npcs/gate.cc
===================================================================
--- trunk/src/world_entities/npcs/gate.cc	(revision 9235)
+++ trunk/src/world_entities/npcs/gate.cc	(revision 9235)
@@ -0,0 +1,220 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "interactive_model.h"
+
+
+#include "gate.h"
+#include "class_list.h"
+
+#include "effects/explosion.h"
+
+
+
+using namespace std;
+
+
+CREATE_FACTORY(Gate, CL_GATE);
+
+
+#include "script_class.h"
+CREATE_SCRIPTABLE_CLASS(Gate, CL_GATE,
+                            addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
+                            ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
+                           // ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy()))    
+                            ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
+                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
+                            ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
+                            ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
+                       );
+
+
+//! list of all different animations a std md2model supports
+sAnim Gate::animationList[3] =
+{
+ // begin, end, fps, interruptable
+  {   0,  7,  30,  0 },    //!< OPEN
+  {   8, 15,  30,  0 },    //!< CLOSE
+  {  16, 18,  30,  0 }     //!< DIE
+};
+
+
+
+Gate::Gate(const TiXmlElement* root)
+{
+
+  this->setClassID(CL_GATE, "Gate");
+  this->scale = 1.0f;
+  this->actionRadius = 1.0;
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->toList(OM_COMMON);
+  this->bLocked = false;
+  this->bOpen = false;
+
+  this->loadMD2Texture("maps/wheel.jpg");
+  this->loadModel("models/creatures/hypergate.md2", this->scale);
+
+  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
+}
+
+
+Gate::~Gate ()
+{}
+
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void Gate::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "action-radius", this, Gate, setActionRadius)
+      .describe("sets the action radius of the door")
+      .defaultValues(3.0);
+  LoadParam(root, "scale", this, Gate, setScale)
+      .describe("sets the scale of the door")
+      .defaultValues(1.0);
+}
+
+
+/**
+ * sets the animatin of this entity
+ */
+void  Gate::setAnimation(int animNum, int playbackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationList[animNum].firstFrame,
+                                                         animationList[animNum].lastFrame,
+                                                         animationList[animNum].fps,
+                                                         animationList[animNum].bStoppable,
+                                                         playbackMode);
+}
+
+
+/**
+ * ticks the door
+ * @param time: time since last tick
+ */
+void Gate::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+
+  if( !this->bOpen)
+  {
+    if( this->checkOpen())
+    {
+      this->open();
+    }
+  }
+  else
+  {
+    if( !this->checkOpen())
+    {
+      this->close();
+    }
+  }
+
+
+}
+
+
+/**
+ * open the door
+ */
+void Gate::open()
+{
+  if( this->bLocked)
+    return;
+
+  this->setAnimation(GATE_OPEN, MD2_ANIM_ONCE);
+  this->bOpen = true;
+}
+
+
+/**
+ * close the door
+ */
+void Gate::close()
+{
+  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
+  this->bOpen = false;
+}
+
+
+void Gate::destroy()
+{
+  this->setAnimation(GATE_DIE, MD2_ANIM_ONCE);
+
+  Explosion::explode(this, Vector(10,10,10));
+}
+
+
+/**
+ * checks if the door is open
+ */
+bool Gate::checkOpen()
+{
+
+  std::list<BaseObject*>::const_iterator it;
+  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
+  WorldEntity* entity;
+  float distance;
+
+  if( list == NULL)
+    return false;
+
+  // for all players
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+
+  list = ClassList::getList(CL_GENERIC_NPC);
+  if( list == NULL)
+    return false;
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+  return false;
+}
+
+
+
Index: trunk/src/world_entities/npcs/gate.h
===================================================================
--- trunk/src/world_entities/npcs/gate.h	(revision 9235)
+++ trunk/src/world_entities/npcs/gate.h	(revision 9235)
@@ -0,0 +1,64 @@
+#ifndef _GATE_H
+#define _GATE_H
+
+#include "world_entity.h"
+
+#include "md2/md2Model.h"
+
+class TiXmlElement;
+
+
+//! animation names enumeration
+typedef enum GateAnimType
+{
+  GATE_OPEN = 0,
+  GATE_CLOSE,
+  GATE_DIE,
+
+  GATE_MAX_ANIMATIONS
+};
+
+
+class Gate : public WorldEntity
+{
+  public:
+    Gate(const TiXmlElement* root = NULL);
+    virtual ~Gate ();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setActionRadius(float radius) { this->actionRadius = radius; }
+    void setScale(float scale) { this->scale = scale; }
+
+    void open();
+    void close();
+    void destroy();
+
+    void lock() { this->bLocked = true; }
+    void unlock() { this->bLocked = false; }
+    bool isLocked() const { return this->bLocked; }
+
+
+    virtual void tick (float time);
+
+
+  private:
+    void init();
+    bool checkOpen();
+    void setAnimation(int animNum, int playbackMode = 0);
+
+
+  private:
+    bool           bOpen;             //!< true if the door is open
+    bool           bLocked;           //!< true if this door is locked
+    float          actionRadius;      //!< action radius
+    float          scale;             //!< the scale of the model
+
+    static sAnim   animationList[3];  //!< list of the animations
+
+    bool           bDead;
+
+
+};
+
+#endif /* _GATE_H */
Index: trunk/src/world_entities/npcs/generic_npc.cc
===================================================================
--- trunk/src/world_entities/npcs/generic_npc.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/generic_npc.cc	(revision 9235)
@@ -82,4 +82,5 @@
 {
   this->setClassID(CL_GENERIC_NPC, "GenericNPC");
+
   this->toList(OM_GROUP_00);
 
@@ -206,4 +207,7 @@
 /**
  * each animation has to be initialized here
+ */
+/**
+ *
  */
 void GenericNPC::initNPC()
@@ -578,5 +582,5 @@
 
 
-void GenericNPC::destroy()
+void GenericNPC::destroy(WorldEntity* killer)
 {
   int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
Index: trunk/src/world_entities/npcs/generic_npc.h
===================================================================
--- trunk/src/world_entities/npcs/generic_npc.h	(revision 9110)
+++ trunk/src/world_entities/npcs/generic_npc.h	(revision 9235)
@@ -77,5 +77,5 @@
 
 
-  void destroy();
+  virtual void destroy(WorldEntity* killer);
 
   private:
Index: trunk/src/world_entities/npcs/ground_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/ground_turret.cc	(revision 9235)
@@ -176,5 +176,5 @@
 }
 
-void GroundTurret::destroy()
+void GroundTurret::destroy(WorldEntity* killer)
 {
   this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
Index: trunk/src/world_entities/npcs/ground_turret.h
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.h	(revision 9110)
+++ trunk/src/world_entities/npcs/ground_turret.h	(revision 9235)
@@ -25,5 +25,5 @@
   virtual void leftWorld ();
 
-  virtual void destroy();
+  virtual void destroy(WorldEntity* killer);
 
   virtual void draw() const;
Index: trunk/src/world_entities/npcs/npc.cc
===================================================================
--- trunk/src/world_entities/npcs/npc.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/npc.cc	(revision 9235)
@@ -19,7 +19,4 @@
 
 #include "npc.h"
-
-
-using namespace std;
 
 
@@ -51,5 +48,4 @@
 void NPC::loadParams(const TiXmlElement* root)
 {
-  if(root != NULL)
    WorldEntity::loadParams(root);
 }
Index: trunk/src/world_entities/npcs/npc_test.cc
===================================================================
--- trunk/src/world_entities/npcs/npc_test.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/npc_test.cc	(revision 9235)
@@ -23,12 +23,15 @@
 #include "shader.h"
 #include "state.h"
-#include "stdlibincl.h"
 #include "debug.h"
 
+#include "loading/factory.h"
+#include "loading/load_param.h"
 
-using namespace std;
+#include "effects/explosion.h"
+
+CREATE_FACTORY(NPC2, CL_NPC_TEST2);
 
 
-NPC2::NPC2()
+NPC2::NPC2(const TiXmlElement* root)
   : NPC(NULL)
 {
@@ -36,7 +39,10 @@
 
   if ((float)rand()/RAND_MAX > .5f)
-    this->loadModel("models/ships/bolido.obj", 3);
+    this->loadModel("models/ships/bolido.obj", 6);
   else
-    this->loadModel("models/ships/gobblin.obj", 3);
+    this->loadModel("models/ships/gobblin.obj", 6);
+
+
+
 
   this->shader = NULL;
@@ -44,7 +50,8 @@
     this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
 
-  this->obj = gluNewQuadric();
+  this->randomRotAxis = VECTOR_RAND(1);
 
-  this->randomRotAxis = VECTOR_RAND(1);
+  if (root != NULL)
+    this->loadParams(root);
 }
 
@@ -54,5 +61,19 @@
   if (this->shader)
     Shader::unload(this->shader);
-  gluDeleteQuadric(this->obj);
+}
+
+
+void NPC2::loadParams(const TiXmlElement* root)
+{
+  NPC::loadParams(root);
+
+}
+
+
+void NPC2::destroy(WorldEntity* killer)
+{
+  Explosion::explode(this, Vector(10,10,10));
+  this->toList(OM_DEAD);
+
 }
 
@@ -67,25 +88,26 @@
 void NPC2::draw() const
 {
-//   glMatrixMode(GL_MODELVIEW);
-//   glPushMatrix();
-//   float matrix[4][4];
-//
-//   /* translate */
-//   glTranslatef (this->getAbsCoor ().x,
-//                 this->getAbsCoor ().y,
-//                 this->getAbsCoor ().z);
-//   /* rotate */
-//   this->getAbsDir ().matrix (matrix);
-//   glMultMatrixf((float*)matrix);
-//
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  float matrix[4][4];
+
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  /* rotate */
+  this->getAbsDir ().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
 //   if (this->shader != NULL && this->shader != Shader::getActiveShader())
 //     shader->activateShader();
-//   gluSphere(this->obj, 3, 10, 10);
+
+  this->getModel()->draw();
 //   shader->deactivateShader();
-//
-//
-// /*  if (this->model)
-//     this->model->draw();*/
-//   glPopMatrix();
+
+
+/*  if (this->model)
+    this->model->draw();*/
+  glPopMatrix();
 }
 
@@ -97,5 +119,5 @@
   //if (directin.len() < 100)
 //  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
-  this->shiftDir(Quaternion(dt, this->randomRotAxis));
+//  this->shiftDir(Quaternion(dt, this->randomRotAxis));
 
 }
Index: trunk/src/world_entities/npcs/npc_test.h
===================================================================
--- trunk/src/world_entities/npcs/npc_test.h	(revision 9110)
+++ trunk/src/world_entities/npcs/npc_test.h	(revision 9235)
@@ -11,9 +11,12 @@
 
  public:
-  NPC2 ();
+  NPC2 (const TiXmlElement* root);
   virtual ~NPC2 ();
 
+  virtual void loadParams(const TiXmlElement* root);
 
   void addAI(AI* ai);
+
+  virtual void destroy(WorldEntity* killer);
 
   virtual void tick(float dt);
@@ -23,6 +26,4 @@
    Vector   randomRotAxis;
    Shader*  shader;
-   GLUquadricObj* obj;
-
 };
 
Index: trunk/src/world_entities/npcs/npc_test1.cc
===================================================================
--- trunk/src/world_entities/npcs/npc_test1.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/npc_test1.cc	(revision 9235)
@@ -24,6 +24,4 @@
 #include "power_ups/turret_power_up.h"
 #include "power_ups/laser_power_up.h"
-
-using namespace std;
 
 
Index: trunk/src/world_entities/npcs/space_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/space_turret.cc	(revision 9235)
+++ trunk/src/world_entities/npcs/space_turret.cc	(revision 9235)
@@ -0,0 +1,199 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Manuel Leuenberger
+   co-programmer: ...
+*/
+
+#include "space_turret.h"
+#include "model.h"
+#include "world_entities/weapons/turret.h"
+
+#include "state.h"
+#include "playable.h"
+#include "player.h"
+
+
+#include "util/loading/factory.h"
+#include "network_game_manager.h"
+#include "util/loading/load_param.h"
+
+#include "effects/explosion.h"
+
+CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET);
+
+/**
+ * constructs and loads a SpaceTurret from a XML-element
+ * @param root the XML-element to load from
+ */
+SpaceTurret::SpaceTurret(const TiXmlElement* root)
+  : NPC(root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * standard deconstructor
+ */
+SpaceTurret::~SpaceTurret ()
+{
+
+}
+
+
+/**
+ * initializes the SpaceTurret
+ * @todo change this to what you wish
+ */
+void SpaceTurret::init()
+{
+  this->setClassID(CL_SPACE_TURRET, "SpaceTurret");
+  this->loadModel("models/ground_turret_#.obj", 7.5);
+  this->loadModel("models/comet.obj", 1.0f, 3);
+  this->left = NULL;
+  this->right = NULL;
+
+  this->setHealthMax(100);
+  this->setHealth(30);
+
+  this->weaponHolder[0].addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->weaponHolder[1].addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+
+  this->weaponHolder[0].setRelCoor(0,25,0);
+  this->weaponHolder[0].setParent(this);
+  this->weaponHolder[1].setParent(this);
+}
+
+
+/**
+ * loads a SpaceTurret from a XML-element
+ * @param root the XML-element to load from
+ * @todo make the class Loadable
+ */
+void SpaceTurret::loadParams(const TiXmlElement* root)
+{
+  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
+  NPC::loadParams(root);
+
+
+  /**
+   * @todo: make the class Loadable
+   */
+  const TiXmlElement* element;
+
+  element = root->FirstChildElement("weapon-left");
+  if (element != NULL) element = element->FirstChildElement();
+  this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) );
+  if (this->left)
+  {
+    this->left->setParent(this);
+    this->left->toList(this->getOMListNumber());
+    this->left->setRelCoor(0,15,-7.5);
+    this->left->requestAction( WA_ACTIVATE);
+    this->left->setParent(&this->weaponHolder[0]);
+  }
+
+  element = root->FirstChildElement("weapon-right");
+  if (element != NULL)  if (element != NULL) element = element->FirstChildElement();
+  this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) );
+  if (this->right)
+  {
+    this->right->setParent(this);
+    this->right->toList(this->getOMListNumber());
+    this->right->setRelCoor(0,15,7.5);
+    this->left->requestAction( WA_ACTIVATE);
+    this->right->setParent(&this->weaponHolder[0]);
+  }
+}
+
+/**
+ * advances the SpaceTurret about time seconds
+ * @param time the Time to step
+ */
+void SpaceTurret::tick(float dt)
+{
+  if(this->getHealth() > 0.0f && State::getPlayer() &&
+     State::getPlayer()->getPlayable() &&
+     State::getPlayer()->getPlayable()->distance(this) < 300) // HACK
+  {
+  if (likely(this->left != NULL))
+  {
+//    this->left->tickW(dt);
+    this->left->requestAction(WA_SHOOT);
+  }
+  if (likely(this->right != NULL))
+  {
+//    this->right->tickW(dt);
+    this->right->requestAction(WA_SHOOT);
+  }
+  }
+}
+
+/**
+ * draws this worldEntity
+ */
+void SpaceTurret::draw () const
+{
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  this->getModel()->draw();
+  if (this->getModel() != NULL)
+    this->getModel(3)->draw();
+  glPopMatrix();
+/*
+  if (this->left != NULL)
+    this->left->draw();
+  if (this->right != NULL)
+    this->right->draw();*/
+}
+
+
+
+/**
+ *
+ *
+ */
+void SpaceTurret::postSpawn ()
+{
+
+}
+
+/**
+ *
+ *
+ */
+void SpaceTurret::leftWorld ()
+{
+
+}
+
+void SpaceTurret::destroy(WorldEntity* killer)
+{
+  this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
+  Explosion::explode(this, Vector(10,10,10));
+
+  this->toList(OM_DEAD);
+
+  if (this->left)
+    this->left->toList(OM_DEAD);
+  if (this->right)
+    this->right->toList(OM_DEAD);
+
+}
Index: trunk/src/world_entities/npcs/space_turret.h
===================================================================
--- trunk/src/world_entities/npcs/space_turret.h	(revision 9235)
+++ trunk/src/world_entities/npcs/space_turret.h	(revision 9235)
@@ -0,0 +1,40 @@
+/*!
+ * @file space_turret.h
+ * @brief description
+*/
+
+#ifndef _SPACE_TURRET_H
+#define _SPACE_TURRET_H
+
+#include "npcs/npc.h"
+
+class Weapon;
+
+//! A Class to ...
+class SpaceTurret : public NPC
+{
+
+public:
+  SpaceTurret(const TiXmlElement* root = NULL);
+  virtual ~SpaceTurret();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  virtual void postSpawn ();
+  virtual void leftWorld ();
+
+  virtual void destroy(WorldEntity* killer);
+
+  virtual void draw() const;
+  virtual void tick(float time);
+
+private:
+  void init();
+
+
+private:
+  PNode  weaponHolder[2];
+  Weapon *left, *right;
+};
+
+#endif /* _SPACE_TURRET_H */
