Changeset 6 for trunk/src/game/ObjectMgr.h
- Timestamp:
- 11/19/08 13:22:12 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ObjectMgr.h
r2 r6 43 43 #include <string> 44 44 #include <map> 45 #include <limits> 45 46 46 47 extern SQLStorage sCreatureStorage; … … 60 61 class TransportPath; 61 62 class Item; 63 64 struct GameTele 65 { 66 float position_x; 67 float position_y; 68 float position_z; 69 float orientation; 70 uint32 mapId; 71 std::string name; 72 std::wstring wnameLow; 73 }; 74 75 typedef HM_NAMESPACE::hash_map<uint32, GameTele > GameTeleMap; 62 76 63 77 struct ScriptInfo … … 144 158 uint32 repfaction2; 145 159 bool is_teamaward1; 146 uint32 reput ration_max_cap1;160 uint32 reputation_max_cap1; 147 161 int32 repvalue1; 148 162 bool is_teamaward2; 149 uint32 reput ration_max_cap2;163 uint32 reputation_max_cap2; 150 164 int32 repvalue2; 151 165 bool team_dependent; … … 212 226 }; 213 227 228 // NPC gossip text id 229 typedef HM_NAMESPACE::hash_map<uint32, uint32> CacheNpcTextIdMap; 230 231 // Vendors 232 struct VendorItem 233 { 234 uint32 item; 235 uint32 maxcount; 236 uint32 incrtime; 237 uint32 ExtendedCost; 238 }; 239 typedef std::vector<VendorItem*> VendorItemList; 240 241 typedef HM_NAMESPACE::hash_map<uint32, VendorItemList> CacheVendorItemMap; 242 243 typedef HM_NAMESPACE::hash_map<uint32, TrainerSpellData> CacheTrainerSpellMap; 244 214 245 enum SkillRangeType 215 246 { … … 467 498 void LoadSpellScripts(); 468 499 469 bool LoadMangosStrings(DatabaseType& db, char const* table, bool positive_entries);470 bool LoadMangosStrings() { return LoadMangosStrings(WorldDatabase,"mangos_string", true); }500 bool LoadMangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value); 501 bool LoadMangosStrings() { return LoadMangosStrings(WorldDatabase,"mangos_string",1,std::numeric_limits<int32>::max()); } 471 502 void LoadPetCreateSpells(); 472 503 void LoadCreatureLocales(); … … 513 544 514 545 void LoadWeatherZoneChances(); 546 void LoadGameTele(); 547 548 void LoadNpcTextId(); 549 void LoadVendors(); 550 void LoadTrainerSpell(); 515 551 516 552 std::string GeneratePetName(uint32 entry); … … 664 700 665 701 return mConditions[condition_id].Meets(player); 702 } 703 704 GameTele const* GetGameTele(uint32 id) const 705 { 706 GameTeleMap::const_iterator itr = m_GameTeleMap.find(id); 707 if(itr==m_GameTeleMap.end()) return NULL; 708 return &itr->second; 709 } 710 GameTele const* GetGameTele(std::string name) const; 711 GameTeleMap const& GetGameTeleMap() const { return m_GameTeleMap; } 712 bool AddGameTele(GameTele& data); 713 bool DeleteGameTele(std::string name); 714 715 uint32 GetNpcGossip(uint32 entry) const 716 { 717 CacheNpcTextIdMap::const_iterator iter = m_mCacheNpcTextIdMap.find(entry); 718 if(iter == m_mCacheNpcTextIdMap.end()) 719 return 0; 720 721 return iter->second; 722 } 723 724 TrainerSpellData const* GetNpcTrainerSpells(uint32 entry) const 725 { 726 CacheTrainerSpellMap::const_iterator iter = m_mCacheTrainerSpellMap.find(entry); 727 if(iter == m_mCacheTrainerSpellMap.end()) 728 return NULL; 729 730 return &iter->second; 731 } 732 733 VendorItemList const* GetNpcVendorItemList(uint32 entry) const 734 { 735 CacheVendorItemMap::const_iterator iter = m_mCacheVendorItemMap.find(entry); 736 if(iter == m_mCacheVendorItemMap.end()) 737 return NULL; 738 739 return &iter->second; 666 740 } 667 741 protected: … … 721 795 722 796 GraveYardMap mGraveYardMap; 797 798 GameTeleMap m_GameTeleMap; 723 799 724 800 typedef std::vector<LocaleConstant> LocalForIndex; … … 771 847 ConditionStore mConditions; 772 848 849 CacheNpcTextIdMap m_mCacheNpcTextIdMap; 850 CacheVendorItemMap m_mCacheVendorItemMap; 851 CacheTrainerSpellMap m_mCacheTrainerSpellMap; 773 852 }; 774 853 775 854 #define objmgr MaNGOS::Singleton<ObjectMgr>::Instance() 855 856 // scripting access functions 857 bool MANGOS_DLL_SPEC LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min()); 858 MANGOS_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id); 859 776 860 #endif 777 778 // scripting access functions779 bool MANGOS_DLL_SPEC LoadMangosStrings(DatabaseType& db, char const* table);780 MANGOS_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id);