TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
The World

Files

file  Weather.cpp
 
file  WeatherMgr.cpp
 
file  World.cpp
 

Namespaces

 WeatherMgr
 

Classes

struct  WeatherSeasonChances
 
struct  WeatherData
 
class  Weather
 Weather for one zone. More...
 
struct  CliCommandHolder
 Storage class for commands issued for delayed execution. More...
 
struct  CharacterInfo
 
class  World
 The World. More...
 

Macros

#define WEATHER_SEASONS   4
 
#define MAX_CHARACTERS_PER_REALM   11
 
#define sWorld   World::instance()
 

Typedefs

typedef std::unordered_map
< uint32, WorldSession * > 
SessionMap
 

Enumerations

enum  WeatherState : uint32 {
  WEATHER_STATE_FINE = 0, WEATHER_STATE_FOG = 1, WEATHER_STATE_LIGHT_RAIN = 3, WEATHER_STATE_MEDIUM_RAIN = 4,
  WEATHER_STATE_HEAVY_RAIN = 5, WEATHER_STATE_LIGHT_SNOW = 6, WEATHER_STATE_MEDIUM_SNOW = 7, WEATHER_STATE_HEAVY_SNOW = 8,
  WEATHER_STATE_LIGHT_SANDSTORM = 22, WEATHER_STATE_MEDIUM_SANDSTORM = 41, WEATHER_STATE_HEAVY_SANDSTORM = 42, WEATHER_STATE_THUNDERS = 86,
  WEATHER_STATE_BLACKRAIN = 90, WEATHER_STATE_BLACKSNOW = 106
}
 
enum  ServerMessageType {
  SERVER_MSG_SHUTDOWN_TIME = 1, SERVER_MSG_RESTART_TIME = 2, SERVER_MSG_STRING = 3, SERVER_MSG_SHUTDOWN_CANCELLED = 4,
  SERVER_MSG_RESTART_CANCELLED = 5, SERVER_MSG_BG_SHUTDOWN_TIME = 6, SERVER_MSG_BG_RESTART_TIME = 7, SERVER_MSG_INSTANCE_SHUTDOWN_TIME = 8,
  SERVER_MSG_INSTANCE_RESTART_TIME = 9, SERVER_MSG_CONTENT_READY = 10, SERVER_MSG_TICKET_SERVICED_SOON = 11, SERVER_MSG_WAIT_TIME_UNAVAILABLE = 12,
  SERVER_MSG_TICKET_WAIT_TIME = 13
}
 
enum  ShutdownMask { SHUTDOWN_MASK_RESTART = 1, SHUTDOWN_MASK_IDLE = 2 }
 
enum  ShutdownExitCode { SHUTDOWN_EXIT_CODE = 0, ERROR_EXIT_CODE = 1, RESTART_EXIT_CODE = 2 }
 
enum  WorldTimers {
  WUPDATE_AUCTIONS, WUPDATE_AUCTIONS_PENDING, WUPDATE_WEATHERS, WUPDATE_UPTIME,
  WUPDATE_CORPSES, WUPDATE_EVENTS, WUPDATE_CLEANDB, WUPDATE_AUTOBROADCAST,
  WUPDATE_MAILBOXQUEUE, WUPDATE_DELETECHARS, WUPDATE_AHBOT, WUPDATE_PINGDB,
  WUPDATE_GUILDSAVE, WUPDATE_COUNT
}
 Timers for different object refresh rates. More...
 
enum  WorldBoolConfigs {
  CONFIG_DURABILITY_LOSS_IN_PVP = 0, CONFIG_ADDON_CHANNEL, CONFIG_ALLOW_PLAYER_COMMANDS, CONFIG_CLEAN_CHARACTER_DB,
  CONFIG_GRID_UNLOAD, CONFIG_STATS_SAVE_ONLY_ON_LOGOUT, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL,
  CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP, CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, CONFIG_ALLOW_TWO_SIDE_TRADE,
  CONFIG_ALL_TAXI_PATHS, CONFIG_INSTANT_TAXI, CONFIG_INSTANCE_IGNORE_LEVEL, CONFIG_INSTANCE_IGNORE_RAID,
  CONFIG_CAST_UNSTUCK, CONFIG_ALLOW_GM_GROUP, CONFIG_GM_LOWER_SECURITY, CONFIG_SKILL_PROSPECTING,
  CONFIG_SKILL_MILLING, CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY, CONFIG_WEATHER, CONFIG_QUEST_IGNORE_RAID,
  CONFIG_DETECT_POS_COLLISION, CONFIG_RESTRICTED_LFG_CHANNEL, CONFIG_TALENTS_INSPECTING, CONFIG_CHAT_FAKE_MESSAGE_PREVENTING,
  CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP, CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE, CONFIG_DEATH_BONES_WORLD, CONFIG_DEATH_BONES_BG_OR_ARENA,
  CONFIG_DIE_COMMAND_MODE, CONFIG_DECLINED_NAMES_USED, CONFIG_BATTLEGROUND_CAST_DESERTER, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE,
  CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY, CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE, CONFIG_BG_XP_FOR_KILL, CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
  CONFIG_ARENA_SEASON_IN_PROGRESS, CONFIG_ARENA_LOG_EXTENDED_INFO, CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN, CONFIG_VMAP_INDOOR_CHECK,
  CONFIG_START_ALL_SPELLS, CONFIG_START_ALL_EXPLORED, CONFIG_START_ALL_REP, CONFIG_ALWAYS_MAXSKILL,
  CONFIG_PVP_TOKEN_ENABLE, CONFIG_NO_RESET_TALENT_COST, CONFIG_SHOW_KICK_IN_WORLD, CONFIG_SHOW_MUTE_IN_WORLD,
  CONFIG_SHOW_BAN_IN_WORLD, CONFIG_AUTOBROADCAST, CONFIG_SUPPORT_ENABLED, CONFIG_SUPPORT_TICKETS_ENABLED,
  CONFIG_SUPPORT_BUGS_ENABLED, CONFIG_SUPPORT_COMPLAINTS_ENABLED, CONFIG_SUPPORT_SUGGESTIONS_ENABLED, CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES,
  CONFIG_PRESERVE_CUSTOM_CHANNELS, CONFIG_PDUMP_NO_PATHS, CONFIG_PDUMP_NO_OVERWRITE, CONFIG_QUEST_IGNORE_AUTO_ACCEPT,
  CONFIG_QUEST_IGNORE_AUTO_COMPLETE, CONFIG_QUEST_ENABLE_QUEST_TRACKER, CONFIG_WARDEN_ENABLED, CONFIG_ENABLE_MMAPS,
  CONFIG_WINTERGRASP_ENABLE, CONFIG_UI_QUESTLEVELS_IN_DIALOGS, CONFIG_EVENT_ANNOUNCE, CONFIG_STATS_LIMITS_ENABLE,
  CONFIG_INSTANCES_RESET_ANNOUNCE, CONFIG_IP_BASED_ACTION_LOGGING, CONFIG_ALLOW_TRACK_BOTH_RESOURCES, CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA,
  CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA, CONFIG_FEATURE_SYSTEM_BPAY_STORE_ENABLED, CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED, CONFIG_RESET_DUEL_COOLDOWNS,
  CONFIG_RESET_DUEL_HEALTH_MANA, BOOL_CONFIG_VALUE_COUNT
}
 Configuration elements. More...
 
enum  WorldFloatConfigs {
  CONFIG_GROUP_XP_DISTANCE = 0, CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE, CONFIG_SIGHT_MONSTER, CONFIG_SIGHT_GUARDER,
  CONFIG_LISTEN_RANGE_SAY, CONFIG_LISTEN_RANGE_TEXTEMOTE, CONFIG_LISTEN_RANGE_YELL, CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS,
  CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS, CONFIG_THREAT_RADIUS, CONFIG_STATS_LIMITS_DODGE, CONFIG_STATS_LIMITS_PARRY,
  CONFIG_STATS_LIMITS_BLOCK, CONFIG_STATS_LIMITS_CRIT, CONFIG_ARENA_WIN_RATING_MODIFIER_1, CONFIG_ARENA_WIN_RATING_MODIFIER_2,
  CONFIG_ARENA_LOSE_RATING_MODIFIER, CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER, FLOAT_CONFIG_VALUE_COUNT
}
 
enum  WorldIntConfigs {
  CONFIG_COMPRESSION = 0, CONFIG_INTERVAL_SAVE, CONFIG_INTERVAL_GRIDCLEAN, CONFIG_INTERVAL_MAPUPDATE,
  CONFIG_INTERVAL_CHANGEWEATHER, CONFIG_INTERVAL_DISCONNECT_TOLERANCE, CONFIG_PORT_WORLD, CONFIG_PORT_INSTANCE,
  CONFIG_SOCKET_TIMEOUTTIME, CONFIG_SESSION_ADD_DELAY, CONFIG_GAME_TYPE, CONFIG_REALM_ZONE,
  CONFIG_STRICT_PLAYER_NAMES, CONFIG_STRICT_CHARTER_NAMES, CONFIG_STRICT_PET_NAMES, CONFIG_MIN_PLAYER_NAME,
  CONFIG_MIN_CHARTER_NAME, CONFIG_MIN_PET_NAME, CONFIG_CHARACTER_CREATING_DISABLED, CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK,
  CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK, CONFIG_CHARACTERS_PER_ACCOUNT, CONFIG_CHARACTERS_PER_REALM, CONFIG_HEROIC_CHARACTERS_PER_REALM,
  CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER, CONFIG_SKIP_CINEMATICS, CONFIG_MAX_PLAYER_LEVEL, CONFIG_MIN_DUALSPEC_LEVEL,
  CONFIG_START_PLAYER_LEVEL, CONFIG_START_HEROIC_PLAYER_LEVEL, CONFIG_START_PLAYER_MONEY, CONFIG_CURRENCY_START_APEXIS_CRYSTALS,
  CONFIG_CURRENCY_MAX_APEXIS_CRYSTALS, CONFIG_CURRENCY_START_JUSTICE_POINTS, CONFIG_CURRENCY_MAX_JUSTICE_POINTS, CONFIG_CURRENCY_START_HONOR_POINTS,
  CONFIG_CURRENCY_MAX_HONOR_POINTS, CONFIG_CURRENCY_START_CONQUEST_POINTS, CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP, CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD,
  CONFIG_CURRENCY_RESET_HOUR, CONFIG_CURRENCY_RESET_DAY, CONFIG_CURRENCY_RESET_INTERVAL, CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL,
  CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE, CONFIG_INSTANCE_RESET_TIME_HOUR, CONFIG_INSTANCE_UNLOAD_DELAY, CONFIG_MAX_PRIMARY_TRADE_SKILL,
  CONFIG_MIN_PETITION_SIGNS, CONFIG_GM_LOGIN_STATE, CONFIG_GM_VISIBLE_STATE, CONFIG_GM_CHAT,
  CONFIG_GM_WHISPERING_TO, CONFIG_GM_FREEZE_DURATION, CONFIG_GM_LEVEL_IN_GM_LIST, CONFIG_GM_LEVEL_IN_WHO_LIST,
  CONFIG_START_GM_LEVEL, CONFIG_GROUP_VISIBILITY, CONFIG_MAIL_DELIVERY_DELAY, CONFIG_UPTIME_UPDATE,
  CONFIG_SKILL_CHANCE_ORANGE, CONFIG_SKILL_CHANCE_YELLOW, CONFIG_SKILL_CHANCE_GREEN, CONFIG_SKILL_CHANCE_GREY,
  CONFIG_SKILL_CHANCE_MINING_STEPS, CONFIG_SKILL_CHANCE_SKINNING_STEPS, CONFIG_SKILL_GAIN_CRAFTING, CONFIG_SKILL_GAIN_GATHERING,
  CONFIG_MAX_OVERSPEED_PINGS, CONFIG_EXPANSION, CONFIG_CHATFLOOD_MESSAGE_COUNT, CONFIG_CHATFLOOD_MESSAGE_DELAY,
  CONFIG_CHATFLOOD_MUTE_TIME, CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY, CONFIG_CREATURE_FAMILY_FLEE_DELAY, CONFIG_WORLD_BOSS_LEVEL_DIFF,
  CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF, CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF, CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY, CONFIG_CHAT_STRICT_LINK_CHECKING_KICK,
  CONFIG_CHAT_CHANNEL_LEVEL_REQ, CONFIG_CHAT_WHISPER_LEVEL_REQ, CONFIG_CHAT_SAY_LEVEL_REQ, CONFIG_TRADE_LEVEL_REQ,
  CONFIG_AUCTION_LEVEL_REQ, CONFIG_MAIL_LEVEL_REQ, CONFIG_CORPSE_DECAY_NORMAL, CONFIG_CORPSE_DECAY_RARE,
  CONFIG_CORPSE_DECAY_ELITE, CONFIG_CORPSE_DECAY_RAREELITE, CONFIG_CORPSE_DECAY_WORLDBOSS, CONFIG_DEATH_SICKNESS_LEVEL,
  CONFIG_INSTANT_LOGOUT, CONFIG_DISABLE_BREATHING, CONFIG_BATTLEGROUND_INVITATION_TYPE, CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
  CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH, CONFIG_ARENA_MAX_RATING_DIFFERENCE, CONFIG_ARENA_RATING_DISCARD_TIMER, CONFIG_ARENA_RATED_UPDATE_TIMER,
  CONFIG_ARENA_SEASON_ID, CONFIG_ARENA_START_RATING, CONFIG_ARENA_START_PERSONAL_RATING, CONFIG_ARENA_START_MATCHMAKER_RATING,
  CONFIG_MAX_WHO, CONFIG_HONOR_AFTER_DUEL, CONFIG_PVP_TOKEN_MAP_TYPE, CONFIG_PVP_TOKEN_ID,
  CONFIG_PVP_TOKEN_COUNT, CONFIG_INTERVAL_LOG_UPDATE, CONFIG_MIN_LOG_UPDATE, CONFIG_ENABLE_SINFO_LOGIN,
  CONFIG_PLAYER_ALLOW_COMMANDS, CONFIG_NUMTHREADS, CONFIG_LOGDB_CLEARINTERVAL, CONFIG_LOGDB_CLEARTIME,
  CONFIG_CLIENTCACHE_VERSION, CONFIG_GUILD_NEWS_LOG_COUNT, CONFIG_GUILD_EVENT_LOG_COUNT, CONFIG_GUILD_BANK_EVENT_LOG_COUNT,
  CONFIG_MIN_LEVEL_STAT_SAVE, CONFIG_RANDOM_BG_RESET_HOUR, CONFIG_GUILD_RESET_HOUR, CONFIG_CHARDELETE_KEEP_DAYS,
  CONFIG_CHARDELETE_METHOD, CONFIG_CHARDELETE_MIN_LEVEL, CONFIG_CHARDELETE_HEROIC_MIN_LEVEL, CONFIG_AUTOBROADCAST_CENTER,
  CONFIG_AUTOBROADCAST_INTERVAL, CONFIG_MAX_RESULTS_LOOKUP_COMMANDS, CONFIG_DB_PING_INTERVAL, CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION,
  CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS, CONFIG_LFG_OPTIONSMASK, CONFIG_MAX_INSTANCES_PER_HOUR, CONFIG_WARDEN_CLIENT_RESPONSE_DELAY,
  CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF, CONFIG_WARDEN_CLIENT_FAIL_ACTION, CONFIG_WARDEN_CLIENT_BAN_DURATION, CONFIG_WARDEN_NUM_MEM_CHECKS,
  CONFIG_WARDEN_NUM_OTHER_CHECKS, CONFIG_WINTERGRASP_PLR_MAX, CONFIG_WINTERGRASP_PLR_MIN, CONFIG_WINTERGRASP_PLR_MIN_LVL,
  CONFIG_WINTERGRASP_BATTLETIME, CONFIG_WINTERGRASP_NOBATTLETIME, CONFIG_WINTERGRASP_RESTART_AFTER_CRASH, CONFIG_GUILD_SAVE_INTERVAL,
  CONFIG_GUILD_UNDELETABLE_LEVEL, CONFIG_PACKET_SPOOF_POLICY, CONFIG_PACKET_SPOOF_BANMODE, CONFIG_PACKET_SPOOF_BANDURATION,
  CONFIG_ACC_PASSCHANGESEC, CONFIG_BG_REWARD_WINNER_HONOR_FIRST, CONFIG_BG_REWARD_WINNER_HONOR_LAST, CONFIG_BG_REWARD_LOSER_HONOR_FIRST,
  CONFIG_BG_REWARD_LOSER_HONOR_LAST, CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST, CONFIG_BG_REWARD_WINNER_CONQUEST_LAST, CONFIG_CREATURE_PICKPOCKET_REFILL,
  CONFIG_AHBOT_UPDATE_INTERVAL, CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_COOLDOWN, CONFIG_CHARTER_COST_GUILD, CONFIG_CHARTER_COST_ARENA_2v2,
  CONFIG_CHARTER_COST_ARENA_3v3, CONFIG_CHARTER_COST_ARENA_5v5, CONFIG_NO_GRAY_AGGRO_ABOVE, CONFIG_NO_GRAY_AGGRO_BELOW,
  INT_CONFIG_VALUE_COUNT
}
 
enum  Rates {
  RATE_HEALTH = 0, RATE_POWER_MANA, RATE_POWER_RAGE_INCOME, RATE_POWER_RAGE_LOSS,
  RATE_POWER_RUNICPOWER_INCOME, RATE_POWER_RUNICPOWER_LOSS, RATE_POWER_FOCUS, RATE_POWER_ENERGY,
  RATE_SKILL_DISCOVERY, RATE_DROP_ITEM_POOR, RATE_DROP_ITEM_NORMAL, RATE_DROP_ITEM_UNCOMMON,
  RATE_DROP_ITEM_RARE, RATE_DROP_ITEM_EPIC, RATE_DROP_ITEM_LEGENDARY, RATE_DROP_ITEM_ARTIFACT,
  RATE_DROP_ITEM_REFERENCED, RATE_DROP_ITEM_REFERENCED_AMOUNT, RATE_DROP_MONEY, RATE_XP_KILL,
  RATE_XP_BG_KILL, RATE_XP_QUEST, RATE_XP_GUILD_MODIFIER, RATE_XP_EXPLORE,
  RATE_REPAIRCOST, RATE_REPUTATION_GAIN, RATE_REPUTATION_LOWLEVEL_KILL, RATE_REPUTATION_LOWLEVEL_QUEST,
  RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS, RATE_CREATURE_NORMAL_HP, RATE_CREATURE_ELITE_ELITE_HP, RATE_CREATURE_ELITE_RAREELITE_HP,
  RATE_CREATURE_ELITE_WORLDBOSS_HP, RATE_CREATURE_ELITE_RARE_HP, RATE_CREATURE_NORMAL_DAMAGE, RATE_CREATURE_ELITE_ELITE_DAMAGE,
  RATE_CREATURE_ELITE_RAREELITE_DAMAGE, RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE, RATE_CREATURE_ELITE_RARE_DAMAGE, RATE_CREATURE_NORMAL_SPELLDAMAGE,
  RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE, RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE, RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE, RATE_CREATURE_ELITE_RARE_SPELLDAMAGE,
  RATE_CREATURE_AGGRO, RATE_REST_INGAME, RATE_REST_OFFLINE_IN_TAVERN_OR_CITY, RATE_REST_OFFLINE_IN_WILDERNESS,
  RATE_DAMAGE_FALL, RATE_AUCTION_TIME, RATE_AUCTION_DEPOSIT, RATE_AUCTION_CUT,
  RATE_HONOR, RATE_TALENT, RATE_CORPSE_DECAY_LOOTED, RATE_INSTANCE_RESET_TIME,
  RATE_TARGET_POS_RECALCULATION_RANGE, RATE_DURABILITY_LOSS_ON_DEATH, RATE_DURABILITY_LOSS_DAMAGE, RATE_DURABILITY_LOSS_PARRY,
  RATE_DURABILITY_LOSS_ABSORB, RATE_DURABILITY_LOSS_BLOCK, RATE_MOVESPEED, RATE_MONEY_QUEST,
  RATE_MONEY_MAX_LEVEL_QUEST, MAX_RATES
}
 Server rates. More...
 
