AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
GameEventMgr.cpp File Reference
#include "GameEventMgr.h"
#include "BattlegroundMgr.h"
#include "Chat.h"
#include "DisableMgr.h"
#include "GameObjectAI.h"
#include "GameTime.h"
#include "HolidayDateCalculator.h"
#include "Language.h"
#include "Log.h"
#include "MapMgr.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "PoolMgr.h"
#include "ScriptMgr.h"
#include "Transport.h"
#include "UnitAI.h"
#include "World.h"
#include "WorldSessionMgr.h"
#include "WorldState.h"
#include "WorldStatePackets.h"
#include <chrono>

Go to the source code of this file.

Classes

class  GameEventAIHookWorker
 

Functions

bool IsHolidayActive (HolidayIds id)
 
bool IsEventActive (uint16 eventId)
 

Function Documentation

◆ IsEventActive()

bool IsEventActive ( uint16  eventId)
2077{
2078 GameEventMgr::ActiveEvents const& ae = sGameEventMgr->GetActiveEventList();
2079 return ae.find(eventId) != ae.end();
2080}
#define sGameEventMgr
Definition GameEventMgr.h:204
std::set< uint16 > ActiveEvents
Definition GameEventMgr.h:106

References sGameEventMgr.

Referenced by Player::_LoadBrewOfTheMonth(), Battleground::EndBattleground(), GameEventMgr::LoadEventVendors(), npc_innkeeper::OnGossipHello(), and npc_innkeeper::OnGossipSelect().

◆ IsHolidayActive()

bool IsHolidayActive ( HolidayIds  id)
2055{
2056 if (id == HOLIDAY_NONE)
2057 return false;
2058
2059 GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
2060 GameEventMgr::ActiveEvents const& ae = sGameEventMgr->GetActiveEventList();
2061
2062 // Brewfest and the Darkmoon Faire have a building stage running days ahead of the event itself,
2063 // only their last stage means the holiday is on
2064 uint8 mainStage = sGameEventMgr->GetHolidayMainStage(id);
2065
2066 for (uint16 eventId : ae)
2067 {
2068 GameEventData const& event = events[eventId];
2069 if (event.HolidayId == id && event.HolidayStage == mainStage)
2070 return true;
2071 }
2072
2073 return false;
2074}
std::uint8_t uint8
Definition Define.h:109
std::uint16_t uint16
Definition Define.h:108
@ HOLIDAY_NONE
Definition SharedDefines.h:2975
events
Definition boss_sartura.cpp:43
std::vector< GameEventData > GameEventDataMap
Definition GameEventMgr.h:107
Definition GameEventMgr.h:57

References HOLIDAY_NONE, and sGameEventMgr.

Referenced by Player::CanUseItem(), BattlegroundMgr::IsBGWeekend(), lfg::LFGMgr::IsSeasonActive(), AchievementCriteriaData::Meets(), npc_midsummer_bonfire::npc_midsummer_bonfire(), spell_bonfires_blessing::OnApply(), MidsummerPlayerScript::OnPlayerUpdateZone(), BattlegroundAV::SetupBattleground(), go_brewfest_music::go_brewfest_musicAI::UpdateAI(), go_pirate_day_music::go_pirate_day_musicAI::UpdateAI(), go_darkmoon_faire_music::go_darkmoon_faire_musicAI::UpdateAI(), and go_midsummer_music::go_midsummer_musicAI::UpdateAI().