Index: branches/bsp_model/src/defs/class_id.h
===================================================================
--- branches/bsp_model/src/defs/class_id.h	(revision 8513)
+++ branches/bsp_model/src/defs/class_id.h	(revision 8514)
@@ -219,4 +219,5 @@
   CL_NPC_TEST1                  =    0x00000401,
   CL_NPC_TEST2                  =    0x00000402,
+  CL_GENERIC_NPC                =    0x00000403,
 
   // Testing Entities
Index: branches/bsp_model/src/world_entities/WorldEntities.am
===================================================================
--- branches/bsp_model/src/world_entities/WorldEntities.am	(revision 8513)
+++ branches/bsp_model/src/world_entities/WorldEntities.am	(revision 8514)
@@ -4,4 +4,5 @@
                 world_entities/npcs/npc_test.cc \
                 world_entities/npcs/ground_turret.cc \
+                world_entities/npcs/generic_npc.cc \
                 \
                 world_entities/environment.cc \
Index: branches/bsp_model/src/world_entities/npcs/generic_npc.cc
===================================================================
--- branches/bsp_model/src/world_entities/npcs/generic_npc.cc	(revision 8514)
+++ branches/bsp_model/src/world_entities/npcs/generic_npc.cc	(revision 8514)
@@ -0,0 +1,158 @@
+
+
+/*
+   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 "md2/md2Model.h"
+
+#include "generic_npc.h"
+
+using namespace std;
+
+
+
+CREATE_FACTORY(GenericNPC, CL_GENERIC_NPC);
+
+
+
+/**
+ * constructor
+ */
+GenericNPC::GenericNPC(const TiXmlElement* root)
+  : NPC(root)
+{
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * deconstructor
+ */
+GenericNPC::~GenericNPC ()
+{}
+
+
+/**
+ * initializing the npc enity
+ */
+void GenericNPC::init()
+{
+  this->setClassID(CL_GENERIC_NPC, "GenericNPC");
+  this->toList(OM_GROUP_00);
+}
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void GenericNPC::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "md2animation", this, GenericNPC, setAnimation)
+      .describe("sets the animation of the md2 model")
+      .defaultValues(1);
+
+}
+
+
+/**
+ * sets the animation of this npc
+ * @param anumationIndex: the animation index
+ * @param anumPlaybackMode: the playback mode
+ */
+void GenericNPC::setAnimation(int animationIndex, int animPlaybackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationIndex, animPlaybackMode);
+}
+
+
+/**
+ * sets the animation of this npc
+ * @param anumationIndex: the animation index
+ * @param anumPlaybackMode: the playback mode
+ */
+bool GenericNPC::playAnimation(int animationIndex, int animPlaybackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationIndex, animPlaybackMode);
+
+  return true;
+}
+
+
+/**
+ * play a sound
+ * @param filename: name of the file
+ */
+bool GenericNPC::playSound(std::string filename)
+{
+  return true;
+}
+
+
+/**
+ * walt to
+ * @param coordinate: coordinate to go to
+ */
+bool GenericNPC::walkTo(const Vector& coordinate)
+{
+
+  return true;
+}
+
+
+/**
+ * tick this world entity
+ * @param time: time in seconds expirded since the last tick
+ */
+void GenericNPC::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+}
+
+
+
+void GenericNPC::destroy()
+{
+  int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
+
+  PRINTF(0)("randi = %i\n", randi);
+
+  if( randi == 1)
+    this->setAnimation(DEATH_FALLBACK, MD2_ANIM_ONCE);
+  else if( randi == 2)
+    this->setAnimation(DEATH_FALLFORWARD, MD2_ANIM_ONCE);
+  else if( randi == 3)
+    this->setAnimation(DEATH_FALLBACKSLOW, MD2_ANIM_ONCE);
+  else if( randi == 4)
+    this->setAnimation(CROUCH_DEATH, MD2_ANIM_ONCE);
+  else
+    this->setAnimation(DEATH_FALLBACK, MD2_ANIM_ONCE);
+}
+
Index: branches/bsp_model/src/world_entities/npcs/generic_npc.h
===================================================================
--- branches/bsp_model/src/world_entities/npcs/generic_npc.h	(revision 8514)
+++ branches/bsp_model/src/world_entities/npcs/generic_npc.h	(revision 8514)
@@ -0,0 +1,44 @@
+
+/*!
+ * @file generic_npc.h
+ * generic npc object
+ */
+
+#ifndef _GENERIC_ENTITY_H
+#define _GENERIC_ENTITY_H
+
+#include "npc.h"
+
+#include <string>
+
+
+class TiXmlElement;
+
+
+class GenericNPC : public NPC
+{
+  friend class World;
+
+ public:
+  GenericNPC(const TiXmlElement* root);
+  virtual ~GenericNPC ();
+
+  void init();
+  virtual void loadParams(const TiXmlElement* root);
+
+  void setAnimation(int animationIndex, int animPlaybackMode);
+
+  bool playAnimation(int animationIndex, int animPlaybackMode);
+  bool playSound(std::string filename);
+  bool walkTo(const Vector& coordinate);
+
+  void destroy();
+
+  virtual void tick (float time);
+
+
+ private:
+
+};
+
+#endif /* _GENERIC_ENTITY_H */
Index: branches/bsp_model/src/world_entities/npcs/ground_turret.cc
===================================================================
--- branches/bsp_model/src/world_entities/npcs/ground_turret.cc	(revision 8513)
+++ branches/bsp_model/src/world_entities/npcs/ground_turret.cc	(revision 8514)
@@ -39,4 +39,5 @@
  */
 GroundTurret::GroundTurret(const TiXmlElement* root)
