34 : m_zone(zoneId), m_weatherChances(weatherChances)
96 localtime_r(>ime, <ime);
97 uint32 season = ((ltime.tm_yday - 78 + 365) / 91) % 4;
99 static char const* seasonName[
WEATHER_SEASONS] = {
"spring",
"summer",
"fall",
"winter" };
101 TC_LOG_INFO(
"misc",
"Generating a change in {} weather for zone {}.", seasonName[season],
m_zone);
158 else if (rnd <= chance2)
160 else if (rnd <= chance3)
230 wthstr =
"light rain";
233 wthstr =
"medium rain";
236 wthstr =
"heavy rain";
239 wthstr =
"light snow";
242 wthstr =
"medium snow";
245 wthstr =
"heavy snow";
248 wthstr =
"light sandstorm";
251 wthstr =
"medium sandstorm";
254 wthstr =
"heavy sandstorm";
260 wthstr =
"blackrain";
#define TC_LOG_INFO(filterType__,...)
uint32 urand(uint32 min, uint32 max)
void SendDirectMessage(WorldPacket const *data) const
WorldPacket const * Write() override
WeatherSeasonChances data[WEATHER_SEASONS]
void SetWeather(WeatherType type, float intensity)
Set the weather.
Weather(uint32 zoneId, WeatherData const *weatherChances)
Create the Weather object.
static void SendFineWeatherUpdateToPlayer(Player *player)
bool UpdateWeather()
Send the new weather to all players in the zone.
bool ReGenerate()
Calculate the new weather.
WeatherData const * m_weatherChances
WeatherState GetWeatherState() const
Get the sound number associated with the current weather.
bool Update(uint32 diff)
Launch a weather update.
void SendWeatherUpdateToPlayer(Player *player)
@ CONFIG_INTERVAL_CHANGEWEATHER
@ WEATHER_STATE_HEAVY_RAIN
@ WEATHER_STATE_HEAVY_SANDSTORM
@ WEATHER_STATE_MEDIUM_SNOW
@ WEATHER_STATE_MEDIUM_RAIN
@ WEATHER_STATE_MEDIUM_SANDSTORM
@ WEATHER_STATE_LIGHT_SNOW
@ WEATHER_STATE_BLACKRAIN
@ WEATHER_STATE_HEAVY_SNOW
@ WEATHER_STATE_LIGHT_SANDSTORM
@ WEATHER_STATE_LIGHT_RAIN
void SetInterval(time_t interval)
time_t GetCurrent() const
time_t GetInterval() const
void SetCurrent(time_t current)