diff options
Diffstat (limited to 'src/game/ObjectMgr.h')
-rw-r--r-- | src/game/ObjectMgr.h | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 440763c21cc..f5b151ba554 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -74,7 +74,6 @@ struct GameTele }; typedef UNORDERED_MAP<uint32, GameTele > GameTeleMap; -typedef std::list<GossipOption> CacheNpcOptionList; struct ScriptInfo { @@ -97,6 +96,7 @@ extern ScriptMapMap sQuestStartScripts; extern ScriptMapMap sSpellScripts; extern ScriptMapMap sGameObjectScripts; extern ScriptMapMap sEventScripts; +extern ScriptMapMap sGossipScripts; extern ScriptMapMap sWaypointScripts; struct SpellClickInfo @@ -163,7 +163,7 @@ typedef UNORDERED_MAP<uint32,QuestLocale> QuestLocaleMap; typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap; typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap; typedef UNORDERED_MAP<int32,TrinityStringLocale> TrinityStringLocaleMap; -typedef UNORDERED_MAP<uint32,NpcOptionLocale> NpcOptionLocaleMap; +typedef UNORDERED_MAP<uint32,GossipMenuItemsLocale> GossipMenuItemsLocaleMap; typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap; typedef std::multimap<uint32,uint32> QuestRelations; @@ -217,6 +217,38 @@ struct PointOfInterest std::string icon_name; }; +struct GossipMenuItems +{ + uint32 menu_id; + uint32 id; + uint8 option_icon; + std::string option_text; + uint32 option_id; + uint32 npc_option_npcflag; + uint32 action_menu_id; + uint32 action_poi_id; + uint32 action_script_id; + bool box_coded; + uint32 box_money; + std::string box_text; + uint16 cond_1; + uint16 cond_2; + uint16 cond_3; +}; + +struct GossipMenus +{ + uint32 entry; + uint32 text_id; + uint16 cond_1; + uint16 cond_2; +}; + +typedef std::multimap<uint32,GossipMenus> GossipMenusMap; +typedef std::pair<GossipMenusMap::const_iterator, GossipMenusMap::const_iterator> GossipMenusMapBounds; +typedef std::multimap<uint32,GossipMenuItems> GossipMenuItemsMap; +typedef std::pair<GossipMenuItemsMap::const_iterator, GossipMenuItemsMap::const_iterator> GossipMenuItemsMapBounds; + #define WEATHER_SEASONS 4 struct WeatherSeasonChances { @@ -277,7 +309,6 @@ struct PlayerCondition // NPC gossip text id typedef UNORDERED_MAP<uint32, uint32> CacheNpcTextIdMap; -typedef std::list<GossipOption> CacheNpcOptionList; typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemMap; typedef UNORDERED_MAP<uint32, TrainerSpellData> CacheTrainerSpellMap; @@ -537,6 +568,7 @@ class ObjectMgr void LoadQuestStartScripts(); void LoadEventScripts(); void LoadSpellScripts(); + void LoadGossipScripts(); void LoadWaypointScripts(); void LoadTransportEvents(); @@ -596,8 +628,11 @@ class ObjectMgr void LoadWeatherZoneChances(); void LoadGameTele(); - void LoadNpcOptions(); void LoadNpcTextId(); + + void LoadGossipMenu(); + void LoadGossipMenuItems(); + void LoadVendors(); void LoadTrainerSpell(); void LoadGMTickets(); @@ -715,10 +750,10 @@ class ObjectMgr if(itr==mPageTextLocaleMap.end()) return NULL; return &itr->second; } - NpcOptionLocale const* GetNpcOptionLocale(uint32 entry) const + GossipMenuItemsLocale const* GetGossipMenuItemsLocale(uint32 entry) const { - NpcOptionLocaleMap::const_iterator itr = mNpcOptionLocaleMap.find(entry); - if(itr==mNpcOptionLocaleMap.end()) return NULL; + GossipMenuItemsLocaleMap::const_iterator itr = mGossipMenuItemsLocaleMap.find(entry); + if(itr==mGossipMenuItemsLocaleMap.end()) return NULL; return &itr->second; } PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const @@ -805,8 +840,6 @@ class ObjectMgr bool AddGameTele(GameTele& data); bool DeleteGameTele(const std::string& name); - CacheNpcOptionList const& GetNpcOptions() const { return m_mCacheNpcOptionList; } - uint32 GetNpcGossip(uint32 entry) const { CacheNpcTextIdMap::const_iterator iter = m_mCacheNpcTextIdMap.find(entry); @@ -871,6 +904,16 @@ class ObjectMgr return NULL; } + GossipMenusMapBounds GetGossipMenusMapBounds(uint32 uiMenuId) const + { + return GossipMenusMapBounds(m_mGossipMenusMap.lower_bound(uiMenuId),m_mGossipMenusMap.upper_bound(uiMenuId)); + } + + GossipMenuItemsMapBounds GetGossipMenuItemsMapBounds(uint32 uiMenuId) const + { + return GossipMenuItemsMapBounds(m_mGossipMenuItemsMap.lower_bound(uiMenuId),m_mGossipMenuItemsMap.upper_bound(uiMenuId)); + } + void AddOrUpdateGMTicket(GM_Ticket &ticket, bool create = false); void _AddOrUpdateGMTicket(GM_Ticket &ticket); void RemoveGMTicket(uint64 ticketGuid, int64 source = -1, bool permanently = false); @@ -928,7 +971,9 @@ class ObjectMgr RepOnKillMap mRepOnKill; - PointOfInterestMap mPointsOfInterest; + GossipMenusMap m_mGossipMenusMap; + GossipMenuItemsMap m_mGossipMenuItemsMap; + PointOfInterestMap mPointsOfInterest; WeatherZoneMap mWeatherZoneMap; @@ -997,7 +1042,7 @@ class ObjectMgr NpcTextLocaleMap mNpcTextLocaleMap; PageTextLocaleMap mPageTextLocaleMap; TrinityStringLocaleMap mTrinityStringLocaleMap; - NpcOptionLocaleMap mNpcOptionLocaleMap; + GossipMenuItemsLocaleMap mGossipMenuItemsLocaleMap; PointOfInterestLocaleMap mPointOfInterestLocaleMap; RespawnTimes mCreatureRespawnTimes; RespawnTimes mGORespawnTimes; @@ -1006,7 +1051,6 @@ class ObjectMgr typedef std::vector<PlayerCondition> ConditionStore; ConditionStore mConditions; - CacheNpcOptionList m_mCacheNpcOptionList; CacheNpcTextIdMap m_mCacheNpcTextIdMap; CacheVendorItemMap m_mCacheVendorItemMap; CacheTrainerSpellMap m_mCacheTrainerSpellMap; |