35 : m_map(map), m_zone(zoneId), m_weatherChances(weatherChances)
97 localtime_r(>ime, <ime);
98 uint32 season = ((ltime.tm_yday - 78 + 365)/91)%4;
100 static char const* seasonName[
WEATHER_SEASONS] = {
"spring",
"summer",
"fall",
"winter" };
102 TC_LOG_INFO(
"misc",
"Generating a change in {} weather for zone {}.", seasonName[season],
m_zone);
159 else if (rnd <= chance2)
161 else if (rnd <= chance3)
231 wthstr =
"light rain";
234 wthstr =
"medium rain";
237 wthstr =
"heavy rain";
240 wthstr =
"light snow";
243 wthstr =
"medium snow";
246 wthstr =
"heavy snow";
249 wthstr =
"light sandstorm";
252 wthstr =
"medium sandstorm";
255 wthstr =
"heavy sandstorm";
261 wthstr =
"blackrain";
#define TC_LOG_INFO(filterType__,...)
uint32 urand(uint32 min, uint32 max)
bool SendZoneMessage(uint32 zone, WorldPacket const *packet, WorldSession const *self=nullptr, uint32 team=0) const
Send a packet to all players (or players selected team) in the zone (except self if mentioned)
void SendDirectMessage(WorldPacket const *data) const
WorldPacket const * Write() override
WeatherSeasonChances data[WEATHER_SEASONS]
void SetWeather(WeatherType type, float intensity)
Set the weather.
Weather(Map *map, 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)