Show
Ignore:
Timestamp:
11/19/08 13:27:40 (17 years ago)
Author:
yumileroy
Message:

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/ObjectMgr.h

    r37 r44  
    11/*  
    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/> 
    35 * 
    46 * This program is free software; you can redistribute it and/or modify 
     
    911 * This program is distributed in the hope that it will be useful, 
    1012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    1214 * GNU General Public License for more details. 
    1315 * 
    1416 * You should have received a copy of the GNU General Public License 
    1517 * along with this program; if not, write to the Free Software 
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    1719 */ 
    1820 
     
    126128typedef HM_NAMESPACE::hash_map<uint64/*(instance,guid) pair*/,time_t> RespawnTimes; 
    127129 
    128 struct MangosStringLocale 
     130struct TrinityStringLocale 
    129131{ 
    130132    std::vector<std::string> Content;                       // 0 -> default, i -> i-1 locale index 
     
    139141typedef HM_NAMESPACE::hash_map<uint32,NpcTextLocale> NpcTextLocaleMap; 
    140142typedef HM_NAMESPACE::hash_map<uint32,PageTextLocale> PageTextLocaleMap; 
    141 typedef HM_NAMESPACE::hash_map<uint32,MangosStringLocale> MangosStringLocaleMap; 
     143typedef HM_NAMESPACE::hash_map<uint32,TrinityStringLocale> TrinityStringLocaleMap; 
    142144 
    143145typedef std::multimap<uint32,uint32> QuestRelations; 
     
    249251bool normalizePlayerName(std::string& name); 
    250252 
    251 struct MANGOS_DLL_SPEC LanguageDesc 
     253struct TRINITY_DLL_SPEC LanguageDesc 
    252254{ 
    253255    Language lang_id; 
     
    257259 
    258260extern LanguageDesc lang_description[LANGUAGES_COUNT]; 
    259 MANGOS_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang); 
     261TRINITY_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang); 
    260262 
    261263class PlayerDumpReader; 
     
    442444        WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team); 
    443445        bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true); 
     446        void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false); 
    444447        void LoadGraveyardZones(); 
    445448        GraveYardData const* FindGraveYardData(uint32 id, uint32 zone); 
     
    500503        void LoadSpellScripts(); 
    501504 
    502         bool LoadMangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value); 
    503         bool LoadMangosStrings() { 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()); } 
    504507        void LoadPetCreateSpells(); 
    505508        void LoadCreatureLocales(); 
     
    651654        void DeleteGOData(uint32 guid); 
    652655 
    653         MangosStringLocale const* GetMangosStringLocale(int32 entry) const 
    654         { 
    655             MangosStringLocaleMap::const_iterator itr = mMangosStringLocaleMap.find(entry); 
    656             if(itr==mMangosStringLocaleMap.end()) return NULL; 
    657             return &itr->second; 
    658         } 
    659         const char *GetMangosString(int32 entry, int locale_idx) const; 
    660         const char *GetMangosStringForDBCLocale(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); } 
    661664        void SetDBCLocaleIndex(uint32 lang) { DBCLocaleIndex = GetIndexForLocale(LocaleConstant(lang)); } 
    662665 
     
    741744            return &iter->second; 
    742745        } 
    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 ) const; 
     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; 
    746749    protected: 
    747750        uint32 m_auctionid; 
     
    841844        NpcTextLocaleMap mNpcTextLocaleMap; 
    842845        PageTextLocaleMap mPageTextLocaleMap; 
    843         MangosStringLocaleMap mMangosStringLocaleMap; 
     846        TrinityStringLocaleMap mTrinityStringLocaleMap; 
    844847        RespawnTimes mCreatureRespawnTimes; 
    845848        RespawnTimes mGORespawnTimes; 
     
    857860}; 
    858861 
    859 #define objmgr MaNGOS::Singleton<ObjectMgr>::Instance() 
     862#define objmgr Trinity::Singleton<ObjectMgr>::Instance() 
    860863 
    861864// 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); 
     865bool TRINITY_DLL_SPEC LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min()); 
     866TRINITY_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id); 
    864867 
    865868#endif