enum  RealmZone {
  REALM_ZONE_UNKNOWN = 0, REALM_ZONE_DEVELOPMENT = 1, REALM_ZONE_UNITED_STATES = 2, REALM_ZONE_OCEANIC = 3,
  REALM_ZONE_LATIN_AMERICA = 4, REALM_ZONE_TOURNAMENT_5 = 5, REALM_ZONE_KOREA = 6, REALM_ZONE_TOURNAMENT_7 = 7,
  REALM_ZONE_ENGLISH = 8, REALM_ZONE_GERMAN = 9, REALM_ZONE_FRENCH = 10, REALM_ZONE_SPANISH = 11,
  REALM_ZONE_RUSSIAN = 12, REALM_ZONE_TOURNAMENT_13 = 13, REALM_ZONE_TAIWAN = 14, REALM_ZONE_TOURNAMENT_15 = 15,
  REALM_ZONE_CHINA = 16, REALM_ZONE_CN1 = 17, REALM_ZONE_CN2 = 18, REALM_ZONE_CN3 = 19,
  REALM_ZONE_CN4 = 20, REALM_ZONE_CN5 = 21, REALM_ZONE_CN6 = 22, REALM_ZONE_CN7 = 23,
  REALM_ZONE_CN8 = 24, REALM_ZONE_TOURNAMENT_25 = 25, REALM_ZONE_TEST_SERVER = 26, REALM_ZONE_TOURNAMENT_27 = 27,
  REALM_ZONE_QA_SERVER = 28, REALM_ZONE_CN9 = 29, REALM_ZONE_TEST_SERVER_2 = 30, REALM_ZONE_CN10 = 31,
  REALM_ZONE_CTC = 32, REALM_ZONE_CNC = 33, REALM_ZONE_CN1_4 = 34, REALM_ZONE_CN2_6_9 = 35,
  REALM_ZONE_CN3_7 = 36, REALM_ZONE_CN5_8 = 37
}
 
enum  WorldStates {
  WS_WEEKLY_QUEST_RESET_TIME = 20002, WS_BG_DAILY_RESET_TIME = 20003, WS_CLEANING_FLAGS = 20004, WS_GUILD_DAILY_RESET_TIME = 20006,
  WS_MONTHLY_QUEST_RESET_TIME = 20007, WS_GUILD_WEEKLY_RESET_TIME = 20050
}
 

Functions

 Weather::Weather (uint32 zone, WeatherData const *weatherChances)
 Create the Weather object. More...
 
 Weather::~Weather ()
 
bool Weather::Update (uint32 diff)
 Launch a weather update. More...
 
bool Weather::ReGenerate ()
 Calculate the new weather. More...
 
bool Weather::UpdateWeather ()
 Send the new weather to all players in the zone. More...
 
void Weather::SendWeatherUpdateToPlayer (Player *player)
 
void Weather::SetWeather (WeatherType type, float grade)
 Set the weather. More...
 
uint32 Weather::GetZone () const
 For which zone is this weather? More...
 
uint32 Weather::GetScriptId () const
 
WeatherState Weather::GetWeatherState () const
 Get the sound number associated with the current weather. More...
 
void WeatherMgr::LoadWeatherData ()
 
WeatherWeatherMgr::FindWeather (uint32 id)
 Find a Weather object by the given zoneid. More...
 
WeatherWeatherMgr::AddWeather (uint32 zone_id)
 Add a Weather object to the list. More...
 
void WeatherMgr::RemoveWeather (uint32 id)
 Remove a Weather object for the given zoneid. More...
 
void WeatherMgr::SendFineWeatherUpdateToPlayer (Player *player)
 
void WeatherMgr::Update (uint32 diff)
 
TC_GAME_API uint32 GetVirtualRealmAddress ()
 

Variables

uint32 WeatherSeasonChances::rainChance
 
uint32 WeatherSeasonChances::snowChance
 
uint32 WeatherSeasonChances::stormChance
 
WeatherSeasonChances WeatherData::data [WEATHER_SEASONS]
 
uint32 WeatherData::ScriptId
 
uint32 Weather::m_zone
 
WeatherType Weather::m_type
 
float Weather::m_grade
 
IntervalTimer Weather::m_timer
 
WeatherData constWeather::m_weatherChances
 
TC_GAME_API Realm realm
 

Detailed Description

Macro Definition Documentation

#define MAX_CHARACTERS_PER_REALM   11
#define sWorld   World::instance()
#define WEATHER_SEASONS   4

Typedef Documentation

typedef std::unordered_map<uint32, WorldSession*> SessionMap

Enumeration Type Documentation

enum Rates

Server rates.

