Posted: Mon Mar 05, 2007 2:04 pm Post subject: Weather Control
The script goes on your Area OnEnter, the variables should be explained in the top notes
Code:
//hc_weather
////////////////////////////////////////////////////////
//
// Sets the weather of an area determined by variables
//
// Author: Hellcow
// Last modified: March 05, 2007
////////////////////////////////////////////////////////
// Variable - WEATHER_TYPE - int
// 0 = Rain
// 1 = Snow
// 2 = Lightning
//
// Variable - WEATHER_POWER - int
// 0 = No Power
// 1 = Weak
// 2 = Light
// 3 = Medium
// 4 = Heavy
// 5 = Stormy
//
void main()
{
int nWeatherType = GetLocalInt(OBJECT_SELF, "WEATHER_TYPE");
int nPower = GetLocalInt(OBJECT_SELF, "WEATHER_POWER");
int nWeather;
int nPowerChoice;
switch ( nWeatherType )
{
case 0: // Rain
nWeather = WEATHER_TYPE_RAIN;
break;
case 1: // Snow
nWeather = WEATHER_TYPE_SNOW;
break;
case 2: // Lightning
nWeather = WEATHER_TYPE_LIGHTNING;
break;
}
switch ( nPower )
{
case 0:
nPowerChoice = WEATHER_POWER_OFF;
break;
case 1:
nPowerChoice = WEATHER_POWER_WEAK;
break;
case 2:
nPowerChoice = WEATHER_POWER_LIGHT;
break;
case 3:
nPowerChoice = WEATHER_POWER_MEDIUM;
break;
case 4:
nPowerChoice = WEATHER_POWER_HEAVY;
break;
case 5:
nPowerChoice = WEATHER_POWER_STORMY;
break;
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum