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

[svn] * Added ACE for Linux and Windows (Thanks Derex for Linux part and partial Windows part)
* Updated to 6721 and 676
* Fixed TrinityScript? logo
* Version updated to 0.2.6721.676

Original author: Neo2003
Date: 2008-10-04 06:17:19-05:00

Files:
1 modified

Legend:

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

    r2 r6  
    4343#include <string> 
    4444#include <map> 
     45#include <limits> 
    4546 
    4647extern SQLStorage sCreatureStorage; 
     
    6061class TransportPath; 
    6162class Item; 
     63 
     64struct 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 
     75typedef HM_NAMESPACE::hash_map<uint32, GameTele > GameTeleMap; 
    6276 
    6377struct ScriptInfo 
     
    144158    uint32 repfaction2; 
    145159    bool is_teamaward1; 
    146     uint32 reputration_max_cap1; 
     160    uint32 reputation_max_cap1; 
    147161    int32 repvalue1; 
    148162    bool is_teamaward2; 
    149     uint32 reputration_max_cap2; 
     163    uint32 reputation_max_cap2; 
    150164    int32 repvalue2; 
    151165    bool team_dependent; 
     
    212226}; 
    213227 
     228// NPC gossip text id 
     229typedef HM_NAMESPACE::hash_map<uint32, uint32> CacheNpcTextIdMap; 
     230 
     231// Vendors 
     232struct VendorItem 
     233{ 
     234    uint32 item; 
     235    uint32 maxcount; 
     236    uint32 incrtime; 
     237    uint32 ExtendedCost; 
     238}; 
     239typedef std::vector<VendorItem*> VendorItemList; 
     240 
     241typedef HM_NAMESPACE::hash_map<uint32, VendorItemList> CacheVendorItemMap; 
     242 
     243typedef HM_NAMESPACE::hash_map<uint32, TrainerSpellData> CacheTrainerSpellMap; 
     244 
    214245enum SkillRangeType 
    215246{ 
     
    467498        void LoadSpellScripts(); 
    468499 
    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()); } 
    471502        void LoadPetCreateSpells(); 
    472503        void LoadCreatureLocales(); 
     
    513544 
    514545        void LoadWeatherZoneChances(); 
     546        void LoadGameTele(); 
     547 
     548        void LoadNpcTextId(); 
     549        void LoadVendors(); 
     550        void LoadTrainerSpell(); 
    515551 
    516552        std::string GeneratePetName(uint32 entry); 
     
    664700 
    665701            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; 
    666740        } 
    667741    protected: 
     
    721795 
    722796        GraveYardMap        mGraveYardMap; 
     797 
     798        GameTeleMap         m_GameTeleMap; 
    723799 
    724800        typedef             std::vector<LocaleConstant> LocalForIndex; 
     
    771847        ConditionStore mConditions; 
    772848 
     849        CacheNpcTextIdMap m_mCacheNpcTextIdMap; 
     850        CacheVendorItemMap m_mCacheVendorItemMap; 
     851        CacheTrainerSpellMap m_mCacheTrainerSpellMap; 
    773852}; 
    774853 
    775854#define objmgr MaNGOS::Singleton<ObjectMgr>::Instance() 
     855 
     856// scripting access functions 
     857bool MANGOS_DLL_SPEC LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min()); 
     858MANGOS_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id); 
     859 
    776860#endif 
    777  
    778 // scripting access functions 
    779 bool MANGOS_DLL_SPEC LoadMangosStrings(DatabaseType& db, char const* table); 
    780 MANGOS_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id);