Enumerator
RATE_HEALTH 
RATE_POWER_MANA 
RATE_POWER_RAGE_INCOME 
RATE_POWER_RAGE_LOSS 
RATE_POWER_RUNICPOWER_INCOME 
RATE_POWER_RUNICPOWER_LOSS 
RATE_POWER_FOCUS 
RATE_POWER_ENERGY 
RATE_SKILL_DISCOVERY 
RATE_DROP_ITEM_POOR 
RATE_DROP_ITEM_NORMAL 
RATE_DROP_ITEM_UNCOMMON 
RATE_DROP_ITEM_RARE 
RATE_DROP_ITEM_EPIC 
RATE_DROP_ITEM_LEGENDARY 
RATE_DROP_ITEM_ARTIFACT 
RATE_DROP_ITEM_REFERENCED 
RATE_DROP_ITEM_REFERENCED_AMOUNT 
RATE_DROP_MONEY 
RATE_XP_KILL 
RATE_XP_BG_KILL 
RATE_XP_QUEST 
RATE_XP_GUILD_MODIFIER 
RATE_XP_EXPLORE 
RATE_REPAIRCOST 
RATE_REPUTATION_GAIN 
RATE_REPUTATION_LOWLEVEL_KILL 
RATE_REPUTATION_LOWLEVEL_QUEST 
RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS 
RATE_CREATURE_NORMAL_HP 
RATE_CREATURE_ELITE_ELITE_HP 
RATE_CREATURE_ELITE_RAREELITE_HP 
RATE_CREATURE_ELITE_WORLDBOSS_HP 
RATE_CREATURE_ELITE_RARE_HP 
RATE_CREATURE_NORMAL_DAMAGE 
RATE_CREATURE_ELITE_ELITE_DAMAGE 
RATE_CREATURE_ELITE_RAREELITE_DAMAGE 
RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE 
RATE_CREATURE_ELITE_RARE_DAMAGE 
RATE_CREATURE_NORMAL_SPELLDAMAGE 
RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE 
RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE 
RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE 
RATE_CREATURE_ELITE_RARE_SPELLDAMAGE 
RATE_CREATURE_AGGRO 
RATE_REST_INGAME 
RATE_REST_OFFLINE_IN_TAVERN_OR_CITY 
RATE_REST_OFFLINE_IN_WILDERNESS 
RATE_DAMAGE_FALL 
RATE_AUCTION_TIME 
RATE_AUCTION_DEPOSIT 
RATE_AUCTION_CUT 
RATE_HONOR 
RATE_TALENT 
RATE_CORPSE_DECAY_LOOTED 
RATE_INSTANCE_RESET_TIME 
RATE_TARGET_POS_RECALCULATION_RANGE 
RATE_DURABILITY_LOSS_ON_DEATH 
RATE_DURABILITY_LOSS_DAMAGE 
RATE_DURABILITY_LOSS_PARRY 
RATE_DURABILITY_LOSS_ABSORB 
RATE_DURABILITY_LOSS_BLOCK 
RATE_MOVESPEED 
RATE_MONEY_QUEST 
RATE_MONEY_MAX_LEVEL_QUEST 
MAX_RATES 
382 {
383  RATE_HEALTH = 0,
402  RATE_XP_KILL,
435  RATE_HONOR,
436  RATE_TALENT,
448  MAX_RATES
449 };
Definition: World.h:440
Definition: World.h:392
Definition: World.h:393
Definition: World.h:416
Definition: World.h:427
Definition: World.h:412
Definition: World.h:421
Definition: World.h:403
Definition: World.h:415
Definition: World.h:410
Definition: World.h:385
Definition: World.h:441
Definition: World.h:437
Definition: World.h:386
Definition: World.h:434
Definition: World.h:398
Definition: World.h:397
Definition: World.h:413
Definition: World.h:407
Definition: World.h:400
Definition: World.h:394
Definition: World.h:401
Definition: World.h:399
Definition: World.h:446
Definition: World.h:445
Definition: World.h:436
Definition: World.h:443
Definition: World.h:390
Definition: World.h:435
Definition: World.h:402
Definition: World.h:406
Definition: World.h:433
Definition: World.h:432
Definition: World.h:388
Definition: World.h:408
Definition: World.h:384
Definition: World.h:404
Definition: World.h:417
Definition: World.h:387
Definition: World.h:442
Definition: World.h:428
Definition: World.h:396
Definition: World.h:414
Definition: World.h:438
Definition: World.h:395
Definition: World.h:383
Definition: World.h:405
Definition: World.h:391
Definition: World.h:447
Definition: World.h:448
Definition: World.h:430
Definition: World.h:409
Definition: World.h:418
Definition: World.h:389
Definition: World.h:422
Definition: World.h:444
Definition: World.h:431
enum RealmZone
Enumerator
REALM_ZONE_UNKNOWN 
REALM_ZONE_DEVELOPMENT 
REALM_ZONE_UNITED_STATES 
REALM_ZONE_OCEANIC 
REALM_ZONE_LATIN_AMERICA 
REALM_ZONE_TOURNAMENT_5 
REALM_ZONE_KOREA 
REALM_ZONE_TOURNAMENT_7 
REALM_ZONE_ENGLISH 
REALM_ZONE_GERMAN 
REALM_ZONE_FRENCH 
REALM_ZONE_SPANISH 
REALM_ZONE_RUSSIAN 
REALM_ZONE_TOURNAMENT_13 
REALM_ZONE_TAIWAN 
REALM_ZONE_TOURNAMENT_15 
REALM_ZONE_CHINA 
REALM_ZONE_CN1 
REALM_ZONE_CN2 
REALM_ZONE_CN3 
REALM_ZONE_CN4 
REALM_ZONE_CN5 
REALM_ZONE_CN6 
REALM_ZONE_CN7 
REALM_ZONE_CN8 
REALM_ZONE_TOURNAMENT_25 
REALM_ZONE_TEST_SERVER 
REALM_ZONE_TOURNAMENT_27 
REALM_ZONE_QA_SERVER 
REALM_ZONE_CN9 
REALM_ZONE_TEST_SERVER_2 
REALM_ZONE_CN10 
REALM_ZONE_CTC 
REALM_ZONE_CNC 
REALM_ZONE_CN1_4 
REALM_ZONE_CN2_6_9 
REALM_ZONE_CN3_7 
REALM_ZONE_CN5_8 
452 {
453  REALM_ZONE_UNKNOWN = 0, // any language
454  REALM_ZONE_DEVELOPMENT = 1, // any language
455  REALM_ZONE_UNITED_STATES = 2, // extended-Latin
456  REALM_ZONE_OCEANIC = 3, // extended-Latin
457  REALM_ZONE_LATIN_AMERICA = 4, // extended-Latin
458  REALM_ZONE_TOURNAMENT_5 = 5, // basic-Latin at create, any at login
459  REALM_ZONE_KOREA = 6, // East-Asian
460  REALM_ZONE_TOURNAMENT_7 = 7, // basic-Latin at create, any at login
461  REALM_ZONE_ENGLISH = 8, // extended-Latin
462  REALM_ZONE_GERMAN = 9, // extended-Latin
463  REALM_ZONE_FRENCH = 10, // extended-Latin
464  REALM_ZONE_SPANISH = 11, // extended-Latin
465  REALM_ZONE_RUSSIAN = 12, // Cyrillic
466  REALM_ZONE_TOURNAMENT_13 = 13, // basic-Latin at create, any at login
467  REALM_ZONE_TAIWAN = 14, // East-Asian
468  REALM_ZONE_TOURNAMENT_15 = 15, // basic-Latin at create, any at login
469  REALM_ZONE_CHINA = 16, // East-Asian
470  REALM_ZONE_CN1 = 17, // basic-Latin at create, any at login
471  REALM_ZONE_CN2 = 18, // basic-Latin at create, any at login
472  REALM_ZONE_CN3 = 19, // basic-Latin at create, any at login
473  REALM_ZONE_CN4 = 20, // basic-Latin at create, any at login
474  REALM_ZONE_CN5 = 21, // basic-Latin at create, any at login
475  REALM_ZONE_CN6 = 22, // basic-Latin at create, any at login
476  REALM_ZONE_CN7 = 23, // basic-Latin at create, any at login
477  REALM_ZONE_CN8 = 24, // basic-Latin at create, any at login
478  REALM_ZONE_TOURNAMENT_25 = 25, // basic-Latin at create, any at login
479  REALM_ZONE_TEST_SERVER = 26, // any language
480  REALM_ZONE_TOURNAMENT_27 = 27, // basic-Latin at create, any at login
481  REALM_ZONE_QA_SERVER = 28, // any language
482  REALM_ZONE_CN9 = 29, // basic-Latin at create, any at login
483  REALM_ZONE_TEST_SERVER_2 = 30, // any language
484  REALM_ZONE_CN10 = 31, // basic-Latin at create, any at login
485  REALM_ZONE_CTC = 32,
486  REALM_ZONE_CNC = 33,
487  REALM_ZONE_CN1_4 = 34, // basic-Latin at create, any at login
488  REALM_ZONE_CN2_6_9 = 35, // basic-Latin at create, any at login
489  REALM_ZONE_CN3_7 = 36, // basic-Latin at create, any at login
490  REALM_ZONE_CN5_8 = 37 // basic-Latin at create, any at login
491 };
Definition: World.h:473
Definition: World.h:482
Definition: World.h:476
Definition: World.h:488
Definition: World.h:453
Definition: World.h:478
Definition: World.h:457
Definition: World.h:456
Definition: World.h:481
Definition: World.h:477
Definition: World.h:458
Definition: World.h:465
Definition: World.h:484
Definition: World.h:486
Definition: World.h:490
Definition: World.h:461
Definition: World.h:485
Definition: World.h:463
Definition: World.h:480
Definition: World.h:455
Definition: World.h:454
Definition: World.h:479
Definition: World.h:468
Definition: World.h:460
Definition: World.h:467
Definition: World.h:483
Definition: World.h:487
Definition: World.h:474
Definition: World.h:472
Definition: World.h:464
Definition: World.h:459
Definition: World.h:469
Definition: World.h:462
Definition: World.h:466
Definition: World.h:489
Definition: World.h:471
Definition: World.h:475
Definition: World.h:470
Enumerator
SERVER_MSG_SHUTDOWN_TIME 
SERVER_MSG_RESTART_TIME 
SERVER_MSG_STRING 
SERVER_MSG_SHUTDOWN_CANCELLED 
SERVER_MSG_RESTART_CANCELLED 
SERVER_MSG_BG_SHUTDOWN_TIME 
SERVER_MSG_BG_RESTART_TIME 
SERVER_MSG_INSTANCE_SHUTDOWN_TIME 
SERVER_MSG_INSTANCE_RESTART_TIME 
SERVER_MSG_CONTENT_READY 
SERVER_MSG_TICKET_SERVICED_SOON 
SERVER_MSG_WAIT_TIME_UNAVAILABLE 
SERVER_MSG_TICKET_WAIT_TIME 
Enumerator
SHUTDOWN_EXIT_CODE 
ERROR_EXIT_CODE 
RESTART_EXIT_CODE 
72 {
74  ERROR_EXIT_CODE = 1,
76 };
Definition: World.h:74
Definition: World.h:73
Definition: World.h:75
Enumerator
SHUTDOWN_MASK_RESTART 
SHUTDOWN_MASK_IDLE 
66 {
69 };
Definition: World.h:67
Definition: World.h:68
Enumerator
WEATHER_STATE_FINE 
WEATHER_STATE_FOG 
WEATHER_STATE_LIGHT_RAIN 
WEATHER_STATE_MEDIUM_RAIN 
WEATHER_STATE_HEAVY_RAIN 
WEATHER_STATE_LIGHT_SNOW 
WEATHER_STATE_MEDIUM_SNOW 
WEATHER_STATE_HEAVY_SNOW 
WEATHER_STATE_LIGHT_SANDSTORM 
WEATHER_STATE_MEDIUM_SANDSTORM 
WEATHER_STATE_HEAVY_SANDSTORM 
WEATHER_STATE_THUNDERS 
WEATHER_STATE_BLACKRAIN 
WEATHER_STATE_BLACKSNOW 
46  : uint32
47 {
49  WEATHER_STATE_FOG = 1, // Used in some instance encounters.
62 };
Definition: Weather.h:49
Definition: Weather.h:60
Definition: Weather.h:57
Definition: Weather.h:53
Definition: Weather.h:59
Definition: Weather.h:55
Definition: Weather.h:52
Definition: Weather.h:48
uint32_t uint32
Definition: Define.h:150
Definition: Weather.h:54
Definition: Weather.h:61
Definition: Weather.h:51
Definition: Weather.h:50
Definition: Weather.h:56
Definition: Weather.h:58

Configuration elements.

