Update Map for 322a and new instance system

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-17 11:30:18 +01:00
parent 360edd11df
commit 9f45beb67e
10 changed files with 180 additions and 138 deletions
+14 -6
View File
@@ -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 &notifier)
cell_lock->Visit(cell_lock, grid_object_notifier, *this, radius, x_off, y_off);
}
#endif