diff options
author | n0n4m3 <none@none> | 2009-12-17 11:30:18 +0100 |
---|---|---|
committer | n0n4m3 <none@none> | 2009-12-17 11:30:18 +0100 |
commit | 9f45beb67e2e8bcc54b18bea9b1eb022f166e7b5 (patch) | |
tree | 8f58d01282bd26c9c32e15f561da24b621f10259 /src/game/Map.h | |
parent | 360edd11df3911567000d5e150f3ede22af112f5 (diff) |
Update Map for 322a and new instance system
--HG--
branch : trunk
Diffstat (limited to 'src/game/Map.h')
-rw-r--r-- | src/game/Map.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/game/Map.h b/src/game/Map.h index fa4e7a03468..981a48bbbb6 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -51,6 +51,7 @@ class CreatureGroup; struct ScriptInfo; struct ScriptAction; struct Position; +class BattleGround; typedef ACE_RW_Thread_Mutex GridRWLock; @@ -229,9 +230,6 @@ struct InstanceTemplate { uint32 map; uint32 parent; - uint32 maxPlayers; - uint32 maxPlayersHeroic; - uint32 reset_delay; // FIX ME: now exist normal/heroic raids with possible different time of reset. uint32 access_id; float startLocX; float startLocY; @@ -383,7 +381,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj // NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); } bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); } - bool IsHeroic() const { return i_spawnMode == DIFFICULTY_HEROIC; } + bool IsRaidOrHeroicDungeon() const { return IsRaid() || i_spawnMode > DUNGEON_DIFFICULTY_NORMAL; } + bool IsHeroic() const { return IsRaid() ? i_spawnMode >= RAID_DIFFICULTY_10MAN_HEROIC : i_spawnMode >= DUNGEON_DIFFICULTY_HEROIC; } bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); } bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); } bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); } @@ -610,7 +609,13 @@ class TRINITY_DLL_SPEC InstanceMap : public Map bool CanEnter(Player* player); void SendResetWarnings(uint32 timeLeft) const; void SetResetSchedule(bool on); + + // have meaning only for instanced map (that have set real difficulty) + Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); } + bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DIFFICULTY; } uint32 GetMaxPlayers() const; + uint32 GetMaxResetDelay() const; + MapDifficulty const* GetMapDifficulty() const; virtual void InitVisibilityDistance(); private: @@ -623,7 +628,7 @@ class TRINITY_DLL_SPEC InstanceMap : public Map class TRINITY_DLL_SPEC BattleGroundMap : public Map { public: - BattleGroundMap(uint32 id, time_t, uint32 InstanceId, Map* _parent); + BattleGroundMap(uint32 id, time_t, uint32 InstanceId, Map* _parent, uint8 spawnMode); ~BattleGroundMap(); bool Add(Player *); @@ -634,6 +639,10 @@ class TRINITY_DLL_SPEC BattleGroundMap : public Map void RemoveAllPlayers(); virtual void InitVisibilityDistance(); + BattleGround* GetBG() { return m_bg; } + void SetBG(BattleGround* bg) { m_bg = bg; } + private: + BattleGround* m_bg; }; /*inline @@ -710,4 +719,3 @@ Map::VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier) cell_lock->Visit(cell_lock, grid_object_notifier, *this, radius, x_off, y_off); } #endif - |