Enumerator
CONFIG_DURABILITY_LOSS_IN_PVP 
CONFIG_ADDON_CHANNEL 
CONFIG_ALLOW_PLAYER_COMMANDS 
CONFIG_CLEAN_CHARACTER_DB 
CONFIG_GRID_UNLOAD 
CONFIG_STATS_SAVE_ONLY_ON_LOGOUT 
CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR 
CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL 
CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP 
CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD 
CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION 
CONFIG_ALLOW_TWO_SIDE_TRADE 
CONFIG_ALL_TAXI_PATHS 
CONFIG_INSTANT_TAXI 
CONFIG_INSTANCE_IGNORE_LEVEL 
CONFIG_INSTANCE_IGNORE_RAID 
CONFIG_CAST_UNSTUCK 
CONFIG_ALLOW_GM_GROUP 
CONFIG_GM_LOWER_SECURITY 
CONFIG_SKILL_PROSPECTING 
CONFIG_SKILL_MILLING 
CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY 
CONFIG_WEATHER 
CONFIG_QUEST_IGNORE_RAID 
CONFIG_DETECT_POS_COLLISION 
CONFIG_RESTRICTED_LFG_CHANNEL 
CONFIG_TALENTS_INSPECTING 
CONFIG_CHAT_FAKE_MESSAGE_PREVENTING 
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP 
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE 
CONFIG_DEATH_BONES_WORLD 
CONFIG_DEATH_BONES_BG_OR_ARENA 
CONFIG_DIE_COMMAND_MODE 
CONFIG_DECLINED_NAMES_USED 
CONFIG_BATTLEGROUND_CAST_DESERTER 
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE 
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY 
CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE 
CONFIG_BG_XP_FOR_KILL 
CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE 
CONFIG_ARENA_SEASON_IN_PROGRESS 
CONFIG_ARENA_LOG_EXTENDED_INFO 
CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN 
CONFIG_VMAP_INDOOR_CHECK 
CONFIG_START_ALL_SPELLS 
CONFIG_START_ALL_EXPLORED 
CONFIG_START_ALL_REP 
CONFIG_ALWAYS_MAXSKILL 
CONFIG_PVP_TOKEN_ENABLE 
CONFIG_NO_RESET_TALENT_COST 
CONFIG_SHOW_KICK_IN_WORLD 
CONFIG_SHOW_MUTE_IN_WORLD 
CONFIG_SHOW_BAN_IN_WORLD 
CONFIG_AUTOBROADCAST 
CONFIG_SUPPORT_ENABLED 
CONFIG_SUPPORT_TICKETS_ENABLED 
CONFIG_SUPPORT_BUGS_ENABLED 
CONFIG_SUPPORT_COMPLAINTS_ENABLED 
CONFIG_SUPPORT_SUGGESTIONS_ENABLED 
CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES 
CONFIG_PRESERVE_CUSTOM_CHANNELS 
CONFIG_PDUMP_NO_PATHS 
CONFIG_PDUMP_NO_OVERWRITE 
CONFIG_QUEST_IGNORE_AUTO_ACCEPT 
CONFIG_QUEST_IGNORE_AUTO_COMPLETE 
CONFIG_QUEST_ENABLE_QUEST_TRACKER 
CONFIG_WARDEN_ENABLED 
CONFIG_ENABLE_MMAPS 
CONFIG_WINTERGRASP_ENABLE 
CONFIG_UI_QUESTLEVELS_IN_DIALOGS 
CONFIG_EVENT_ANNOUNCE 
CONFIG_STATS_LIMITS_ENABLE 
CONFIG_INSTANCES_RESET_ANNOUNCE 
CONFIG_IP_BASED_ACTION_LOGGING 
CONFIG_ALLOW_TRACK_BOTH_RESOURCES 
CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA 
CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA 
CONFIG_FEATURE_SYSTEM_BPAY_STORE_ENABLED 
CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED 
CONFIG_RESET_DUEL_COOLDOWNS 
CONFIG_RESET_DUEL_HEALTH_MANA 
BOOL_CONFIG_VALUE_COUNT 
99 {
169  CONFIG_UI_QUESTLEVELS_IN_DIALOGS, // Should we add quest levels to the title in the NPC dialogs?
182 };
Definition: World.h:122
Definition: World.h:157
Definition: World.h:111
Definition: World.h:117
Definition: World.h:144
Definition: World.h:166
Definition: World.h:159
Definition: World.h:153
Definition: World.h:143
Definition: World.h:133
Definition: World.h:149
Definition: World.h:138
Definition: World.h:155
Definition: World.h:152
Definition: World.h:162
Definition: World.h:180
Definition: World.h:104
Definition: World.h:123
Definition: World.h:102
Definition: World.h:140
Definition: World.h:113
Definition: World.h:134
Definition: World.h:163
Definition: World.h:147
Definition: World.h:168
Definition: World.h:124
Definition: World.h:174
Definition: World.h:112
Definition: World.h:130
Definition: World.h:165
Definition: World.h:170
Definition: World.h:160
Definition: World.h:150
Definition: World.h:105
Definition: World.h:119
Definition: World.h:115
Definition: World.h:151
Definition: World.h:171
Definition: World.h:181
Definition: World.h:158
Definition: World.h:103
Definition: World.h:161
Definition: World.h:114
Definition: World.h:172
Definition: World.h:145
Definition: World.h:118
Definition: World.h:167
Definition: World.h:125
Definition: World.h:126
Definition: World.h:120
Definition: World.h:148
Definition: World.h:116
Definition: World.h:173
Definition: World.h:141
Definition: World.h:132
Definition: World.h:101
Definition: World.h:100
Definition: World.h:179
Definition: World.h:164
Definition: World.h:131
Definition: World.h:154
Definition: World.h:169
Definition: World.h:146
Definition: World.h:156
Enumerator
CONFIG_GROUP_XP_DISTANCE 
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE 
CONFIG_SIGHT_MONSTER 
CONFIG_SIGHT_GUARDER 
CONFIG_LISTEN_RANGE_SAY 
CONFIG_LISTEN_RANGE_TEXTEMOTE 
CONFIG_LISTEN_RANGE_YELL 
CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS 
CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS 
CONFIG_THREAT_RADIUS 
CONFIG_STATS_LIMITS_DODGE 
CONFIG_STATS_LIMITS_PARRY 
CONFIG_STATS_LIMITS_BLOCK 
CONFIG_STATS_LIMITS_CRIT 
CONFIG_ARENA_WIN_RATING_MODIFIER_1 
CONFIG_ARENA_WIN_RATING_MODIFIER_2 
CONFIG_ARENA_LOSE_RATING_MODIFIER 
CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER 
FLOAT_CONFIG_VALUE_COUNT 
185 {
205 };
Definition: World.h:186
Definition: World.h:190
Definition: World.h:188
Definition: World.h:197
Definition: World.h:202
Definition: World.h:198
Definition: World.h:201
Definition: World.h:204
Definition: World.h:195
Definition: World.h:196
Definition: World.h:191
Definition: World.h:192
Definition: World.h:199
Definition: World.h:189
Definition: World.h:200
Enumerator
CONFIG_COMPRESSION 
CONFIG_INTERVAL_SAVE 
CONFIG_INTERVAL_GRIDCLEAN 
CONFIG_INTERVAL_MAPUPDATE 
CONFIG_INTERVAL_CHANGEWEATHER 
CONFIG_INTERVAL_DISCONNECT_TOLERANCE 
CONFIG_PORT_WORLD 
CONFIG_PORT_INSTANCE 
CONFIG_SOCKET_TIMEOUTTIME 
CONFIG_SESSION_ADD_DELAY 
CONFIG_GAME_TYPE 
CONFIG_REALM_ZONE 
CONFIG_STRICT_PLAYER_NAMES 
CONFIG_STRICT_CHARTER_NAMES 
CONFIG_STRICT_PET_NAMES 
CONFIG_MIN_PLAYER_NAME 
CONFIG_MIN_CHARTER_NAME 
CONFIG_MIN_PET_NAME 
CONFIG_CHARACTER_CREATING_DISABLED 
CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK 
CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK 
CONFIG_CHARACTERS_PER_ACCOUNT 
CONFIG_CHARACTERS_PER_REALM 
CONFIG_HEROIC_CHARACTERS_PER_REALM 
CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER 
CONFIG_SKIP_CINEMATICS 
CONFIG_MAX_PLAYER_LEVEL 
CONFIG_MIN_DUALSPEC_LEVEL 
CONFIG_START_PLAYER_LEVEL 
CONFIG_START_HEROIC_PLAYER_LEVEL 
CONFIG_START_PLAYER_MONEY 
CONFIG_CURRENCY_START_APEXIS_CRYSTALS 
CONFIG_CURRENCY_MAX_APEXIS_CRYSTALS 
CONFIG_CURRENCY_START_JUSTICE_POINTS 
CONFIG_CURRENCY_MAX_JUSTICE_POINTS 
CONFIG_CURRENCY_START_HONOR_POINTS 
CONFIG_CURRENCY_MAX_HONOR_POINTS 
CONFIG_CURRENCY_START_CONQUEST_POINTS 
CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP 
CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD 
CONFIG_CURRENCY_RESET_HOUR 
CONFIG_CURRENCY_RESET_DAY 
CONFIG_CURRENCY_RESET_INTERVAL 
CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL 
CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE 
CONFIG_INSTANCE_RESET_TIME_HOUR 
CONFIG_INSTANCE_UNLOAD_DELAY 
CONFIG_MAX_PRIMARY_TRADE_SKILL 
CONFIG_MIN_PETITION_SIGNS 
CONFIG_GM_LOGIN_STATE 
CONFIG_GM_VISIBLE_STATE 
CONFIG_GM_CHAT 
CONFIG_GM_WHISPERING_TO 
CONFIG_GM_FREEZE_DURATION 
CONFIG_GM_LEVEL_IN_GM_LIST 
CONFIG_GM_LEVEL_IN_WHO_LIST 
CONFIG_START_GM_LEVEL 
CONFIG_GROUP_VISIBILITY 
CONFIG_MAIL_DELIVERY_DELAY 
CONFIG_UPTIME_UPDATE 
CONFIG_SKILL_CHANCE_ORANGE 
CONFIG_SKILL_CHANCE_YELLOW 
CONFIG_SKILL_CHANCE_GREEN 
CONFIG_SKILL_CHANCE_GREY 
CONFIG_SKILL_CHANCE_MINING_STEPS 
CONFIG_SKILL_CHANCE_SKINNING_STEPS 
CONFIG_SKILL_GAIN_CRAFTING 
CONFIG_SKILL_GAIN_GATHERING 
CONFIG_MAX_OVERSPEED_PINGS 
CONFIG_EXPANSION 
CONFIG_CHATFLOOD_MESSAGE_COUNT 
CONFIG_CHATFLOOD_MESSAGE_DELAY 
CONFIG_CHATFLOOD_MUTE_TIME 
CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY 
CONFIG_CREATURE_FAMILY_FLEE_DELAY 
CONFIG_WORLD_BOSS_LEVEL_DIFF 
CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF 
CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF 
CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY 
CONFIG_CHAT_STRICT_LINK_CHECKING_KICK 
CONFIG_CHAT_CHANNEL_LEVEL_REQ 
CONFIG_CHAT_WHISPER_LEVEL_REQ 
CONFIG_CHAT_SAY_LEVEL_REQ 
CONFIG_TRADE_LEVEL_REQ 
CONFIG_AUCTION_LEVEL_REQ 
CONFIG_MAIL_LEVEL_REQ 
CONFIG_CORPSE_DECAY_NORMAL 
CONFIG_CORPSE_DECAY_RARE 
CONFIG_CORPSE_DECAY_ELITE 
CONFIG_CORPSE_DECAY_RAREELITE 
CONFIG_CORPSE_DECAY_WORLDBOSS 
CONFIG_DEATH_SICKNESS_LEVEL 
CONFIG_INSTANT_LOGOUT 
CONFIG_DISABLE_BREATHING 
CONFIG_BATTLEGROUND_INVITATION_TYPE 
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER 
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH 
CONFIG_ARENA_MAX_RATING_DIFFERENCE 
CONFIG_ARENA_RATING_DISCARD_TIMER 
CONFIG_ARENA_RATED_UPDATE_TIMER 
CONFIG_ARENA_SEASON_ID 
CONFIG_ARENA_START_RATING 
CONFIG_ARENA_START_PERSONAL_RATING 
CONFIG_ARENA_START_MATCHMAKER_RATING 
CONFIG_MAX_WHO 
CONFIG_HONOR_AFTER_DUEL 
CONFIG_PVP_TOKEN_MAP_TYPE 
CONFIG_PVP_TOKEN_ID 
CONFIG_PVP_TOKEN_COUNT 
CONFIG_INTERVAL_LOG_UPDATE 
CONFIG_MIN_LOG_UPDATE 
CONFIG_ENABLE_SINFO_LOGIN 
CONFIG_PLAYER_ALLOW_COMMANDS 
CONFIG_NUMTHREADS 
CONFIG_LOGDB_CLEARINTERVAL 
CONFIG_LOGDB_CLEARTIME 
CONFIG_CLIENTCACHE_VERSION 
CONFIG_GUILD_NEWS_LOG_COUNT 
CONFIG_GUILD_EVENT_LOG_COUNT 
CONFIG_GUILD_BANK_EVENT_LOG_COUNT 
CONFIG_MIN_LEVEL_STAT_SAVE 
CONFIG_RANDOM_BG_RESET_HOUR 
CONFIG_GUILD_RESET_HOUR 
CONFIG_CHARDELETE_KEEP_DAYS 
CONFIG_CHARDELETE_METHOD 
CONFIG_CHARDELETE_MIN_LEVEL 
CONFIG_CHARDELETE_HEROIC_MIN_LEVEL 
CONFIG_AUTOBROADCAST_CENTER 
CONFIG_AUTOBROADCAST_INTERVAL 
CONFIG_MAX_RESULTS_LOOKUP_COMMANDS 
CONFIG_DB_PING_INTERVAL 
CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION 
CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS 
CONFIG_LFG_OPTIONSMASK 
CONFIG_MAX_INSTANCES_PER_HOUR 
CONFIG_WARDEN_CLIENT_RESPONSE_DELAY 
CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF 
CONFIG_WARDEN_CLIENT_FAIL_ACTION 
CONFIG_WARDEN_CLIENT_BAN_DURATION 
CONFIG_WARDEN_NUM_MEM_CHECKS 
CONFIG_WARDEN_NUM_OTHER_CHECKS 
CONFIG_WINTERGRASP_PLR_MAX 
CONFIG_WINTERGRASP_PLR_MIN 
CONFIG_WINTERGRASP_PLR_MIN_LVL 
CONFIG_WINTERGRASP_BATTLETIME 
CONFIG_WINTERGRASP_NOBATTLETIME 
CONFIG_WINTERGRASP_RESTART_AFTER_CRASH 
CONFIG_GUILD_SAVE_INTERVAL 
CONFIG_GUILD_UNDELETABLE_LEVEL 
CONFIG_PACKET_SPOOF_POLICY 
CONFIG_PACKET_SPOOF_BANMODE 
CONFIG_PACKET_SPOOF_BANDURATION 
CONFIG_ACC_PASSCHANGESEC 
CONFIG_BG_REWARD_WINNER_HONOR_FIRST 
CONFIG_BG_REWARD_WINNER_HONOR_LAST 
CONFIG_BG_REWARD_LOSER_HONOR_FIRST 
CONFIG_BG_REWARD_LOSER_HONOR_LAST 
CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST 
CONFIG_BG_REWARD_WINNER_CONQUEST_LAST 
CONFIG_CREATURE_PICKPOCKET_REFILL 
CONFIG_AHBOT_UPDATE_INTERVAL 
CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_COOLDOWN 
CONFIG_CHARTER_COST_GUILD 
CONFIG_CHARTER_COST_ARENA_2v2 
CONFIG_CHARTER_COST_ARENA_3v3 
CONFIG_CHARTER_COST_ARENA_5v5 
CONFIG_NO_GRAY_AGGRO_ABOVE 
CONFIG_NO_GRAY_AGGRO_BELOW 
INT_CONFIG_VALUE_COUNT 
208 {
209  CONFIG_COMPRESSION = 0,
378 };
Definition: World.h:307
Definition: World.h:310
Definition: World.h:255
Definition: World.h:277
Definition: World.h:256
Definition: World.h:315
Definition: World.h:296
Definition: World.h:234
Definition: World.h:275
Definition: World.h:330
Definition: World.h:294
Definition: World.h:337
Definition: World.h:363
Definition: World.h:327
Definition: World.h:350
Definition: World.h:254
Definition: World.h:313
Definition: World.h:265
Definition: World.h:358
Definition: World.h:368
Definition: World.h:356
Definition: World.h:281
Definition: World.h:375
Definition: World.h:332
Definition: World.h:349
Definition: World.h:216
Definition: World.h:329
Definition: World.h:321
Definition: World.h:346
Definition: World.h:271
Definition: World.h:224
Definition: World.h:219
Definition: World.h:220
Definition: World.h:318
Definition: World.h:266
Definition: World.h:371
Definition: World.h:257
Definition: World.h:285
Definition: World.h:286
Definition: World.h:225
Definition: World.h:364
Definition: World.h:258
Definition: World.h:334
Definition: World.h:262
Definition: World.h:284
Definition: World.h:377
Definition: World.h:326
Definition: World.h:372
Definition: World.h:213
Definition: World.h:336
Definition: World.h:270
Definition: World.h:335
Definition: World.h:338
Definition: World.h:297
Definition: World.h:339
Definition: World.h:316
Definition: World.h:226
Definition: World.h:250
Definition: World.h:290
Definition: World.h:328
Definition: World.h:348
Definition: World.h:376
Definition: World.h:259
Definition: World.h:342
Definition: World.h:243
Definition: World.h:331
Definition: World.h:317
Definition: World.h:283
Definition: World.h:357
Definition: World.h:309
Definition: World.h:244
Definition: World.h:311
Definition: World.h:302
Definition: World.h:279
Definition: World.h:306
Definition: World.h:323
Definition: World.h:276
Definition: World.h:274
Definition: World.h:230
Definition: World.h:300
Definition: World.h:353
Definition: World.h:245
Definition: World.h:267
Definition: World.h:273
Definition: World.h:261
Definition: World.h:325
Definition: World.h:298
Definition: World.h:223
Definition: World.h:343
Definition: World.h:365
Definition: World.h:215
Definition: World.h:218
Definition: World.h:251
Definition: World.h:237
Definition: World.h:249
Definition: World.h:227
Definition: World.h:293
Definition: World.h:264
Definition: World.h:278
Definition: World.h:324
Definition: World.h:269
Definition: World.h:369
Definition: World.h:345
Definition: World.h:239
Definition: World.h:319
Definition: World.h:280
Definition: World.h:333
Definition: World.h:238
Definition: World.h:373
Definition: World.h:291
Definition: World.h:210
Definition: World.h:221
Definition: World.h:308
Definition: World.h:374
Definition: World.h:217
Definition: World.h:347
Definition: World.h:320
Definition: World.h:295
Definition: World.h:222
Definition: World.h:268
Definition: World.h:351
Definition: World.h:211
Definition: World.h:292
Definition: World.h:231
Definition: World.h:354
Definition: World.h:272
Definition: World.h:314
Definition: World.h:235
Definition: World.h:299
Definition: World.h:359
Definition: World.h:263
Definition: World.h:360
Definition: World.h:289
Definition: World.h:209
Definition: World.h:352
Definition: World.h:301
Definition: World.h:236
Definition: World.h:212
Definition: World.h:322
Definition: World.h:232
Definition: World.h:361
Definition: World.h:260
Enumerator
WS_WEEKLY_QUEST_RESET_TIME 
WS_BG_DAILY_RESET_TIME 
WS_CLEANING_FLAGS 
WS_GUILD_DAILY_RESET_TIME 
WS_MONTHLY_QUEST_RESET_TIME 
WS_GUILD_WEEKLY_RESET_TIME 
494 {
495  WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time
496  WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time
497  WS_CLEANING_FLAGS = 20004, // Cleaning Flags
498  WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time
499  WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time
500  // Cata specific custom worldstates
501  WS_GUILD_WEEKLY_RESET_TIME = 20050, // Next guild week reset time
502 };
Definition: World.h:499
Definition: World.h:496
Definition: World.h:495
Definition: World.h:498
Definition: World.h:501
Definition: World.h:497

