Load npc_options at server startup, use cached data at creature gossip menu init.

Also new .reload table command added. Note: currently it will not affect creatures that have gossim memu created at command use moment.
This commit is contained in:
VladimirMangos 2008-10-27 16:43:31 +03:00
parent e96fedc97c
commit 9e6390d88d
8 changed files with 77 additions and 31 deletions

View file

@ -229,6 +229,7 @@ struct PlayerCondition
// NPC gossip text id
typedef HM_NAMESPACE::hash_map<uint32, uint32> CacheNpcTextIdMap;
typedef std::list<GossipOption> CacheNpcOptionList;
typedef HM_NAMESPACE::hash_map<uint32, VendorItemData> CacheVendorItemMap;
typedef HM_NAMESPACE::hash_map<uint32, TrainerSpellData> CacheTrainerSpellMap;
@ -544,6 +545,7 @@ class ObjectMgr
void LoadWeatherZoneChances();
void LoadGameTele();
void LoadNpcOptions();
void LoadNpcTextId();
void LoadVendors();
void LoadTrainerSpell();
@ -712,6 +714,8 @@ class ObjectMgr
bool AddGameTele(GameTele& data);
bool DeleteGameTele(std::string name);
CacheNpcOptionList const& GetNpcOptions() const { return m_mCacheNpcOptionList; }
uint32 GetNpcGossip(uint32 entry) const
{
CacheNpcTextIdMap::const_iterator iter = m_mCacheNpcTextIdMap.find(entry);
@ -850,6 +854,7 @@ class ObjectMgr
typedef std::vector<PlayerCondition> ConditionStore;
ConditionStore mConditions;
CacheNpcOptionList m_mCacheNpcOptionList;
CacheNpcTextIdMap m_mCacheNpcTextIdMap;
CacheVendorItemMap m_mCacheVendorItemMap;
CacheTrainerSpellMap m_mCacheTrainerSpellMap;