Index: trunk/src/world_entities/WorldEntities.am
===================================================================
--- trunk/src/world_entities/WorldEntities.am	(revision 8792)
+++ trunk/src/world_entities/WorldEntities.am	(revision 8793)
@@ -9,4 +9,5 @@
                 world_entities/skysphere.cc \
                 world_entities/skybox.cc \
+                world_entities/skydome.cc \
                 world_entities/terrain.cc \
                 world_entities/satellite.cc \
@@ -66,4 +67,5 @@
                 skysphere.h \
                 skybox.h \
+                skydome.h \
                 terrain.h \
                 satellite.h \
Index: trunk/src/world_entities/effects/lightning_bolt.cc
===================================================================
--- trunk/src/world_entities/effects/lightning_bolt.cc	(revision 8792)
+++ trunk/src/world_entities/effects/lightning_bolt.cc	(revision 8793)
@@ -64,5 +64,5 @@
   if (this->thunderBuffer != NULL)
     ResourceManager::getInstance()->unload(this->thunderBuffer);
-  this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);
+  this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.wav", WAV);
 }
 
Index: trunk/src/world_entities/npcs/generic_npc.h
===================================================================
--- trunk/src/world_entities/npcs/generic_npc.h	(revision 8792)
+++ trunk/src/world_entities/npcs/generic_npc.h	(revision 8793)
@@ -11,6 +11,10 @@
 
 #include <string>
-//
+
 #include "sound_source.h"
+
+#include "vector.h"
+#include "qaternion.h"
+
 
 namespace OrxSound{ class SoundSource; }
@@ -38,4 +42,6 @@
   void playSound(int i);
 
+  float lookAt(WorldEntity* worldEntity);
+
   float walkTo(const Vector& coordinate, const Quaternion& dir);
   float walkTo(float x, float y, float z, float qu, float qx, float qy, float qz);
@@ -50,4 +56,6 @@
   float crouchTo(float x, float y, float qu, float qx, float qy, float qz);
 
+  float talkTo(WorldEnity* worldEntity, int dialogNr);
+
 
   void destroy();
@@ -60,4 +68,7 @@
    OrxSound::SoundBuffer*                  soundBuffer;
    float                                   soundVolume;
+
+   Vector                                  destCoor;
+   Quaternion                              destDir;
 };
 