Timers for different object refresh rates.

Enumerator
WUPDATE_AUCTIONS 
WUPDATE_AUCTIONS_PENDING 
WUPDATE_WEATHERS 
WUPDATE_UPTIME 
WUPDATE_CORPSES 
WUPDATE_EVENTS 
WUPDATE_CLEANDB 
WUPDATE_AUTOBROADCAST 
WUPDATE_MAILBOXQUEUE 
WUPDATE_DELETECHARS 
WUPDATE_AHBOT 
WUPDATE_PINGDB 
WUPDATE_GUILDSAVE 
WUPDATE_COUNT 
80 {
95 };
Definition: World.h:83
Definition: World.h:92
Definition: World.h:89
Definition: World.h:93
Definition: World.h:81
Definition: World.h:91
Definition: World.h:88
Definition: World.h:87
Definition: World.h:90
Definition: World.h:85
Definition: World.h:94
Definition: World.h:84
Definition: World.h:86
Definition: World.h:82

Function Documentation

TC_GAME_API Weather * WeatherMgr::AddWeather ( uint32  zone_id)

Add a Weather object to the list.

68 {
69  WeatherData const* weatherChances = GetWeatherData(zone_id);
70 
71  // zone does not have weather, ignore
72  if (!weatherChances)
73  return NULL;
74 
75  Weather* w = new Weather(zone_id, weatherChances);
76  m_weathers[w->GetZone()].reset(w);
77  w->ReGenerate();
78  w->UpdateWeather();
79 
80  return w;
81 }
bool UpdateWeather()
Send the new weather to all players in the zone.
Definition: Weather.cpp:201
arena_t NULL
Definition: jemalloc_internal.h:624
bool ReGenerate()
Calculate the new weather.
Definition: Weather.cpp:70
uint32 GetZone() const
For which zone is this weather?
Definition: Weather.h:80
Weather for one zone.
Definition: Weather.h:65
Definition: Weather.h:40

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TC_GAME_API Weather * WeatherMgr::FindWeather ( uint32  id)

