diff --git a/src/common/Utilities/EventMap.cpp b/src/common/Utilities/EventMap.cpp new file mode 100644 index 000000000..15a95829e --- /dev/null +++ b/src/common/Utilities/EventMap.cpp @@ -0,0 +1,260 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "EventMap.h" +#include "Random.h" + +void EventMap::Reset() +{ + _eventMap.clear(); + _time = 0; + _phase = 0; +} + +void EventMap::SetPhase(uint8 phase) +{ + if (!phase) + { + _phase = 0; + } + else if (phase <= 8) + { + _phase = (1 << (phase - 1)); + } +} + +void EventMap::AddPhase(uint8 phase) +{ + if (phase && phase <= 8) + { + _phase |= (1 << (phase - 1)); + } +} + +void EventMap::RemovePhase(uint8 phase) +{ + if (phase && phase <= 8) + { + _phase &= ~(1 << (phase - 1)); + } +} + +void EventMap::ScheduleEvent(uint32 eventId, uint32 time, uint32 group /*= 0*/, uint32 phase /*= 0*/) +{ + if (group && group <= 8) + { + eventId |= (1 << (group + 15)); + } + + if (phase && phase <= 8) + { + eventId |= (1 << (phase + 23)); + } + + _eventMap.emplace(_time + time, eventId); +} + +void EventMap::ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group /*= 0*/, uint8 phase /* = 0*/) +{ + ScheduleEvent(eventId, time.count(), group, phase); +} + +void EventMap::ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/) +{ + ScheduleEvent(eventId, randtime(minTime, maxTime).count(), group, phase); +} + +void EventMap::RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId /*= 0*/, uint32 phase/* = 0*/) +{ + CancelEvent(eventId); + ScheduleEvent(eventId, time, groupId, phase); +} + +void EventMap::RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group /*= 0*/, uint8 phase /* = 0*/) +{ + CancelEvent(eventId); + ScheduleEvent(eventId, time.count(), group, phase); +} + +void EventMap::RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/) +{ + CancelEvent(eventId); + ScheduleEvent(eventId, randtime(minTime, maxTime).count(), group, phase); +} + +void EventMap::RepeatEvent(uint32 time) +{ + _eventMap.emplace(_time + time, _lastEvent); +} + +void EventMap::Repeat(Milliseconds time) +{ + RepeatEvent(time.count()); +} + +uint32 EventMap::ExecuteEvent() +{ + while (!Empty()) + { + auto const& itr = _eventMap.begin(); + + if (itr->first > _time) + { + return 0; + } + else if (_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) & _phase)) + { + _eventMap.erase(itr); + } + else + { + uint32 eventId = (itr->second & 0x0000FFFF); + _lastEvent = itr->second; + _eventMap.erase(itr); + return eventId; + } + } + + return 0; +} + +void EventMap::DelayEvents(uint32 delay) +{ + _time = delay < _time ? _time - delay : 0; +} + +void EventMap::DelayEvents(Milliseconds delay) +{ + DelayEvents(delay.count()); +} + +void EventMap::DelayEvents(uint32 delay, uint32 group) +{ + if (group > 8 || Empty()) + { + return; + } + + EventStore delayed; + + for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (!group || (itr->second & (1 << (group + 15)))) + { + delayed.insert(EventStore::value_type(itr->first + delay, itr->second)); + itr = _eventMap.erase(itr); + continue; + } + + ++itr; + } + + _eventMap.insert(delayed.begin(), delayed.end()); +} + +void EventMap::DelayEventsToMax(uint32 delay, uint32 group) +{ + for (auto itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (itr->first < _time + delay && (group == 0 || ((1 << (group + 15)) & itr->second))) + { + ScheduleEvent(itr->second, delay); + _eventMap.erase(itr); + itr = _eventMap.begin(); + continue; + } + + ++itr; + } +} + +void EventMap::CancelEvent(uint32 eventId) +{ + if (Empty()) + { + return; + } + + for (auto itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (eventId == (itr->second & 0x0000FFFF)) + { + itr = _eventMap.erase(itr); + continue; + } + + ++itr; + } +} + +void EventMap::CancelEventGroup(uint32 group) +{ + if (!group || group > 8 || Empty()) + { + return; + } + + uint32 groupMask = (1 << (group + 15)); + for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) + { + if (itr->second & groupMask) + { + _eventMap.erase(itr); + itr = _eventMap.begin(); + continue; + } + + ++itr; + } +} + +uint32 EventMap::GetNextEventTime(uint32 eventId) const +{ + if (Empty()) + { + return 0; + } + + for (auto const& itr : _eventMap) + { + if (eventId == (itr.second & 0x0000FFFF)) + { + return itr.first; + } + } + + return 0; +} + +uint32 EventMap::GetNextEventTime() const +{ + return Empty() ? 0 : _eventMap.begin()->first; +} + +bool EventMap::IsInPhase(uint8 phase) +{ + return phase <= 8 && (!phase || _phase & (1 << (phase - 1))); +} + +Milliseconds EventMap::GetTimeUntilEvent(uint32 eventId) const +{ + for (std::pair const& itr : _eventMap) + if (eventId == (itr.second & 0x0000FFFF)) + return std::chrono::duration_cast(Milliseconds(itr.first) - Milliseconds(_time)); + + return Milliseconds::max(); +} diff --git a/src/common/Utilities/EventMap.h b/src/common/Utilities/EventMap.h new file mode 100644 index 000000000..45f97b15a --- /dev/null +++ b/src/common/Utilities/EventMap.h @@ -0,0 +1,321 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef _EVENT_MAP_H_ +#define _EVENT_MAP_H_ + +#include "Define.h" +#include "Duration.h" +#include + +class EventMap +{ + /** + * Internal storage type. + * Key: Time as TimePoint when the event should occur. + * Value: The event data as uint32. + * + * Structure of event data: + * - Bit 0 - 15: Event Id. + * - Bit 16 - 23: Group + * - Bit 24 - 31: Phase + * - Pattern: 0xPPGGEEEE + */ + typedef std::multimap EventStore; + +public: + EventMap() { } + + /** + * @name Reset + * @brief Removes all scheduled events and resets time and phase. + */ + void Reset(); + + /** + * @name Update + * @brief Updates the timer of the event map. + * @param time Value to be added to time. + */ + void Update(uint32 time) + { + _time += time; + } + + /** + * @name Update + * @brief Updates the timer of the event map. + * @param time Value in ms to be added to time. + */ + void Update(Milliseconds time) + { + _time += static_cast(time.count()); + } + + /** + * @name GetTimer + * @return Current timer value. + */ + [[nodiscard]] uint32 GetTimer() const + { + return _time; + } + + void SetTimer(uint32 time) + { + _time = time; + } + + /** + * @name GetPhaseMask + * @return Active phases as mask. + */ + [[nodiscard]] uint8 GetPhaseMask() const + { + return _phase; + } + + /** + * @name Empty + * @return True, if there are no events scheduled. + */ + [[nodiscard]] bool Empty() const + { + return _eventMap.empty(); + } + + /** + * @name SetPhase + * @brief Sets the phase of the map (absolute). + * @param phase Phase which should be set. Values: 1 - 8. 0 resets phase. + */ + void SetPhase(uint8 phase); + + /** + * @name AddPhase + * @brief Activates the given phase (bitwise). + * @param phase Phase which should be activated. Values: 1 - 8 + */ + void AddPhase(uint8 phase); + + /** + * @name RemovePhase + * @brief Deactivates the given phase (bitwise). + * @param phase Phase which should be deactivated. Values: 1 - 8. + */ + void RemovePhase(uint8 phase); + + /** + * @name ScheduleEvent + * @brief Creates new event entry in map. + * @param eventId The id of the new event. + * @param time The time in milliseconds until the event occurs. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void ScheduleEvent(uint32 eventId, uint32 time, uint32 group = 0, uint32 phase = 0); + + /** + * @name ScheduleEvent + * @brief Schedules a new event. An existing event is not canceled. + * @param eventId The id of the new event. + * @param time The time until the event occurs as std::chrono type. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0); + + /** + * @name ScheduleEvent + * @brief Schedules a new event. An existing event is not canceled. + * @param eventId The id of the new event. + * @param minTime The minimum time until the event occurs as std::chrono type. + * @param maxTime The maximum time until the event occurs as std::chrono type. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint32 phase = 0); + + /** + * @name RescheduleEvent + * @brief Cancels the given event and reschedules it. + * @param eventId The id of the event. + * @param time The time in milliseconds until the event occurs. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId = 0, uint32 phase = 0); + + /** + * @name RescheduleEvent + * @brief Cancels the given event and reschedules it. + * @param eventId The id of the event. + * @param time The time until the event occurs as std::chrono type. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0); + + /** + * @name RescheduleEvent + * @brief Cancels the given event and reschedules it. + * @param eventId The id of the event. + * @param minTime The minimum time until the event occurs as std::chrono type. + * @param maxTime The maximum time until the event occurs as std::chrono type. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint32 phase = 0); + + /** + * @name RescheduleEvent + * @brief Cancels the given event and reschedules it. + * @param eventId The id of the event. + * @param time The time in milliseconds until the event occurs. + * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. + * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. + */ + void RepeatEvent(uint32 time); + + /** + * @name RepeatEvent + * @brief Repeats the most recently executed event. + * @param time Time until the event occurs as std::chrono type. + */ + void Repeat(Milliseconds time); + + /** + * @name ExecuteEvent + * @brief Returns the next event to execute and removes it from map. + * @return Id of the event to execute. + */ + uint32 ExecuteEvent(); + + /** + * @name DelayEvents + * @brief Delays all events in the map. If delay is greater than or equal internal timer, delay will be 0. + * @param delay Amount of delay. + */ + void DelayEvents(uint32 delay); + + /** + * @name DelayEvents + * @brief Delays all events. + * @param delay Amount of delay as std::chrono type. + */ + void DelayEvents(Milliseconds delay); + + /** + * @name DelayEvents + * @brief Delay all events of the same group. + * @param delay Amount of delay. + * @param group Group of the events. + */ + void DelayEvents(uint32 delay, uint32 group); + + /** + * @name EventsEvents + * @brief Delay all events of the same group. + * @param delay Amount of delay. + * @param group Group of the events. + */ + void DelayEventsToMax(uint32 delay, uint32 group); + + /** + * @name CancelEvent + * @brief Cancels all events of the specified id. + * @param eventId Event id to cancel. + */ + void CancelEvent(uint32 eventId); + + /** + * @name CancelEventGroup + * @brief Cancel events belonging to specified group. + * @param group Group to cancel. + */ + void CancelEventGroup(uint32 group); + + /** + * @name GetNextEventTime + * @brief Returns closest occurence of specified event. + * @param eventId Wanted event id. + * @return Time of found event. + */ + [[nodiscard]] uint32 GetNextEventTime(uint32 eventId) const; + + /** + * @name GetNextEventTime + * @return Time of next event. + */ + [[nodiscard]] uint32 GetNextEventTime() const; + + /** + * @name IsInPhase + * @brief Returns wether event map is in specified phase or not. + * @param phase Wanted phase. + * @return True, if phase of event map contains specified phase. + */ + bool IsInPhase(uint8 phase); + + /** + * @name GetTimeUntilEvent + * @brief Returns time as std::chrono type until next event. + * @param eventId of the event. + * @return Time of next event. If event is not scheduled returns Milliseconds::max() + */ + Milliseconds GetTimeUntilEvent(uint32 eventId) const; + +private: + /** + * @name _time + * @brief Internal timer. + * + * This does not represent the real date/time value. + * It's more like a stopwatch: It can run, it can be stopped, + * it can be resetted and so on. Events occur when this timer + * has reached their time value. Its value is changed in the + * Update method. + */ + uint32 _time{ 0 }; + + /** + * @name _phase + * @brief Phase mask of the event map. + * + * Contains the phases the event map is in. Multiple + * phases from 1 to 8 can be set with SetPhase or + * AddPhase. RemovePhase deactives a phase. + */ + uint32 _phase{0}; + + /** + * @name _lastEvent + * @brief Stores information on the most recently executed event + */ + uint32 _lastEvent{0}; + + /** + * @name _eventMap + * @brief Internal event storage map. Contains the scheduled events. + * + * See typedef at the beginning of the class for more + * details. + */ + EventStore _eventMap; +}; + +#endif diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 5d259c962..f2bbee6cf 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -613,348 +613,6 @@ bool CompareValues(ComparisionType type, T val1, T val2) } } -class EventMap -{ - typedef std::multimap EventStore; - -public: - EventMap() = default; - - /** - * @name Reset - * @brief Removes all scheduled events and resets time and phase. - */ - void Reset() - { - _eventMap.clear(); - _time = 0; - _phase = 0; - } - - /** - * @name Update - * @brief Updates the timer of the event map. - * @param time Value to be added to time. - */ - void Update(uint32 time) - { - _time += time; - } - - /** - * @name GetTimer - * @return Current timer value. - */ - [[nodiscard]] uint32 GetTimer() const - { - return _time; - } - - void SetTimer(uint32 time) - { - _time = time; - } - - /** - * @name GetPhaseMask - * @return Active phases as mask. - */ - [[nodiscard]] uint8 GetPhaseMask() const - { - return _phase; - } - - /** - * @name Empty - * @return True, if there are no events scheduled. - */ - [[nodiscard]] bool Empty() const - { - return _eventMap.empty(); - } - - /** - * @name SetPhase - * @brief Sets the phase of the map (absolute). - * @param phase Phase which should be set. Values: 1 - 8. 0 resets phase. - */ - void SetPhase(uint8 phase) - { - if (!phase) - { - _phase = 0; - } - else if (phase <= 8) - { - _phase = (1 << (phase - 1)); - } - } - - /** - * @name AddPhase - * @brief Activates the given phase (bitwise). - * @param phase Phase which should be activated. Values: 1 - 8 - */ - void AddPhase(uint8 phase) - { - if (phase && phase <= 8) - { - _phase |= (1 << (phase - 1)); - } - } - - /** - * @name RemovePhase - * @brief Deactivates the given phase (bitwise). - * @param phase Phase which should be deactivated. Values: 1 - 8. - */ - void RemovePhase(uint8 phase) - { - if (phase && phase <= 8) - { - _phase &= ~(1 << (phase - 1)); - } - } - - /** - * @name ScheduleEvent - * @brief Creates new event entry in map. - * @param eventId The id of the new event. - * @param time The time in milliseconds until the event occurs. - * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. - * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. - */ - void ScheduleEvent(uint32 eventId, uint32 time, uint32 group = 0, uint32 phase = 0) - { - if (group && group <= 8) - { - eventId |= (1 << (group + 15)); - } - - if (phase && phase <= 8) - { - eventId |= (1 << (phase + 23)); - } - - _eventMap.insert(EventStore::value_type(_time + time, eventId)); - } - - /** - * @name RescheduleEvent - * @brief Cancels the given event and reschedules it. - * @param eventId The id of the event. - * @param time The time in milliseconds until the event occurs. - * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. - * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. - */ - void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId = 0, uint32 phase = 0) - { - CancelEvent(eventId); - ScheduleEvent(eventId, time, groupId, phase); - } - - /** - * @name RescheduleEvent - * @brief Cancels the given event and reschedules it. - * @param eventId The id of the event. - * @param time The time in milliseconds until the event occurs. - * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. - * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. - */ - void RepeatEvent(uint32 time) - { - _eventMap.insert(EventStore::value_type(_time + time, _lastEvent)); - } - - /** - * @name ExecuteEvent - * @brief Returns the next event to execute and removes it from map. - * @return Id of the event to execute. - */ - uint32 ExecuteEvent() - { - while (!Empty()) - { - EventStore::iterator itr = _eventMap.begin(); - - if (itr->first > _time) - { - return 0; - } - else if (_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) & _phase)) - { - _eventMap.erase(itr); - } - else - { - uint32 eventId = (itr->second & 0x0000FFFF); - _lastEvent = itr->second; - _eventMap.erase(itr); - return eventId; - } - } - - return 0; - } - - /** - * @name DelayEvents - * @brief Delays all events in the map. If delay is greater than or equal internal timer, delay will be 0. - * @param delay Amount of delay. - */ - void DelayEvents(uint32 delay) - { - _time = delay < _time ? _time - delay : 0; - } - - void DelayEventsToMax(uint32 delay, uint32 group) - { - for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) - { - if (itr->first < _time + delay && (group == 0 || ((1 << (group + 15)) & itr->second))) - { - ScheduleEvent(itr->second, delay); - _eventMap.erase(itr); - itr = _eventMap.begin(); - continue; - } - - ++itr; - } - } - - /** - * @name DelayEvents - * @brief Delay all events of the same group. - * @param delay Amount of delay. - * @param group Group of the events. - */ - void DelayEvents(uint32 delay, uint32 group) - { - if (group > 8 || Empty()) - { - return; - } - - EventStore delayed; - - for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) - { - if (!group || (itr->second & (1 << (group + 15)))) - { - delayed.insert(EventStore::value_type(itr->first + delay, itr->second)); - itr = _eventMap.erase(itr); - continue; - } - - ++itr; - } - - _eventMap.insert(delayed.begin(), delayed.end()); - } - - /** - * @name CancelEvent - * @brief Cancels all events of the specified id. - * @param eventId Event id to cancel. - */ - void CancelEvent(uint32 eventId) - { - if (Empty()) - { - return; - } - - for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) - { - if (eventId == (itr->second & 0x0000FFFF)) - { - itr = _eventMap.erase(itr); - continue; - } - - ++itr; - } - } - - /** - * @name CancelEventGroup - * @brief Cancel events belonging to specified group. - * @param group Group to cancel. - */ - void CancelEventGroup(uint32 group) - { - if (!group || group > 8 || Empty()) - { - return; - } - - uint32 groupMask = (1 << (group + 15)); - for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) - { - if (itr->second & groupMask) - { - _eventMap.erase(itr); - itr = _eventMap.begin(); - continue; - } - - ++itr; - } - } - - /** - * @name GetNextEventTime - * @brief Returns closest occurence of specified event. - * @param eventId Wanted event id. - * @return Time of found event. - */ - [[nodiscard]] uint32 GetNextEventTime(uint32 eventId) const - { - if (Empty()) - { - return 0; - } - - for (auto const& itr : _eventMap) - { - if (eventId == (itr.second & 0x0000FFFF)) - { - return itr.first; - } - } - - return 0; - } - - /** - * @name GetNextEventTime - * @return Time of next event. - */ - [[nodiscard]] uint32 GetNextEventTime() const - { - return Empty() ? 0 : _eventMap.begin()->first; - } - - /** - * @name IsInPhase - * @brief Returns wether event map is in specified phase or not. - * @param phase Wanted phase. - * @return True, if phase of event map contains specified phase. - */ - bool IsInPhase(uint8 phase) - { - return phase <= 8 && (!phase || _phase & (1 << (phase - 1))); - } - -private: - uint32 _time{0}; - uint32 _phase{0}; - uint32 _lastEvent{0}; - - EventStore _eventMap; -}; - template constexpr typename std::underlying_type::type AsUnderlyingType(E enumValue) { diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h index c22edf25b..7459a1e26 100644 --- a/src/server/game/AI/CoreAI/CombatAI.h +++ b/src/server/game/AI/CoreAI/CombatAI.h @@ -21,6 +21,7 @@ #include "ConditionMgr.h" #include "CreatureAI.h" #include "CreatureAIImpl.h" +#include "EventMap.h" class Creature; diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index d07edb8eb..a2470e63e 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -22,6 +22,7 @@ #include "CreatureAI.h" #include "CreatureAIImpl.h" #include "InstanceScript.h" +#include "EventMap.h" #define CAST_AI(a, b) (dynamic_cast(b)) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 3e55dd364..f515f342b 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -19,6 +19,7 @@ #define __BATTLEGROUNDAB_H #include "Battleground.h" +#include "EventMap.h" enum BG_AB_Events { diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 1e3ed9960..c3c868df6 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -19,6 +19,7 @@ #define __BATTLEGROUNDEY_H #include "Battleground.h" +#include "EventMap.h" #include "Language.h" enum BG_EY_Events diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index e02a773fe..4330abec9 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -19,6 +19,7 @@ #define __BATTLEGROUNDWS_H #include "Battleground.h" +#include "EventMap.h" enum BG_WS_Events { diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index 5c92c5159..3417e9d5e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "EventMap.h" #include "GameObject.h" #include "InstanceScript.h" #include "Map.h" diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index b686cc958..0bc55135d 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -16,6 +16,7 @@ */ #include "CreatureAI.h" +#include "EventMap.h" #include "InstanceScript.h" #include "Player.h" #include "ScriptMgr.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index ebc469083..e3d3d919b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "EventMap.h" #include "InstanceScript.h" #include "Player.h" #include "ScriptMgr.h"