Index: trunk/src/world_entities/skydome.cc
===================================================================
--- trunk/src/world_entities/skydome.cc	(revision 8793)
+++ trunk/src/world_entities/skydome.cc	(revision 8793)
@@ -0,0 +1,206 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 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: hdavid, amaechler
+   co-programmer: ...
+*/
+
+#include "skydome.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "static_model.h"
+#include "shader.h"
+
+#include "network_game_manager.h"
+#include "converter.h"
+#include "util/loading/resource_manager.h"
+
+#define DTOR (PI/180.0f)
+#define SQR(x) (x*x)
+
+using namespace std;
+
+
+/**
+ *  initializes a skybox from a XmlElement
+ */
+Skydome::Skydome()
+{
+  this->init();
+}
+
+
+void Skydome::init()
+{
+  PRINTF(0)("Skydome init\n");
+  
+  this->setClassID(CL_SKYDOME, "Skydome");
+  this->toList(OM_BACKGROUND);
+  this->toReflectionList(); 
+  
+}
+
+
+/**
+ *  default destructor
+ */
+Skydome::~Skydome()
+{
+  PRINTF(0)("Deleting Skydome\n");
+  
+  if (glIsTexture(texture))
+    glDeleteTextures(1, &texture);
+}
+
+
+void Skydome::setShader(Shader* shader)
+{
+  this->shader = shader;
+}
+
+void Skydome::setTexture(GLuint texture)
+{
+  this->texture = texture;
+}
+
+
+void Skydome::draw() const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_BLEND);
+
+  glEnable(GL_TEXTURE_3D);
+  glBindTexture(GL_TEXTURE_3D, texture);
+
+  this->shader->activateShader();
+
+  glPushMatrix();
+  glTranslatef(0.0f,pRadius,0.0f);
+  
+
+  glBegin(GL_TRIANGLES);
+
+  for (int i=0; i < numIndices; i++)
+  {
+    glColor3f(1.0f, 1.0f, 1.0f);
+
+    glTexCoord2f(planeVertices[indices[i]].u, planeVertices[indices[i]].v);
+    glVertex3f(planeVertices[indices[i]].x, planeVertices[indices[i]].y, planeVertices[indices[i]].z);
+  }
+
+  glEnd();
+
+  glPopMatrix();
+
+  this->shader->deactivateShader();
+
+  glPopAttrib();
+}
+
+
+void Skydome::generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, float hTile, float vTile)
+{
+  PRINTF(0)("Generating a sky plane");
+  
+  // Make sure our vertex array is clear
+  if (planeVertices) 
+  {
+    delete planeVertices;
+    planeVertices = NULL;
+  }
+
+  // Make sure our index array is clear
+  if (indices)
+  {
+    delete indices;
+    indices = NULL;
+  }
+
+  // Set the number of divisions into a valid range
+  int divs = divisions;
+  if (divisions < 1) 
+    divs = 1;
+
+  if (divisions > 256) 
+    divs = 256; 
+
+  pRadius = planetRadius;
+
+  // Initialize the Vertex and indices arrays
+  numPlaneVertices = (divs + 1) * (divs + 1);   // 1 division would give 4 verts
+  numIndices  = divs * divs * 2 * 3;       // 1 division would give 6 indices for 2 tris
+
+  planeVertices = new VertexInfo[numPlaneVertices];
+  memset(planeVertices, 0, sizeof(VertexInfo));
+
+  indices = new int[numIndices];
+  memset(indices, 0, sizeof(int)*numIndices);
+
+  // Calculate some values we will need
+  float plane_size = 2.0f * (float)sqrt((SQR(atmosphereRadius)-SQR(planetRadius)));
+  float delta = plane_size/(float)divs;
+  float tex_delta = 2.0f/(float)divs;
+  
+  // Variables we'll use during the dome's generation
+  float x_dist   = 0.0f;
+  float z_dist   = 0.0f;
+  float x_height = 0.0f;
+  float z_height = 0.0f;
+  float height = 0.0f;
+
+  VertexInfo SV; // temporary vertex
+
+  for (int i=0;i <= divs;i++)
+  {
+    for (int j=0; j <= divs; j++)
+    {
+      x_dist = (-0.5f * plane_size) + ((float)j*delta);
+      z_dist = (-0.5f * plane_size) + ((float)i*delta);
+
+      x_height = (x_dist*x_dist) / atmosphereRadius;
+      z_height = (z_dist*z_dist) / atmosphereRadius;
+      height = x_height + z_height;
+
+      SV.x = x_dist;
+      SV.y = 0.0f - height;
+      SV.z = z_dist;
+
+      // Calculate the texture coordinates
+      SV.u = hTile*((float)j * tex_delta*0.5f);
+      SV.v = vTile*(1.0f - (float)i * tex_delta*0.5f);
+
+      planeVertices[i*(divs+1)+j] = SV;
+    }
+  }
+
+  // Calculate the indices
+  int index = 0;
+  for (int i=0; i < divs;i++)
+  {
+    for (int j=0; j < divs; j++)
+    {
+      int startvert = (i*(divs+1) + j);
+
+        // tri 1
+      indices[index++] = startvert;
+      indices[index++] = startvert+1;
+      indices[index++] = startvert+divs+1;
+
+      // tri 2
+      indices[index++] = startvert+1;
+      indices[index++] = startvert+divs+2;
+      indices[index++] = startvert+divs+1;
+    }
+  }  
+}
Index: trunk/src/world_entities/skydome.h
===================================================================
--- trunk/src/world_entities/skydome.h	(revision 8793)
+++ trunk/src/world_entities/skydome.h	(revision 8793)
@@ -0,0 +1,62 @@
+/*!
+ * @file skydome.h
+ */
+
+#ifndef _SKYDOME_H
+#define _SKYDOME_H
+
+/* INCLUDES */
+#include "world_entity.h"
+#include "shader.h"
+
+//   typedef struct VERTEX
+// {
+//   float x,y,z;
+//   unsigned int color;
+//   float u, v;
+// }  ;
+
+
+//! A Class to handle a SkyDome
+class Skydome : public WorldEntity
+{
+public:
+  Skydome();
+
+  virtual ~Skydome();
+
+  void init();
+  virtual void draw() const;
+
+  void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius,
+                        float hTile, float vTile);
+  
+  void setShader(Shader* shader);
+  void setTexture(GLuint texture);
+
+private:
+  
+  typedef struct VertexInfo
+  {
+    float x,y,z;
+    unsigned int color;
+    float u, v;
+  };
+
+  
+  VertexInfo *planeVertices;
+  int numPlaneVertices;
+
+  int *indices;
+  int numIndices;
+
+  float pRadius;
+
+  VertexInfo *vertices;
+  int numVertices;
+  
+  GLuint texture;
+  Shader* shader;
+};
+
+#endif  /* _SKYDOME_H */