Find a Weather object by the given zoneid.

51 {
52  WeatherMap::const_iterator itr = m_weathers.find(id);
53  return (itr != m_weathers.end()) ? itr->second.get() : nullptr;
54 }

+ Here is the caller graph for this function:

uint32 Weather::GetScriptId ( ) const
inline
81 { return m_weatherChances->ScriptId; }
uint32 ScriptId
Definition: Weather.h:43
WeatherData const * m_weatherChances
Definition: Weather.h:90

+ Here is the caller graph for this function:

TC_GAME_API uint32 GetVirtualRealmAddress ( )
3488 {
3489  return uint32(realm.Id.Region) << 24 | uint32(realm.Id.Site) << 16 | realm.Id.Realm;
3490 }
uint32 Realm
Definition: Realm.h:53
uint8 Region
Definition: Realm.h:51
Realm realm
Definition: World.cpp:3485
uint8 Site
Definition: Realm.h:52
Battlenet::RealmHandle Id
Definition: Realm.h:86
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the caller graph for this function:

WeatherState Weather::GetWeatherState ( ) const
private

Get the sound number associated with the current weather.

281 {
282  if (m_grade<0.27f)
283  return WEATHER_STATE_FINE;
284 
285  switch (m_type)
286  {
287  case WEATHER_TYPE_RAIN:
288  if (m_grade<0.40f)
290  else if (m_grade<0.70f)
292  else
294  case WEATHER_TYPE_SNOW:
295  if (m_grade<0.40f)
297  else if (m_grade<0.70f)
299  else
301  case WEATHER_TYPE_STORM:
302  if (m_grade<0.40f)
304  else if (m_grade<0.70f)
306  else
311  return WEATHER_STATE_THUNDERS;
312  case WEATHER_TYPE_FINE:
313  default:
314  return WEATHER_STATE_FINE;
315  }
316 }
Definition: SharedDefines.h:4220
Definition: Weather.h:60
Definition: Weather.h:57
Definition: Weather.h:53
Definition: Weather.h:59
Definition: Weather.h:55
Definition: SharedDefines.h:4222
Definition: Weather.h:52
WeatherType m_type
Definition: Weather.h:87
Definition: SharedDefines.h:4223
Definition: SharedDefines.h:4221
float m_grade
Definition: Weather.h:88
Definition: Weather.h:48
Definition: SharedDefines.h:4219
Definition: Weather.h:54
Definition: Weather.h:51
Definition: Weather.h:50
Definition: Weather.h:56
Definition: Weather.h:58
Definition: SharedDefines.h:4218

+ Here is the caller graph for this function:

uint32 Weather::GetZone ( ) const
inline

For which zone is this weather?

80 { return m_zone; };
uint32 m_zone
Definition: Weather.h:86

+ Here is the caller graph for this function:

