int Whr_InitNight(int n)
{

// ====================================================================
// night, 23 - 7 hour

	int minwind, maxwind;
	int rain;
	int winds;
	int fog;
	string ver = ""; // KK

	// NK -->
	winds = rand(11);
	rain = rand(8);
	fog = rand(20);
	
	minwind = 1 + Rand(3);
	if(winds >= 1)
	{
		minwind = 6 + Rand(4);
	}
	if(winds >= 3)
	{
		minwind = 8 + Rand(6);
	}
	if(winds >= 6)
	{
		minwind = 14 + Rand(6);
	}
	if(winds >= 9)
	{
		minwind = 20 + Rand(8);
	}
	if(winds >= 11)
	{
		minwind = 26 + Rand(10);
	}
	maxwind = minwind + 4;
	// NK <--

	if (AERO_SKIES) ver = "\AERO"; // KK

	Weathers[n].id = "Moon Night";
	Weathers[n].Hour.Min = 22;
	Weathers[n].Hour.Max = 6;
	Weathers[n].Lighting = "night1";
	Weathers[n].LightingLm = "storm";
	Weathers[n].InsideBack = "n";

	Weathers[n].Storm = false;
	Weathers[n].Tornado = false;
	Weathers[n].Shark = true;
	Weathers[n].Lights = true;
	Weathers[n].Night = true;

	Weathers[n].Shadow.Density.Head = argb(255,96,96,96);
	Weathers[n].Shadow.Density.Foot = argb(255,96,96,64);

	Weathers[n].Lightning.Enable = false;
	Weathers[n].Lightning.Texture = "Weather\lightning\lightning.tga";
	Weathers[n].Lightning.FlickerTime = 32;
	Weathers[n].Lightning.SubTexX = 1;
	Weathers[n].Lightning.SubTexY = 1;

	Weathers[n].Sky.Dir = "weather\skies" + ver + "\6\\"; // KK 
	Weathers[n].Sky.Color = argb(0,200,200,255);
	Weathers[n].Sky.Rotate = 0.0;
	Weathers[n].Sky.Size = 1000.0;
	Weathers[n].Sky.Angle = 0.06;
	
	if ( fog == 30 )
	{
		Weathers[n].Fog.Enable = true;
		Weathers[n].Fog.Height = 20000.0;
		Weathers[n].Fog.Start = 0.0;
		Weathers[n].Fog.Density = 0.04;
		Weathers[n].Fog.SeaDensity = 0.04;
		Weathers[n].Fog.Color = argb(0,11,11,22);
		
		Weathers[n].SpecialSeaFog.Enable = true;
		Weathers[n].SpecialSeaFog.Height = 10000.0;
		Weathers[n].SpecialSeaFog.Start = 0.0;
		Weathers[n].SpecialSeaFog.Density = 0.04;
		Weathers[n].SpecialSeaFog.SeaDensity = 0.04;
		Weathers[n].SpecialSeaFog.Color = argb(0,11,11,22);
	}
	else
	{
		Weathers[n].Fog.Enable = true;
		Weathers[n].Fog.Height = 100.0;
		Weathers[n].Fog.Start = 0.0;
		Weathers[n].Fog.Density = 0.003;
		Weathers[n].Fog.SeaDensity = 0.003;
		Weathers[n].Fog.Color = argb(0,11,11,22);
		
		Weathers[n].SpecialSeaFog.Enable = true;
		Weathers[n].SpecialSeaFog.Height = 200.0;
		Weathers[n].SpecialSeaFog.Start = 0.0;
		Weathers[n].SpecialSeaFog.Density = 0.003;
		Weathers[n].SpecialSeaFog.SeaDensity = 0.003;
		Weathers[n].SpecialSeaFog.Color = argb(0,11,11,22);
	}

	if (rain <= 7)
	{
		Weathers[n].Rain.NumDrops = 0;
		Weathers[n].Rain.Color = argb(0,73,73,73);
		Weathers[n].Rain.DropLength = 2.12;
		Weathers[n].Rain.Height = 30.0;
		Weathers[n].Rain.Radius = 30.0;
		Weathers[n].Rain.Speed = 18.0;
		Weathers[n].Rain.Jitter = 0.4;
		Weathers[n].Rain.WindSpeedJitter = 0.5;
		Weathers[n].Rain.MaxBlend = 49;
		Weathers[n].Rain.TimeBlend = 2000;

		Weathers[n].Rainbow.Enable = false;
		Weathers[n].Rainbow.Texture = "weather\rainbow\rainbow.tga";
	}

	if (rain > 7)
	{
		Weathers[n].Rain.NumDrops = 1000;
		Weathers[n].Rain.Color = argb(0,73,73,73);
		Weathers[n].Rain.DropLength = 2.12;
		Weathers[n].Rain.Height = 30.0;
		Weathers[n].Rain.Radius = 20.0;
		Weathers[n].Rain.Speed = 16.0;
		Weathers[n].Rain.Jitter = 0.4;
		Weathers[n].Rain.WindSpeedJitter = 0.5;
		Weathers[n].Rain.MaxBlend = 49;
		Weathers[n].Rain.TimeBlend = 2000;

		Weathers[n].Rainbow.Enable = false;
		Weathers[n].Rainbow.Texture = "weather\rainbow\rainbow.tga";
	}

	Weathers[n].Sun.Color = argb(0,170,195,255);
	Weathers[n].Sun.Ambient = argb(0,12,23,33);
	Weathers[n].Sun.AzimuthAngle = Degree2Radian(0.0);
	Weathers[n].Sun.HeightAngle = 0.15;

	Weathers[n].Sun.Glow.Enable = false;
	Weathers[n].Sun.Flare.Enable = false;
	Weathers[n].Sun.Overflow.Enable = false;

	Weathers[n].Sea.GF2MX.Sky.Color = argb(0,29,30,47);
	Weathers[n].Sea.GF2MX.Water.Color = argb(0,0,0,0);
	Weathers[n].Sea.GF2MX.Bump.Tile = 0.05;
	Weathers[n].Sea.GF2MX.Bump.AnimSpeed = 7.0;
	Weathers[n].Sea.GF2MX.Bump.Dir = "weather\sea\bump_g2mx\\"; 

	Weathers[n].Sea.Transparency = 0.4;
	Weathers[n].Sea.FrenelCoefficient = 0.7;
	Weathers[n].Sea.WaterReflection = 0.7;
	Weathers[n].Sea.WaterAttenuation = 0.8;
	Weathers[n].Sea.Sky.Color = argb(0,200,200,255);
	Weathers[n].Sea.Water.Color = argb(0,20,28,36);
	Weathers[n].Sea.Pena.Color = argb(0,50,50,80);
	Weathers[n].Sea.Bump.Dir = "resource\textures\weather\sea\bump_g3\\"; 
	Weathers[n].Sea.Bump.Tile = 0.05;
	Weathers[n].Sea.Bump.Ang = 0.0;
	Weathers[n].Sea.Bump.Speed = 0.01;
	Weathers[n].Sea.Bump.AnimSpeed = 15.0;
	Weathers[n].Sea.Bump.Scale = 2.0;
	Weathers[n].Sea.SunRoad.Start = 0.995;
	Weathers[n].Sea.SunRoad.Color1 = argb(0,55,55,100);
	Weathers[n].Sea.SunRoad.Color2 = argb(0,255,255,255);
	Weathers[n].Sea.SunRoad.Power = 3.0;
	// NK -->
	string direction1, direction2, direction3;

	float fWindA, fSeaA, fSeaB;
	fWindA = frand(PIm2);
	fSeaA = PIm2 - fWindA;
	if (fSeaA >= (3.0 * PId2))
	{
		fSeaB = (fSeaA + PId2 - PIm2);
	}
	else
	{
		fSeaB = fSeaA + PId2;
	}
	Weathers[n].Wind.Angle = fWindA;
	Weathers[n].Wind.Speed.Min = minwind;
	Weathers[n].Wind.Speed.Max = maxwind;

	direction1 = fts(fSeaB, 4);
	direction2 = fts((fSeaB + (PId2 / 2.0)), 4);
	direction3 = fts((fSeaB - (PId2 / 2.0)), 4);

	float myWind = maxwind;
	if (maxwind > 25.0)
		myWind = 25.0;

	float windStrength1 = myWind / 26.0;
	float windStrength2 = myWind / 30.0;
	float windStrength3 = myWind / 28.0;

	float wave1 = 5 + windStrength2 * 3;
	float wave2 = 10 + windStrength1 * 3;
	float wave3 = 10 + windStrength3 * 3;

	string seaStrength1 = fts(windStrength1, 4);
	string seaStrength2 = fts(windStrength2, 4);
	string seaStrength3 = fts(windStrength3, 4);

	string waveLength1 = fts(wave1, 4);
	string waveLength2 = fts(wave2, 4);
	string waveLength3 = fts(wave3, 4);

	string waveSpeed = "-78.00";

if(REALISTIC_WAVES == 1)
{
//Note on the piece of code below: each line, numbered 1, 2 and 3, are each separate "generators" of waves, each controlling the different aspects of the harmonica model. The first line controls the height, direction and speed of the wave. The second line controls the direction, speed and height of the entire surface. The third line controls the direction, height and speed of each wave. The value changed is "waveLength#" (waveLength1 is equal to 20 right now, wavelength2 is equal to 0.01, and wavelength3 is equal to 10). For example, setting the second and third line to 0.01 (minimum value) while keeping the first line as the same number would make the waves go in a single direction, without changing shape or breaking. Setting all numbers for "generators" to an equal value would create perfect hamonic waves. If you are not satisfied with the waves in this mod, please modify the the values that right now say "20", "0.01" and "10"
//	Weathers[n].Sea.Harmonics.h1 = direction1 + ",10.0000,1.0000,0.00,0.00";
	Weathers[n].Sea.Harmonics.h1 = direction1 + "," + 20 + "," + seaStrength1 + ",0," + waveSpeed;
	Weathers[n].Sea.Harmonics.h2 = direction2 + "," + 0.01 + "," + seaStrength2 + ",0," + waveSpeed;
	Weathers[n].Sea.Harmonics.h3 = direction3 + "," + 10 + "," + seaStrength3 + ",0," + waveSpeed;
}
else
{
//	Weathers[n].Sea.Harmonics.h1 = direction1 + ",10.0000,1.0000,0.00,0.00";
	Weathers[n].Sea.Harmonics.h1 = direction1 + "," + waveLength1 + "," + seaStrength1 + ",0," + waveSpeed;
	Weathers[n].Sea.Harmonics.h2 = direction2 + "," + waveLength2 + "," + seaStrength2 + ",0," + waveSpeed;
	Weathers[n].Sea.Harmonics.h3 = direction3 + "," + waveLength3 + "," + seaStrength3 + ",0," + waveSpeed;
}
	// NK <--
	
	n++;

	return n;
}
