Changeset 44 for trunk/src/game/ObjectMgr.h
- Timestamp:
- 11/19/08 13:27:40 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ObjectMgr.h
r37 r44 1 1 /* 2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> 2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> 3 * 4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> 3 5 * 4 6 * This program is free software; you can redistribute it and/or modify … … 9 11 * This program is distributed in the hope that it will be useful, 10 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 14 * GNU General Public License for more details. 13 15 * 14 16 * You should have received a copy of the GNU General Public License 15 17 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 19 */ 18 20 … … 126 128 typedef HM_NAMESPACE::hash_map<uint64/*(instance,guid) pair*/,time_t> RespawnTimes; 127 129 128 struct MangosStringLocale130 struct TrinityStringLocale 129 131 { 130 132 std::vector<std::string> Content; // 0 -> default, i -> i-1 locale index … … 139 141 typedef HM_NAMESPACE::hash_map<uint32,NpcTextLocale> NpcTextLocaleMap; 140 142 typedef HM_NAMESPACE::hash_map<uint32,PageTextLocale> PageTextLocaleMap; 141 typedef HM_NAMESPACE::hash_map<uint32, MangosStringLocale> MangosStringLocaleMap;143 typedef HM_NAMESPACE::hash_map<uint32,TrinityStringLocale> TrinityStringLocaleMap; 142 144 143 145 typedef std::multimap<uint32,uint32> QuestRelations; … … 249 251 bool normalizePlayerName(std::string& name); 250 252 251 struct MANGOS_DLL_SPEC LanguageDesc253 struct TRINITY_DLL_SPEC LanguageDesc 252 254 { 253 255 Language lang_id; … … 257 259 258 260 extern LanguageDesc lang_description[LANGUAGES_COUNT]; 259 MANGOS_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang);261 TRINITY_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang); 260 262 261 263 class PlayerDumpReader; … … 442 444 WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team); 443 445 bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true); 446 void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false); 444 447 void LoadGraveyardZones(); 445 448 GraveYardData const* FindGraveYardData(uint32 id, uint32 zone); … … 500 503 void LoadSpellScripts(); 501 504 502 bool Load MangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);503 bool Load MangosStrings() { return LoadMangosStrings(WorldDatabase,"mangos_string",1,std::numeric_limits<int32>::max()); }505 bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value); 506 bool LoadTrinityStrings() { return LoadTrinityStrings(WorldDatabase,"trinity_string",1,std::numeric_limits<int32>::max()); } 504 507 void LoadPetCreateSpells(); 505 508 void LoadCreatureLocales(); … … 651 654 void DeleteGOData(uint32 guid); 652 655 653 MangosStringLocale const* GetMangosStringLocale(int32 entry) const654 { 655 MangosStringLocaleMap::const_iterator itr = mMangosStringLocaleMap.find(entry);656 if(itr==m MangosStringLocaleMap.end()) return NULL;657 return &itr->second; 658 } 659 const char *Get MangosString(int32 entry, int locale_idx) const;660 const char *Get MangosStringForDBCLocale(int32 entry) const { return GetMangosString(entry,DBCLocaleIndex); }656 TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const 657 { 658 TrinityStringLocaleMap::const_iterator itr = mTrinityStringLocaleMap.find(entry); 659 if(itr==mTrinityStringLocaleMap.end()) return NULL; 660 return &itr->second; 661 } 662 const char *GetTrinityString(int32 entry, int locale_idx) const; 663 const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry,DBCLocaleIndex); } 661 664 void SetDBCLocaleIndex(uint32 lang) { DBCLocaleIndex = GetIndexForLocale(LocaleConstant(lang)); } 662 665 … … 741 744 return &iter->second; 742 745 } 743 void AddVendorItem(uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost );744 bool RemoveVendorItem(uint32 entry,uint32 item );745 bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL 746 void AddVendorItem(uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); 747 bool RemoveVendorItem(uint32 entry,uint32 item, bool savetodb = true); 748 bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const; 746 749 protected: 747 750 uint32 m_auctionid; … … 841 844 NpcTextLocaleMap mNpcTextLocaleMap; 842 845 PageTextLocaleMap mPageTextLocaleMap; 843 MangosStringLocaleMap mMangosStringLocaleMap;846 TrinityStringLocaleMap mTrinityStringLocaleMap; 844 847 RespawnTimes mCreatureRespawnTimes; 845 848 RespawnTimes mGORespawnTimes; … … 857 860 }; 858 861 859 #define objmgr MaNGOS::Singleton<ObjectMgr>::Instance()862 #define objmgr Trinity::Singleton<ObjectMgr>::Instance() 860 863 861 864 // scripting access functions 862 bool MANGOS_DLL_SPEC LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min());863 MANGOS_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id);865 bool TRINITY_DLL_SPEC LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min()); 866 TRINITY_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id); 864 867 865 868 #endif