mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8923] Restructure gossip menus and make it possible to build selections by database
As result, gossip for GO is now possible. Moved related data structures and remove useless from code. Please note that after some time, table npc_gossip will be fully removed (use menuId in _template in relation to gossip_menu as replacement). Special thanks to GriffonHeart for help with research, discussions and ideas of code and thanks to Vladimir for helpful input. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
8b0ce112ba
commit
090c8b8854
19 changed files with 689 additions and 455 deletions
|
|
@ -216,6 +216,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
|
||||
{
|
||||
|
|
@ -275,7 +307,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;
|
||||
|
|
@ -557,8 +588,11 @@ class ObjectMgr
|
|||
void LoadWeatherZoneChances();
|
||||
void LoadGameTele();
|
||||
|
||||
void LoadNpcOptions();
|
||||
void LoadNpcTextId();
|
||||
|
||||
void LoadGossipMenu();
|
||||
void LoadGossipMenuItems();
|
||||
|
||||
void LoadVendors();
|
||||
void LoadTrainerSpell();
|
||||
|
||||
|
|
@ -751,8 +785,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);
|
||||
|
|
@ -800,6 +832,16 @@ class ObjectMgr
|
|||
return ItemRequiredTargetMapBounds(m_ItemRequiredTarget.lower_bound(uiItemEntry),m_ItemRequiredTarget.upper_bound(uiItemEntry));
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// first free id for selected id type
|
||||
|
|
@ -841,7 +883,9 @@ class ObjectMgr
|
|||
|
||||
RepOnKillMap mRepOnKill;
|
||||
|
||||
PointOfInterestMap mPointsOfInterest;
|
||||
GossipMenusMap m_mGossipMenusMap;
|
||||
GossipMenuItemsMap m_mGossipMenuItemsMap;
|
||||
PointOfInterestMap mPointsOfInterest;
|
||||
|
||||
WeatherZoneMap mWeatherZoneMap;
|
||||
|
||||
|
|
@ -914,7 +958,6 @@ class ObjectMgr
|
|||
typedef std::vector<PlayerCondition> ConditionStore;
|
||||
ConditionStore mConditions;
|
||||
|
||||
CacheNpcOptionList m_mCacheNpcOptionList;
|
||||
CacheNpcTextIdMap m_mCacheNpcTextIdMap;
|
||||
CacheVendorItemMap m_mCacheVendorItemMap;
|
||||
CacheTrainerSpellMap m_mCacheTrainerSpellMap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue