Index: branches/ai/src/ai/ai_team.cc
===================================================================
--- branches/ai/src/ai/ai_team.cc	(revision 10274)
+++ branches/ai/src/ai/ai_team.cc	(revision 10275)
@@ -48,4 +48,5 @@
 			float maxTime=10;
 
+
 			//find new Position
 			if(isPlayer){
@@ -53,14 +54,14 @@
 				int zNorm=(position.z>targetPos.z)?1:-1;
 
-				if((position.z-targetPos.z)*zNorm>80){	//go to start position
+				if((position.z-targetPos.z)*zNorm>60){	//go to start position
 					std::cout << "Go Start Position\n";
 					changeSwarmModule(it, new SwarmGoRel);
-					newPosition=Vector(220,0,zNorm*60);
-					speed=100;
+					newPosition=Vector(180,0,zNorm*60);
+					speed=80;
 				}else if(position.x > targetPos.x+150){	//go to attack position
 					std::cout << "Go Attack Position\n";
 					changeSwarmModule(it, new SwarmGoRel);
 					newPosition=Vector(100,0,0);
-					speed=60;
+					speed=80;
 				}else if(position.x > targetPos.x+90){	//go to attack mode
 					std::cout << "Go Attack Mode\n";
@@ -72,6 +73,6 @@
 					std::cout << "Go  Fallback Point\n";
 					changeSwarmModule(it, new SwarmGoRel);
-					newPosition=Vector(0,0,zNorm*150);
-					speed=60;
+					newPosition=Vector(0,0,zNorm*100);
+					speed=80;
 				}
 			}else{
Index: branches/ai/src/ai/attack_module.cc
===================================================================
--- branches/ai/src/ai/attack_module.cc	(revision 10274)
+++ branches/ai/src/ai/attack_module.cc	(revision 10275)
@@ -22,4 +22,6 @@
 #include "playable.h"
 #include "npcs/npc_test.h"
+#include "weapons/weapon.h"
+#include "projectiles/projectile.h"
 
 #include "shell_command.h"
@@ -46,4 +48,5 @@
 	tickCount=0;
 	randomFreq=40;
+	fireTimeout=1;
 }
 
@@ -57,5 +60,4 @@
 	Vector npcCollision;
 	Vector playerCollision;
-	bool autoRotate=true;
 
 	weight=1;
@@ -86,4 +88,6 @@
 	for(ObjectList<WorldEntity>::const_iterator it = WorldEntity::objectList().begin(); it != WorldEntity::objectList().end(); ++it)
 	{
+		if((*it)->isA(Weapon::staticClassID()) )continue;
+		if((*it)->isA(Projectile::staticClassID()) )continue;
 		if(*it==npc)continue;
 
@@ -143,4 +147,15 @@
 
 	npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),1);
+
+
+	if(npc->isA(NPC::staticClassID()) ){
+		fireTimeout-=dt;
+		if(fireTimeout<=0){
+			fireTimeout=1;
+			//std::cout << "Fiiiiirrreee!\n";
+			NPC* npc2 = static_cast<NPC*>(npc);
+			npc2->fire();
+		}
+	}
 }
 
Index: branches/ai/src/ai/attack_module.h
===================================================================
--- branches/ai/src/ai/attack_module.h	(revision 10274)
+++ branches/ai/src/ai/attack_module.h	(revision 10275)
@@ -36,4 +36,5 @@
 		int tickCount;
 		int randomFreq;
+		float fireTimeout;
 		Vector randomVector;
 };
Index: branches/ai/src/ai/movement_module.cc
===================================================================
--- branches/ai/src/ai/movement_module.cc	(revision 10274)
+++ branches/ai/src/ai/movement_module.cc	(revision 10275)
@@ -22,4 +22,7 @@
 #include "playable.h"
 #include "npcs/npc_test.h"
+#include "weapons/weapon.h"
+#include "projectiles/projectile.h"
+
 
 #include "shell_command.h"
@@ -90,4 +93,6 @@
 	for(ObjectList<WorldEntity>::const_iterator it = WorldEntity::objectList().begin(); it != WorldEntity::objectList().end(); ++it)
 	{
+		if((*it)->isA(Weapon::staticClassID()) )continue;
+		if((*it)->isA(Projectile::staticClassID()) )continue;
 		if(*it==npc)continue;
 
@@ -100,4 +105,5 @@
 		npcCollision=npcCollision+tmpVector;
 	}
+
 
 
Index: branches/ai/src/ai/swarm_gorel.cc
===================================================================
--- branches/ai/src/ai/swarm_gorel.cc	(revision 10274)
+++ branches/ai/src/ai/swarm_gorel.cc	(revision 10275)
@@ -76,7 +76,8 @@
 	}
 
