aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.h
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2023-07-09 11:59:35 +0200
committerGitHub <noreply@github.com>2023-07-09 11:59:35 +0200
commitd015711fbb7a8bf57f7bb64ba8113c942d5125de (patch)
tree1f89cd7221e829a6c49f80208e8e7508d2f6e1c0 /src/server/game/Globals/ObjectMgr.h
parent996485e90e2a1ae75a4b93b33bd807f85060ca26 (diff)
Core/SAI: Implemented new source type SMART_SCRIPT_TYPE_EVENT (3) (#28816)
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.h')
-rw-r--r--src/server/game/Globals/ObjectMgr.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index f0b35c6aafa..2cd8185dd26 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1096,6 +1096,9 @@ class TC_GAME_API ObjectMgr
typedef std::unordered_map<uint64, AccessRequirement> AccessRequirementContainer;
+ typedef std::set<uint32> EventContainer;
+ typedef std::unordered_map<uint32, uint32> EventScriptContainer;
+
typedef std::unordered_map<uint32, RepRewardRate > RepRewardRateContainer;
typedef std::unordered_map<uint32, ReputationOnKillEntry> RepOnKillContainer;
typedef std::unordered_map<uint32, RepSpilloverTemplate> RepSpilloverTemplateContainer;
@@ -1218,6 +1221,11 @@ class TC_GAME_API ObjectMgr
return _gameObjectForQuestStore.find(entry) != _gameObjectForQuestStore.end();
}
+ bool IsValidEvent(uint32 eventId) const
+ {
+ return _eventStore.find(eventId) != _eventStore.end();
+ }
+
NpcText const* GetNpcText(uint32 textID) const;
QuestGreeting const* GetQuestGreeting(TypeID type, uint32 id) const;
QuestGreetingLocale const* GetQuestGreetingLocale(TypeID type, uint32 id) const;
@@ -1238,6 +1246,7 @@ class TC_GAME_API ObjectMgr
AreaTriggerStruct const* GetMapEntranceTrigger(uint32 Map) const;
uint32 GetAreaTriggerScriptId(uint32 trigger_id) const;
+ uint32 GetEventScriptId(uint32 eventId) const;
SpellScriptsBounds GetSpellScriptsBounds(uint32 spellId);
RepRewardRate const* GetRepRewardRate(uint32 factionId) const
@@ -1810,6 +1819,9 @@ class TC_GAME_API ObjectMgr
DungeonEncounterContainer _dungeonEncounterStore;
std::unordered_map<uint32, WorldSafeLocsEntry> _worldSafeLocs;
+ EventContainer _eventStore;
+ EventScriptContainer _eventScriptStore;
+
RepRewardRateContainer _repRewardRateStore;
RepOnKillContainer _repOnKillStore;
RepSpilloverTemplateContainer _repSpilloverTemplateStore;
@@ -1864,6 +1876,7 @@ class TC_GAME_API ObjectMgr
std::unordered_map<uint32, std::vector<TerrainSwapInfo*>> _terrainSwapInfoByMap;
private:
+ void LoadEventSet();
void LoadScripts(ScriptsType type);
void LoadQuestRelationsHelper(QuestRelations& map, QuestRelationsReverse* reverseMap, std::string const& table);
QuestRelationResult GetQuestRelationsFrom(QuestRelations const& map, uint32 key, bool onlyActive) const { return { map.equal_range(key), onlyActive }; }