aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ObjectMgr.h')
-rw-r--r--src/game/ObjectMgr.h100
1 files changed, 62 insertions, 38 deletions
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 8de6c3333b3..3c52eaa2546 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -145,6 +145,7 @@ typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap;
typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
typedef UNORDERED_MAP<uint32,TrinityStringLocale> TrinityStringLocaleMap;
typedef UNORDERED_MAP<uint32,NpcOptionLocale> NpcOptionLocaleMap;
+typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap;
typedef std::multimap<uint32,uint32> QuestRelations;
@@ -171,6 +172,17 @@ struct ReputationOnKillEntry
bool team_dependent;
};
+struct PointOfInterest
+{
+ uint32 entry;
+ float x;
+ float y;
+ uint32 icon;
+ uint32 flags;
+ uint32 data;
+ std::string icon_name;
+};
+
struct PetCreateSpellEntry
{
uint32 spellid[4];
@@ -311,6 +323,7 @@ class ObjectMgr
typedef UNORDERED_MAP<uint32, AccessRequirement> AccessRequirementMap;
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
+ typedef UNORDERED_MAP<uint32, PointOfInterest> PointOfInterestMap;
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
@@ -333,13 +346,13 @@ class ObjectMgr
void RemoveGroup(Group* group) { mGroupSet.erase( group ); }
Guild* GetGuildByLeader(uint64 const&guid) const;
- Guild* GetGuildById(const uint32 GuildId) const;
+ Guild* GetGuildById(uint32 GuildId) const;
Guild* GetGuildByName(const std::string& guildname) const;
- std::string GetGuildNameById(const uint32 GuildId) const;
+ std::string GetGuildNameById(uint32 GuildId) const;
void AddGuild(Guild* guild);
void RemoveGuild(uint32 Id);
- ArenaTeam* GetArenaTeamById(const uint32 arenateamid) const;
+ ArenaTeam* GetArenaTeamById(uint32 arenateamid) const;
ArenaTeam* GetArenaTeamByName(const std::string& arenateamname) const;
ArenaTeam* GetArenaTeamByCaptain(uint64 const& guid) const;
void AddArenaTeam(ArenaTeam* arenaTeam);
@@ -394,7 +407,7 @@ class ObjectMgr
uint32 GetPlayerAccountIdByGUID(const uint64 &guid) const;
uint32 GetPlayerAccountIdByPlayerName(const std::string& name) const;
- uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid );
+ uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team );
void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost);
uint16 GetTaxiMount( uint32 id, uint32 team );
void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint32>& mapIds );
@@ -414,26 +427,19 @@ class ObjectMgr
return itr->second;
return 0;
}
- bool IsTavernAreaTrigger(uint32 Trigger_ID) const { return mTavernAreaTriggerSet.count(Trigger_ID) != 0; }
- bool IsGameObjectForQuests(uint32 entry) const { return mGameObjectForQuestSet.count(entry) != 0; }
- bool IsGuildVaultGameObject(Player *player, uint64 guid) const
+ bool IsTavernAreaTrigger(uint32 Trigger_ID) const
{
- if(GameObject *go = ObjectAccessor::GetGameObject(*player, guid))
- if(go->GetGoType() == GAMEOBJECT_TYPE_GUILD_BANK)
- return true;
- return false;
+ return mTavernAreaTriggerSet.find(Trigger_ID) != mTavernAreaTriggerSet.end();
}
- uint32 GetBattleMasterBG(uint32 entry) const
+ bool IsGameObjectForQuests(uint32 entry) const
{
- BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
- if(itr != mBattleMastersMap.end())
- return itr->second;
- return 2; //BATTLEGROUND_WS - i will not add include only for constant usage!
+ return mGameObjectForQuestSet.find(entry) != mGameObjectForQuestSet.end();
}
- void AddGossipText(GossipText *pGText);
- GossipText *GetGossipText(uint32 Text_ID);
+ bool IsGameObjectOfTypeInRange(Player *player, uint64 guid, GameobjectTypes type) const;
+
+ GossipText const* GetGossipText(uint32 Text_ID) const;
WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);
@@ -458,6 +464,7 @@ class ObjectMgr
}
AreaTrigger const* GetGoBackTrigger(uint32 Map) const;
+ AreaTrigger const* GetMapEntranceTrigger(uint32 Map) const;
uint32 GetAreaTriggerScriptId(uint32 trigger_id);
@@ -469,6 +476,14 @@ class ObjectMgr
return NULL;
}
+ PointOfInterest const* GetPointOfInterest(uint32 id) const
+ {
+ PointOfInterestMap::const_iterator itr = mPointsOfInterest.find(id);
+ if(itr != mPointsOfInterest.end())
+ return &itr->second;
+ return NULL;
+ }
+
PetCreateSpellEntry const* GetPetCreateSpellEntry(uint32 id) const
{
PetCreateSpellMap::const_iterator itr = mPetCreateSpell.find(id);
@@ -530,6 +545,7 @@ class ObjectMgr
void LoadNpcTextLocales();
void LoadPageTextLocales();
void LoadNpcOptionLocales();
+ void LoadPointOfInterestLocales();
void LoadInstanceTemplate();
void LoadGossipText();
@@ -539,7 +555,6 @@ class ObjectMgr
void LoadQuestAreaTriggers();
void LoadAreaTriggerScripts();
void LoadTavernAreaTriggers();
- void LoadBattleMastersEntry();
void LoadGameObjectForQuests();
void LoadItemTexts();
@@ -554,6 +569,7 @@ class ObjectMgr
void LoadFishingBaseSkillLevel();
void LoadReputationOnKill();
+ void LoadPointsOfInterest();
void LoadWeatherZoneChances();
void LoadGameTele();
@@ -565,6 +581,7 @@ class ObjectMgr
std::string GeneratePetName(uint32 entry);
uint32 GetBaseXP(uint32 level);
+ uint32 GetXPForLevel(uint32 level);
int32 GetFishingBaseSkillLevel(uint32 entry) const
{
@@ -576,12 +593,12 @@ class ObjectMgr
void SetHighestGuids();
uint32 GenerateLowGuid(HighGuid guidhigh);
+ uint32 GenerateArenaTeamId();
uint32 GenerateAuctionID();
- uint32 GenerateMailID();
+ uint32 GenerateGuildId();
uint32 GenerateItemTextID();
+ uint32 GenerateMailID();
uint32 GeneratePetNumber();
- uint32 GenerateArenaTeamId();
- uint32 GenerateGuildId();
void LoadPlayerInfoInCache();
PCachePlayerInfo GetPlayerInfoFromCache(uint32 unPlayerGuid) const;
@@ -670,6 +687,12 @@ class ObjectMgr
if(itr==mNpcOptionLocaleMap.end()) return NULL;
return &itr->second;
}
+ PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
+ {
+ PointOfInterestLocaleMap::const_iterator itr = mPointOfInterestLocaleMap.find(poi_id);
+ if(itr==mPointOfInterestLocaleMap.end()) return NULL;
+ return &itr->second;
+ }
GameObjectData const* GetGOData(uint32 guid) const
{
@@ -708,10 +731,7 @@ class ObjectMgr
// reserved names
void LoadReservedPlayersNames();
- bool IsReservedName(const std::string& name) const
- {
- return m_ReservedNames.find(name) != m_ReservedNames.end();
- }
+ bool IsReservedName(const std::string& name) const;
// name with valid structure and symbols
static bool IsValidName( const std::string& name, bool create = false );
@@ -786,20 +806,23 @@ class ObjectMgr
ScriptNameMap &GetScriptNames() { return m_scriptNames; }
const char * GetScriptName(uint32 id) { return id < m_scriptNames.size() ? m_scriptNames[id].c_str() : ""; }
uint32 GetScriptId(const char *name);
+
+ int GetOrNewIndexForLocale(LocaleConstant loc);
protected:
// first free id for selected id type
- uint32 m_auctionid;
- uint32 m_mailid;
- uint32 m_ItemTextId;
uint32 m_arenaTeamId;
+ uint32 m_auctionid;
uint32 m_guildId;
+ uint32 m_ItemTextId;
+ uint32 m_mailid;
uint32 m_hiPetNumber;
// first free low guid for seelcted guid type
uint32 m_hiCharGuid;
uint32 m_hiCreatureGuid;
uint32 m_hiPetGuid;
+ uint32 m_hiVehicleGuid;
uint32 m_hiItemGuid;
uint32 m_hiGoGuid;
uint32 m_hiDoGuid;
@@ -807,9 +830,8 @@ class ObjectMgr
QuestMap mQuestTemplates;
- typedef UNORDERED_MAP<uint32, GossipText*> GossipTextMap;
+ typedef UNORDERED_MAP<uint32, GossipText> GossipTextMap;
typedef UNORDERED_MAP<uint32, uint32> QuestAreaTriggerMap;
- typedef UNORDERED_MAP<uint32, uint32> BattleMastersMap;
typedef UNORDERED_MAP<uint32, std::string> ItemTextMap;
typedef std::set<uint32> TavernAreaTriggerSet;
typedef std::set<uint32> GameObjectForQuestSet;
@@ -818,12 +840,9 @@ class ObjectMgr
GuildMap mGuildMap;
ArenaTeamMap mArenaTeamMap;
- ItemMap mItems;
-
ItemTextMap mItemTexts;
QuestAreaTriggerMap mQuestAreaTriggerMap;
- BattleMastersMap mBattleMastersMap;
TavernAreaTriggerSet mTavernAreaTriggerSet;
GameObjectForQuestSet mGameObjectForQuestSet;
GossipTextMap mGossipText;
@@ -833,12 +852,14 @@ class ObjectMgr
RepOnKillMap mRepOnKill;
+ PointOfInterestMap mPointsOfInterest;
+
WeatherZoneMap mWeatherZoneMap;
PetCreateSpellMap mPetCreateSpell;
//character reserved names
- typedef std::set<std::string> ReservedNamesMap;
+ typedef std::set<std::wstring> ReservedNamesMap;
ReservedNamesMap m_ReservedNames;
std::set<uint32> m_DisabledPlayerSpells;
@@ -853,7 +874,6 @@ class ObjectMgr
typedef std::vector<LocaleConstant> LocalForIndex;
LocalForIndex m_LocalForIndex;
- int GetOrNewIndexForLocale(LocaleConstant loc);
int DBCLocaleIndex;
@@ -872,6 +892,9 @@ class ObjectMgr
void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const;
PlayerInfo playerInfo[MAX_RACES][MAX_CLASSES];
+ typedef std::vector<uint32> PlayerXPperLevel; // [level]
+ PlayerXPperLevel mPlayerXPperLevel;
+
typedef std::map<uint32,uint32> BaseXPMap; // [area level][base xp]
BaseXPMap mBaseXPTable;
@@ -894,6 +917,7 @@ class ObjectMgr
PageTextLocaleMap mPageTextLocaleMap;
TrinityStringLocaleMap mTrinityStringLocaleMap;
NpcOptionLocaleMap mNpcOptionLocaleMap;
+ PointOfInterestLocaleMap mPointOfInterestLocaleMap;
RespawnTimes mCreatureRespawnTimes;
RespawnTimes mGORespawnTimes;