TC_GAME_API void WeatherMgr::LoadWeatherData ( )
84 {
85  uint32 oldMSTime = getMSTime();
86 
87  uint32 count = 0;
88 
89  QueryResult result = WorldDatabase.Query("SELECT "
90  "zone, spring_rain_chance, spring_snow_chance, spring_storm_chance,"
91  "summer_rain_chance, summer_snow_chance, summer_storm_chance,"
92  "fall_rain_chance, fall_snow_chance, fall_storm_chance,"
93  "winter_rain_chance, winter_snow_chance, winter_storm_chance,"
94  "ScriptName FROM game_weather");
95 
96  if (!result)
97  {
98  TC_LOG_ERROR("server.loading", ">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
99  return;
100  }
101 
102  do
103  {
104  Field* fields = result->Fetch();
105 
106  uint32 zone_id = fields[0].GetUInt32();
107 
108  WeatherData& wzc = mWeatherZoneMap[zone_id];
109 
110  for (uint8 season = 0; season < WEATHER_SEASONS; ++season)
111  {
112  wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt8();
113  wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt8();
114  wzc.data[season].stormChance = fields[season * (MAX_WEATHER_TYPE-1) + 3].GetUInt8();
115 
116  if (wzc.data[season].rainChance > 100)
117  {
118  wzc.data[season].rainChance = 25;
119  TC_LOG_ERROR("sql.sql", "Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season);
120  }
121 
122  if (wzc.data[season].snowChance > 100)
123  {
124  wzc.data[season].snowChance = 25;
125  TC_LOG_ERROR("sql.sql", "Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season);
126  }
127 
128  if (wzc.data[season].stormChance > 100)
129  {
130  wzc.data[season].stormChance = 25;
131  TC_LOG_ERROR("sql.sql", "Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season);
132  }
133  }
134 
135  wzc.ScriptId = sObjectMgr->GetScriptId(fields[13].GetString());
136 
137  ++count;
138  }
139  while (result->NextRow());
140 
141  TC_LOG_INFO("server.loading", ">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
142 }
#define MAX_WEATHER_TYPE
Definition: SharedDefines.h:4226
WeatherSeasonChances data[WEATHER_SEASONS]
Definition: Weather.h:42
Class used to access individual fields of database query result.
Definition: Field.h:56
uint32 getMSTime()
Definition: Timer.h:24
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
uint32 ScriptId
Definition: Weather.h:43
#define sObjectMgr
Definition: ObjectMgr.h:1567
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
uint32 snowChance
Definition: Weather.h:36
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
uint32 GetUInt32() const
Definition: Field.h:146
uint8_t uint8
Definition: Define.h:152
uint32 stormChance
Definition: Weather.h:37
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
uint32 rainChance
Definition: Weather.h:35
#define WEATHER_SEASONS
Definition: Weather.h:32
Definition: Weather.h:40

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Weather::ReGenerate ( )

Calculate the new weather.

Weather statistics:

  • 30% - no change
  • 30% - weather gets better (if not fine) or change weather type
  • 30% - weather worsens (if not fine)
  • 10% - radical change (if not fine)

    Radical change:

  • if light -> heavy
  • if medium -> change weather type
  • if heavy -> 50% light, 50% change weather type

    New weather statistics (if not fine):

  • 85% light
  • 7% medium
  • 7% heavy If fine 100% sun (no fog)
71 {
72  if (!m_weatherChances)
73  {
75  m_grade = 0.0f;
76  return false;
77  }
78 
84  uint32 u = urand(0, 99);
85 
86  if (u < 30)
87  return false;
88 
89  // remember old values
90  WeatherType old_type = m_type;
91  float old_grade = m_grade;
92 
93  //78 days between January 1st and March 20nd; 365/4=91 days by season
94  // season source http://aa.usno.navy.mil/data/docs/EarthSeasons.html
95  time_t gtime = sWorld->GetGameTime();
96  struct tm ltime;
97  localtime_r(&gtime, &ltime);
98  uint32 season = ((ltime.tm_yday - 78 + 365) / 91) % 4;
99 
100  static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
101 
102  TC_LOG_INFO("misc", "Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
103 
104  if ((u < 60) && (m_grade < 0.33333334f)) // Get fair
105  {
107  m_grade = 0.0f;
108  }
109 
110  if ((u < 60) && (m_type != WEATHER_TYPE_FINE)) // Get better
111  {
112  m_grade -= 0.33333334f;
113  return true;
114  }
115 
116  if ((u < 90) && (m_type != WEATHER_TYPE_FINE)) // Get worse
117  {
118  m_grade += 0.33333334f;
119  return true;
120  }
121 
122  if (m_type != WEATHER_TYPE_FINE)
123  {
128 
129  if (m_grade < 0.33333334f)
130  {
131  m_grade = 0.9999f; // go nuts
132  return true;
133  }
134  else
135  {
136  if (m_grade > 0.6666667f)
137  {
138  // Severe change, but how severe?
139  uint32 rnd = urand(0, 99);
140  if (rnd < 50)
141  {
142  m_grade -= 0.6666667f;
143  return true;
144  }
145  }
146  m_type = WEATHER_TYPE_FINE; // clear up
147  m_grade = 0;
148  }
149  }
150 
151  // At this point, only weather that isn't doing anything remains but that have weather data
152  uint32 chance1 = m_weatherChances->data[season].rainChance;
153  uint32 chance2 = chance1 + m_weatherChances->data[season].snowChance;
154  uint32 chance3 = chance2 + m_weatherChances->data[season].stormChance;
155 
156  uint32 rnd = urand(1, 100);
157  if (rnd <= chance1)
159  else if (rnd <= chance2)
161  else if (rnd <= chance3)
163  else
165 
171 
172  if (m_type == WEATHER_TYPE_FINE)
173  {
174  m_grade = 0.0f;
175  }
176  else if (u < 90)
177  {
178  m_grade = (float)rand_norm() * 0.3333f;
179  }
180  else
181  {
182  // Severe change, but how severe?
183  rnd = urand(0, 99);
184  if (rnd < 50)
185  m_grade = (float)rand_norm() * 0.3333f + 0.3334f;
186  else
187  m_grade = (float)rand_norm() * 0.3333f + 0.6667f;
188  }
189 
190  // return true only in case weather changes
191  return m_type != old_type || m_grade != old_grade;
192 }
Definition: SharedDefines.h:4220
WeatherSeasonChances data[WEATHER_SEASONS]
Definition: Weather.h:42
#define sWorld
Definition: World.h:887
WeatherType m_type
Definition: Weather.h:87
Definition: SharedDefines.h:4221
float m_grade
Definition: Weather.h:88
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
WeatherData const * m_weatherChances
Definition: Weather.h:90
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:4219
uint32 snowChance
Definition: Weather.h:36
TC_COMMON_API struct tm * localtime_r(const time_t *time, struct tm *result)
double rand_norm()
Definition: Random.cpp:69
uint32 stormChance
Definition: Weather.h:37
WeatherType
Definition: SharedDefines.h:4216
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
uint32 m_zone
Definition: Weather.h:86
uint32 rainChance
Definition: Weather.h:35
Definition: SharedDefines.h:4218
#define WEATHER_SEASONS
Definition: Weather.h:32

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TC_GAME_API void WeatherMgr::RemoveWeather ( uint32  id)

Remove a Weather object for the given zoneid.

58 {
59  // not called at the moment. Kept for completeness
60  WeatherMap::iterator itr = m_weathers.find(id);
61 
62  if (itr != m_weathers.end())
63  m_weathers.erase(itr);
64 }
TC_GAME_API void WeatherMgr::SendFineWeatherUpdateToPlayer ( Player *  player)
145 {
147  player->GetSession()->SendPacket(weather.Write());
148 }
Definition: MiscPackets.h:400
Definition: Weather.h:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Weather::SendWeatherUpdateToPlayer ( Player player)
195 {
197  player->GetSession()->SendPacket(weather.Write());
198 }
Definition: MiscPackets.h:400
float m_grade
Definition: Weather.h:88
WeatherState GetWeatherState() const
Get the sound number associated with the current weather.
Definition: Weather.cpp:280

+ Here is the call graph for this function:

void Weather::SetWeather ( WeatherType  type,
float  grade 
)

Set the weather.

270 {
271  if (m_type == type && m_grade == grade)
272  return;
273 
274  m_type = type;
275  m_grade = grade;
276  UpdateWeather();
277 }
bool UpdateWeather()
Send the new weather to all players in the zone.
Definition: Weather.cpp:201
WeatherType m_type
Definition: Weather.h:87
float m_grade
Definition: Weather.h:88

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Weather::Update ( uint32  diff)

Launch a weather update.

  • If the timer has passed, ReGenerate the weather
  • Weather will be removed if not updated (no players in zone anymore)
46 {
47  if (m_timer.GetCurrent() >= 0)
48  m_timer.Update(diff);
49  else
51 
53  if (m_timer.Passed())
54  {
55  m_timer.Reset();
56  // update only if Regenerate has changed the weather
57  if (ReGenerate())
58  {
60  if (!UpdateWeather())
61  return false;
62  }
63  }
64 
65  sScriptMgr->OnWeatherUpdate(this, diff);
66  return true;
67 }
bool UpdateWeather()
Send the new weather to all players in the zone.
Definition: Weather.cpp:201
IntervalTimer m_timer
Definition: Weather.h:89
bool Passed()
Definition: Timer.h:63
bool ReGenerate()
Calculate the new weather.
Definition: Weather.cpp:70
void Reset()
Definition: Timer.h:68
void Update(time_t diff)
Definition: Timer.h:56
time_t GetCurrent() const
Definition: Timer.h:89
#define sScriptMgr
Definition: ScriptMgr.h:837
void SetCurrent(time_t current)
Definition: Timer.h:74

+ Here is the call graph for this function:

TC_GAME_API void WeatherMgr::Update ( uint32  diff)
  • Send an update signal to Weather objects
  • and remove Weather objects for zones with no player
151 {
153  WeatherMap::iterator itr, next;
154  for (itr = m_weathers.begin(); itr != m_weathers.end(); itr = next)
155  {
156  next = itr;
157  ++next;
158 
160  // As interval > WorldTick
161  if (!itr->second->Update(diff))
162  m_weathers.erase(itr);
163  }
164 }
int next(int i, int n)
Definition: RecastContour.cpp:469

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Weather::UpdateWeather ( )

Send the new weather to all players in the zone.

  • Send the weather packet to all players in this zone
  • Log the event
202 {
204  if (m_grade >= 1)
205  m_grade = 0.9999f;
206  else if (m_grade < 0)
207  m_grade = 0.0001f;
208 
209  WeatherState state = GetWeatherState();
210 
211  WorldPackets::Misc::Weather weather(state, m_grade);
212 
213  //- Returns false if there were no players found to update
214  if (!sWorld->SendZoneMessage(m_zone, weather.Write()))
215  return false;
216 
218  char const* wthstr;
219  switch (state)
220  {
221  case WEATHER_STATE_FOG:
222  wthstr = "fog";
223  break;
225  wthstr = "light rain";
226  break;
228  wthstr = "medium rain";
229  break;
231  wthstr = "heavy rain";
232  break;
234  wthstr = "light snow";
235  break;
237  wthstr = "medium snow";
238  break;
240  wthstr = "heavy snow";
241  break;
243  wthstr = "light sandstorm";
244  break;
246  wthstr = "medium sandstorm";
247  break;
249  wthstr = "heavy sandstorm";
250  break;
252  wthstr = "thunders";
253  break;
255  wthstr = "blackrain";
256  break;
257  case WEATHER_STATE_FINE:
258  default:
259  wthstr = "fine";
260  break;
261  }
262 
263  TC_LOG_INFO("misc", "Change the weather of zone %u to %s.", m_zone, wthstr);
264  sScriptMgr->OnWeatherChange(this, state, m_grade);
265  return true;
266 }
Definition: Weather.h:49
Definition: Weather.h:60
Definition: Weather.h:57
Definition: Weather.h:53
Definition: Weather.h:59
Definition: Weather.h:55
Definition: Weather.h:52
#define sWorld
Definition: World.h:887
Definition: MiscPackets.h:400
float m_grade
Definition: Weather.h:88
Definition: Weather.h:48
Definition: Weather.h:54
Definition: Weather.h:51
Definition: Weather.h:50
Definition: Weather.h:56
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
#define sScriptMgr
Definition: ScriptMgr.h:837
Definition: Weather.h:58
uint32 m_zone
Definition: Weather.h:86
WeatherState GetWeatherState() const
Get the sound number associated with the current weather.
Definition: Weather.cpp:280
WeatherState
Definition: Weather.h:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Weather::Weather ( uint32  zone,
WeatherData const weatherChances 
)

Create the Weather object.

35  : m_zone(zone), m_weatherChances(weatherChances)
36 {
39  m_grade = 0;
40 
41  TC_LOG_INFO("misc", "WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
42 }
#define sWorld
Definition: World.h:887
WeatherType m_type
Definition: Weather.h:87
IntervalTimer m_timer
Definition: Weather.h:89
Definition: Common.h:97
Definition: World.h:213
void SetInterval(time_t interval)
Definition: Timer.h:79
float m_grade
Definition: Weather.h:88
WeatherData const * m_weatherChances
Definition: Weather.h:90
uint32_t uint32
Definition: Define.h:150
Definition: Common.h:103
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
uint32 m_zone
Definition: Weather.h:86
time_t GetInterval() const
Definition: Timer.h:84
Definition: SharedDefines.h:4218

+ Here is the call graph for this function:

Weather::~Weather ( )
inline
70 { };

Variable Documentation

float Weather::m_grade
private
IntervalTimer Weather::m_timer
private
WeatherType Weather::m_type
private
WeatherData const* Weather::m_weatherChances
private
uint32 Weather::m_zone
private
uint32 WeatherSeasonChances::rainChance
uint32 WeatherData::ScriptId
uint32 WeatherSeasonChances::snowChance
uint32 WeatherSeasonChances::stormChance