-	if(angleDeg(view,newView)>viewChangeMax){
+	/*if(angleDeg(view,newView)>viewChangeMax){
 		std::cout << "alarm\n";
-	}
+	}*/
+
 	speed=newSpeed;
 	view=newView;
@@ -93,5 +94,5 @@
 	if(!taskComplete){
 		//swarmPosition=this->getPosition();
-		if((destination-position).len()<5)taskComplete=true;
+		if((destination-position).len()<10)taskComplete=true;
 	}
 }
Index: branches/ai/src/world_entities/npcs/npc.cc
===================================================================
--- branches/ai/src/world_entities/npcs/npc.cc	(revision 10274)
+++ branches/ai/src/world_entities/npcs/npc.cc	(revision 10275)
@@ -24,6 +24,13 @@
 #include "ai_engine.h"
 
+#include "player.h"
+#include "playable.h"
+
+#include "weapons/test_gun.h"
+#include "weapons/turret.h"
+#include "weapons/cannon.h"
+
+#include "loading/factory.h"
 #include "debug.h"
-
 #include "loading/load_param.h"
 
@@ -32,4 +39,6 @@
 
 ObjectListDefinition(NPC);
+CREATE_FACTORY(NPC);
+
 
 NPC::NPC(const TiXmlElement* root)
@@ -38,13 +47,64 @@
   this->registerObject(this, NPC::_objectList);
 
-  this->toList(OM_GROUP_00);
+  this->toList(OM_GROUP_01);
+
+  if( root != NULL)
+	  this->loadParams(root);
 
   std::cout << "Team Number: " << teamNumber << "\n";
   std::cout << "Swarm Number:" << swarmNumber << "\n";
-  //aiModule=new MovementModule(this);
-  //AIEngine::getInstance()->addAI(teamNumber,swarmNumber,aiModule);
+
   AIEngine::getInstance()->addAI(teamNumber,swarmNumber,(WorldEntity*)this);
 
   this->bFire = false;
+
+
+    // create the weapons and their manager
+
+
+  this->getWeaponManager().changeWeaponConfig(1);
+  Weapon* wpRight = new TestGun(0);
+  wpRight->setName("testGun Right");
+  Weapon* wpLeft = new TestGun(1);
+  wpLeft->setName("testGun Left");
+
+  wpRight->toList( this->getOMListNumber());
+  wpLeft->toList( this->getOMListNumber());
+
+
+  this->addWeapon(wpLeft, 1, 0);
+  this->addWeapon(wpRight,1 ,1);
+
+  wpLeft->increaseEnergy( 100);
+  wpRight->increaseEnergy( 100);
+
+  this->setHealthMax(100);
+  this->setHealth(80);
+
+  this->getWeaponManager().setSlotCount(7);
+
+  this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
+  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
+  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
+  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
+
+  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
+  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
+
+  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
+  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
+
+  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
+  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
+
+  this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
+  this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->getWeaponManager().getFixedTarget()->setParent(this);
+  this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
 
 }
@@ -138,4 +198,5 @@
 void NPC::tick(float dt)
 {
+	//std::cout << "fire..\n";
   this->weaponMan.tick(dt);
   if (this->bFire)
Index: branches/ai/src/world_entities/npcs/npc.h
===================================================================
--- branches/ai/src/world_entities/npcs/npc.h	(revision 10274)
+++ branches/ai/src/world_entities/npcs/npc.h	(revision 10275)
@@ -17,5 +17,5 @@
   virtual ~NPC ();
 
-  virtual void loadParams(const TiXmlElement* root = NULL);
+  virtual void loadParams(const TiXmlElement* root);
 
 
@@ -29,6 +29,6 @@
   virtual void tick(float dt);
   inline int getTeam()  { return teamNumber; }
+  inline void fire(){ this->bFire=true;}
 
-  inline void fire() { this->bFire = true; }
 
 
Index: branches/ai/src/world_entities/npcs/npc_test.cc
===================================================================
--- branches/ai/src/world_entities/npcs/npc_test.cc	(revision 10274)
+++ branches/ai/src/world_entities/npcs/npc_test.cc	(revision 10275)
@@ -52,7 +52,6 @@
 
   // create the weapons and their manager
-  this->addWeapon(wpLeft, 1, 0);
-  this->addWeapon(wpRight,1 ,1);
-\
+
+
   this->getWeaponManager().changeWeaponConfig(1);
   Weapon* wpRight = new TestGun(0);
@@ -60,4 +59,7 @@
   Weapon* wpLeft = new TestGun(1);
   wpLeft->setName("testGun Left");
+
+  this->addWeapon(wpLeft, 1, 0);
+  this->addWeapon(wpRight,1 ,1);
 
   this->setHealthMax(100);