+  : NPC(root)
 {
   this->init();
Index: branches/bsp_model/src/world_entities/npcs/npc.cc
===================================================================
--- branches/bsp_model/src/world_entities/npcs/npc.cc	(revision 8513)
+++ branches/bsp_model/src/world_entities/npcs/npc.cc	(revision 8514)
@@ -19,17 +19,13 @@
 
 #include "npc.h"
-#include "obb_tree.h"
 
-#include "state.h"
-#include "stdlibincl.h"
-#include "power_ups/turret_power_up.h"
-#include "power_ups/laser_power_up.h"
 
 using namespace std;
 
 
-NPC::NPC()
+NPC::NPC(const TiXmlElement* root)
 {
   this->setClassID(CL_NPC, "NPC");
+
   this->toList(OM_GROUP_00);
 }
@@ -39,48 +35,20 @@
 
 
-void NPC::collidesWith(WorldEntity* entity, const Vector& location)
-{
 
-  if (entity == collider)
-    return;
-  collider = entity;
-
-  if (entity->isA(CL_PROJECTILE))
-  {
-    this->decreaseHealth(entity->getHealth() *(float)rand()/(float)RAND_MAX);
-    // EXTREME HACK
-    if (this->getHealth() <= 0.0f)
-    {
-      this->destroy();
-    }
-  }
+/**
+ * adds an AI to this NPC
+ */
+void NPC::addAI(AI* ai)
+{}
 
 
-// //    PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
-// //    this->applyForce(Vector(0,0,0)-location*1000);
-//     if ((float)rand()/RAND_MAX < .3)
-//     {
-//       WorldEntity* powerUp = new TurretPowerUp();
-//       powerUp->setAbsCoor(this->getAbsCoor());
-// //      powerUp->toList(OM_COMMON);
-//     }
-//     else if ((float)rand()/RAND_MAX < .3)
-//     {
-//       WorldEntity* powerUp = new LaserPowerUp();
-//       powerUp->setAbsCoor(this->getAbsCoor());
-//       powerUp->toList(OM_COMMON);
-//     }
-//     this->toList(OM_DEAD);
-//     this->removeNode();
-//
-//       this->collider = entity;
-//   }
-//   //  else if (entity->isA(CL_PLAYER))
-//   //    this->applyForce(Vector(0,0,0)-location*100);
-//   else if (entity->isA(CL_NPC))
-//   {
-//     this->setVisibiliy(false);
-//     this->toList(OM_DEAD);
-//     this->removeNode();
-//   }
+
+/**
+ * loads the xml tags
+ * @param root: root xml tag for this element
+ */
+void NPC::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
 }
+
Index: branches/bsp_model/src/world_entities/npcs/npc.h
===================================================================
--- branches/bsp_model/src/world_entities/npcs/npc.h	(revision 8513)
+++ branches/bsp_model/src/world_entities/npcs/npc.h	(revision 8514)
@@ -4,5 +4,4 @@
 
 #include "world_entity.h"
-#include "physics_interface.h"
 
 class AI;
@@ -11,17 +10,14 @@
 
  public:
-  NPC ();
+   NPC (const TiXmlElement* root);
   virtual ~NPC ();
 
+  virtual void loadParams(const TiXmlElement* root = NULL);
 
   void addAI(AI* ai);
-
-  virtual void collidesWith (WorldEntity* entity, const Vector& location);
 
 
  private:
 
-   WorldEntity* collider;
-
 };
 
Index: branches/bsp_model/src/world_entities/npcs/npc_test.cc
===================================================================
--- branches/bsp_model/src/world_entities/npcs/npc_test.cc	(revision 8513)
+++ branches/bsp_model/src/world_entities/npcs/npc_test.cc	(revision 8514)
@@ -31,4 +31,5 @@
 
 NPC2::NPC2()
+  : NPC(NULL)
 {
   this->setClassID(CL_NPC_TEST2, "NPC2");
Index: branches/bsp_model/src/world_entities/npcs/npc_test1.cc
===================================================================
--- branches/bsp_model/src/world_entities/npcs/npc_test1.cc	(revision 8513)
+++ branches/bsp_model/src/world_entities/npcs/npc_test1.cc	(revision 8514)
@@ -29,4 +29,5 @@
 
 NPCTest1::NPCTest1()
+  : NPC(NULL)
 {
   this->setClassID(CL_NPC_TEST1, "NPCTest1");
