Index: branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 8281)
+++ branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 8326)
@@ -56,5 +56,4 @@
   
   LoadParam(root, "coord", this, LighteningEffect, coord);
-  LoadParam(root, "option", this, LighteningEffect, setLighteningOption);
   LoadParam(root, "frequency", this, LighteningEffect, setFlashFrequency);
   LoadParam(root, "const-time", this, LighteningEffect, setFlashConstTime);
@@ -62,4 +61,10 @@
   LoadParam(root, "size", this, LighteningEffect, setFlashSize);
   LoadParam(root, "seed", this, LighteningEffect, setFlashSeed);
+  
+  LOAD_PARAM_START_CYCLE(root, element);
+  {
+    LoadParam_CYCLE(element, "option", this, LighteningEffect, setLighteningOption);
+  }
+  LOAD_PARAM_END_CYCLE(element);
 }
 
@@ -88,5 +93,4 @@
   this->billboard[0]->setTexture("maps/lightning_bolt1.png");
   this->billboard[0]->setSize(this->width, this->height);
-  this->billboard[0]->setAbsCoor(3000,850,0);
   this->billboard[0]->setVisibiliy(false);
 
@@ -94,5 +98,4 @@
   this->billboard[1]->setTexture("maps/lightning_bolt2.png");
   this->billboard[1]->setSize(this->width, this->height);
-  this->billboard[1]->setAbsCoor(3000,850,0);
   this->billboard[1]->setVisibiliy(false);
 
@@ -100,5 +103,4 @@
   this->billboard[2]->setTexture("maps/lightning_bolt3.png");
   this->billboard[2]->setSize(this->width, this->height);
-  this->billboard[2]->setAbsCoor(3000,850,0);
   this->billboard[2]->setVisibiliy(false);
 
@@ -106,6 +108,21 @@
   this->billboard[3]->setTexture("maps/lightning_bolt4.png");
   this->billboard[3]->setSize(this->width, this->height);
-  this->billboard[3]->setAbsCoor(3000,850,0);
   this->billboard[3]->setVisibiliy(false);
+  
+  if (this->lighteningMove)
+  {
+    this->cameraCoor = State::getCameraNode()->getAbsCoor();
+    this->billboard[0]->setAbsCoor(this->cameraCoor.x+3000,850,this->cameraCoor.z+0);
+    this->billboard[1]->setAbsCoor(this->cameraCoor.x+3000,850,this->cameraCoor.z+0);
+    this->billboard[2]->setAbsCoor(this->cameraCoor.x+3000,850,this->cameraCoor.z+0);
+    this->billboard[3]->setAbsCoor(this->cameraCoor.x+3000,850,this->cameraCoor.z+0);
+  }
+  else
+  {
+    this->billboard[0]->setAbsCoor(3000,850,0);
+    this->billboard[1]->setAbsCoor(3000,850,0);
+    this->billboard[2]->setAbsCoor(3000,850,0);
+    this->billboard[3]->setAbsCoor(3000,850,0);
+  }
   
   this->flashLight = new Light();
@@ -127,8 +144,19 @@
 void LighteningEffect::coord(float x, float y, float z)
 {
-  this->billboard[0]->setAbsCoor(x, y, z);
-  this->billboard[1]->setAbsCoor(x, y, z);
-  this->billboard[2]->setAbsCoor(x, y, z);
-  this->billboard[3]->setAbsCoor(x, y, z);
+  if (this->lighteningMove)
+  {
+    this->cameraCoor = State::getCameraNode()->getAbsCoor();
+    this->billboard[0]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+    this->billboard[1]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+    this->billboard[2]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+    this->billboard[3]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+  }
+  else
+  {
+    this->billboard[0]->setAbsCoor(x, y, z);
+    this->billboard[1]->setAbsCoor(x, y, z);
+    this->billboard[2]->setAbsCoor(x, y, z);
+    this->billboard[3]->setAbsCoor(x, y, z);
+  }
   this->mainPosX = x;
   this->mainPosY = y;
@@ -219,6 +247,17 @@
   if( this->bNewCoordinate)
   {
-    float posX = this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX;
-    float posZ = this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX;
+    float posX, posZ;
+    if(this->lighteningMove)
+    {
+    this->cameraCoor = State::getCameraNode()->getAbsCoor();
+    posX = this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX + this->cameraCoor.x;
+    posZ = this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX + this->cameraCoor.z;
+    }
+    else
+    {
+      posX = this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX;
+      posZ = this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX;
+    }
+    
     this->billboard[0]->setAbsCoor(posX, this->mainPosY, posZ);
     this->billboard[1]->setAbsCoor(posX, this->mainPosY, posZ);
Index: branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 8281)
+++ branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 8326)
@@ -37,5 +37,6 @@
     void setFlashSize(float width, float height, float seedWidth, float seedHeight);
     
-    inline void setLighteningOption(const std::string& option) { if (option == "activate") this->lighteningActivate = true;}
+    inline void setLighteningOption(const std::string& option) { if (option == "activate") this->lighteningActivate = true;
+                                                                                         if (option == "movelightening") this->lighteningMove = true;}
     inline void setFlashFrequency(float mainFrequency, float seedTime) { this->mainFrequency = mainFrequency;
                                                                                                             this->flashFrequency = mainFrequency;
@@ -55,4 +56,5 @@
     Billboard* billboard[4];
     bool lighteningActivate;
+    bool lighteningMove;
 
     float flashFrequency;
@@ -76,4 +78,6 @@
     float mainPosY;
     float mainPosZ;
+    
+    Vector cameraCoor;
 
     Light* flashLight;
