77#define MAP_AREA_NO_AREA 0x0001
86#define MAP_HEIGHT_NO_HEIGHT 0x0001
87#define MAP_HEIGHT_AS_INT16 0x0002
88#define MAP_HEIGHT_AS_INT8 0x0004
98#define MAP_LIQUID_NO_TYPE 0x0001
99#define MAP_LIQUID_NO_HEIGHT 0x0002
122#define MAP_LIQUID_TYPE_NO_WATER 0x00
123#define MAP_LIQUID_TYPE_WATER 0x01
124#define MAP_LIQUID_TYPE_OCEAN 0x02
125#define MAP_LIQUID_TYPE_MAGMA 0x04
126#define MAP_LIQUID_TYPE_SLIME 0x08
128#define MAP_ALL_LIQUIDS (MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN | MAP_LIQUID_TYPE_MAGMA | MAP_LIQUID_TYPE_SLIME)
130#define MAP_LIQUID_TYPE_DARK_WATER 0x10
131#define MAP_LIQUID_TYPE_WMO_WATER 0x20
141#define MAX_HEIGHT 100000.0f
142#define INVALID_HEIGHT -100000.0f
143#define MAX_FALL_DISTANCE 250000.0f
144#define DEFAULT_HEIGHT_SEARCH 50.0f
145#define MIN_UNLOAD_DELAY 1
204 inline float getHeight(
float x,
float y)
const {
return (this->*m_gridGetHeight)(x, y); }
261 template<
class T>
bool AddToMap(T*);
319 bool IsOutdoors(
float x,
float y,
float z)
const;
383 return i_mapEntry->GetEntrancePos(mapid, x, y);
422 template<
class NOTIFIER>
void VisitAll(
const float& x,
const float& y,
float radius, NOTIFIER& notifier);
423 template<
class NOTIFIER>
void VisitFirstFound(
const float& x,
const float& y,
float radius, NOTIFIER& notifier);
424 template<
class NOTIFIER>
void VisitWorld(
const float& x,
const float& y,
float radius, NOTIFIER& notifier);
425 template<
class NOTIFIER>
void VisitGrid(
const float& x,
const float& y,
float radius, NOTIFIER& notifier);
442 float GetWaterOrGroundLevel(
float x,
float y,
float z,
float* ground = NULL,
bool swim =
false)
const;
444 bool isInLineOfSight(
float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
uint32 phasemask)
const;
449 bool getObjectHitPos(
uint32 phasemask,
float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float& rx,
float& ry,
float& rz,
float modifyDist);
490 void LoadMap(
int gx,
int gy,
bool reload =
false);
580 std::bitset<TOTAL_NUMBER_OF_CELLS_PER_MAP* TOTAL_NUMBER_OF_CELLS_PER_MAP>
marked_cells;
685template<
class T,
class CONTAINER>
700template<
class NOTIFIER>
701inline void Map::VisitAll(
float const& x,
float const& y,
float radius, NOTIFIER& notifier)
708 cell.
Visit(p, world_object_notifier, *
this, radius, x, y);
710 cell.
Visit(p, grid_object_notifier, *
this, radius, x, y);
714template<
class NOTIFIER>
722 cell.
Visit(p, world_object_notifier, *
this, radius, x, y);
723 if (!notifier.i_object)
726 cell.
Visit(p, grid_object_notifier, *
this, radius, x, y);
730template<
class NOTIFIER>
731inline void Map::VisitWorld(
const float& x,
const float& y,
float radius, NOTIFIER& notifier)
738 cell.
Visit(p, world_object_notifier, *
this, radius, x, y);
741template<
class NOTIFIER>
742inline void Map::VisitGrid(
const float& x,
const float& y,
float radius, NOTIFIER& notifier)
749 cell.
Visit(p, grid_object_notifier, *
this, radius, x, y);
CoordPair< MAX_NUMBER_OF_GRIDS > GridCoord
#define MAX_NUMBER_OF_GRIDS
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
NGrid< MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes > NGridType
#define DEFAULT_HEIGHT_SEARCH
std::map< uint32, CreatureGroup * > CreatureGroupHolderType
@ INSTANCE_RESET_GROUP_DISBAND
@ INSTANCE_RESET_CHANGE_DIFFICULTY
@ INSTANCE_RESET_GROUP_JOIN
@ INSTANCE_RESET_RESPAWN_DELAY
@ LEVELREQUIREMENT_HEROIC
BattlegroundMap(uint32 id, time_t, uint32 InstanceId, Map *_parent, uint8 spawnMode)
void SetBG(Battleground *bg)
bool loadAreaData(FILE *in, uint32 offset, uint32 size)
GetHeightPtr m_gridGetHeight
float getHeightFromFlat(float x, float y) const
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data=0)
uint16 getArea(float x, float y) const
uint8 getTerrainType(float x, float y) const
float getHeightFromFloat(float x, float y) const
float getHeightFromUint16(float x, float y) const
float(GridMap::* GetHeightPtr)(float x, float y) const
bool loadData(char *filaname)
float getLiquidLevel(float x, float y) const
float getHeightFromUint8(float x, float y) const
float getHeight(float x, float y) const
bool loadHeightData(FILE *in, uint32 offset, uint32 size)
bool loadLiquidData(FILE *in, uint32 offset, uint32 size)
float m_gridIntHeightMultiplier
void CreateInstanceData(bool load)
void PermBindAllPlayers(Player *source)
void SendResetWarnings(uint32 timeLeft) const
uint32 GetMaxPlayers() const
uint32 GetScriptId() const
uint32 GetMaxResetDelay() const
bool CanEnter(Player *player) OVERRIDE
bool Reset(InstanceResetMethod method)
InstanceMap(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode, Map *_parent)
bool AddPlayerToMap(Player *) OVERRIDE
void SetResetSchedule(bool on)
void Update(const uint32) OVERRIDE
InstanceScript * GetInstanceScript()
void RemovePlayerFromMap(Player *, bool) OVERRIDE
virtual void InitVisibilityDistance() OVERRIDE
void UnloadAll() OVERRIDE
MapEntry const * i_mapEntry
std::map< WorldObject *, bool > i_objectsToSwitch
void UpdateObjectVisibility(WorldObject *obj, Cell cell, CellCoord cellpair)
void VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier)
float GetWaterLevel(float x, float y) const
std::vector< Creature * > _creaturesToMove
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const
void GameObjectRelocation(GameObject *go, float x, float y, float z, float orientation, bool respawnRelocationOnFail=true)
void AddGameObjectToMoveList(GameObject *go, float x, float y, float z, float ang)
void CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Put scripts in the execution queue.
bool IsBattlegroundOrArena() const
void RemoveGameObjectModel(const GameObjectModel &model)
void RemoveFromActive(T *obj)
bool UnloadGrid(NGridType &ngrid, bool pForce)
DifficultyID GetDifficulty() const
static void GetZoneAndAreaIdByAreaFlag(uint32 &zoneid, uint32 &areaid, uint16 areaflag, uint32 map_id)
TransportsContainer::iterator _transportsUpdateIter
void InitializeObject(T *obj)
static void DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId)
void SwitchGridContainers(T *obj, bool on)
void AddObjectToRemoveList(WorldObject *obj)
virtual void RemovePlayerFromMap(Player *, bool)
time_t GetGORespawnTime(uint32 dbGuid) const
void MoveAllGameObjectsInMoveList()
void RemoveFromActiveHelper(WorldObject *obj)
const MapInstanced * ToMapInstanced() const
void LoadGrid(float x, float y)
uint32 GetZoneId(float x, float y, float z) const
void PreserveTransportVisibility(std::set< uint64 > &guids) const
GameObject * _FindGameObject(WorldObject *pWorldObject, uint32 guid) const
Map(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode, Map *_parent=NULL)
Transport * GetTransport(uint64 guid)
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
bool getObjectHitPos(uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float modifyDist)
uint8 GetTerrainType(float x, float y) const
void DeleteRespawnTimes()
virtual uint32 GetOwnerGuildId(uint32=TEAM_OTHER) const
NGridType * i_grids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]
uint8 GetSpawnMode() const
MapDifficulty const * GetMapDifficulty() const
void SaveGORespawnTime(uint32 dbGuid, time_t respawnTime)
uint32 GetAreaId(float x, float y, float z) const
bool IsBattleground() const
void LoadMMap(int gx, int gy)
virtual void Update(const uint32)
bool CanUnload(uint32 diff)
void VisitFirstFound(const float &x, const float &y, float radius, NOTIFIER ¬ifier)
void EnsureGridCreated(const GridCoord &)
void ProcessRelocationNotifies(const uint32 diff)
bool GetEntrancePos(int32 &mapid, float &x, float &y)
NGridType * getNGrid(uint32 x, uint32 y) const
void AddToActiveHelper(WorldObject *obj)
bool _gameObjectsToMoveLock
Map const * GetParent() const
Creature * _GetScriptCreature(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
static uint32 GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id)
const InstanceMap * ToInstanceMap() const
bool IsRemovalGrid(float x, float y) const
void UpdateActiveCells(const float &x, const float &y, const uint32 t_diff)
MapRefManager m_mapRefManager
bool ActiveObjectsNearGrid(NGridType const &ngrid) const
virtual void DelayedUpdate(const uint32 diff)
void RemoveCreatureFromMoveList(Creature *c)
void RemoveGORespawnTime(uint32 dbGuid)
void ScriptsProcess()
Process queued scripts.
ScriptScheduleMap m_scriptSchedule
void AddWorldObject(WorldObject *obj)
void ResetGridExpiry(NGridType &grid, float factor=1) const
DynamicMapTree _dynamicTree
std::vector< GameObject * > _gameObjectsToMove
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=NULL)
void ScriptCommandStart(ScriptInfo const &script, uint32 delay, Object *source, Object *target)
bool GameObjectRespawnRelocation(GameObject *go, bool diffGridOnly)
int32 m_VisibilityNotifyPeriod
time_t GetCreatureRespawnTime(uint32 dbGuid) const
void EnsureGridLoadedForActiveObject(Cell const &, WorldObject *object)
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
GameObject * GetGameObject(uint64 guid)
void LoadMap(int gx, int gy, bool reload=false)
void LoadVMap(int gx, int gy)
void SendInitSelf(Player *player)
virtual void RemoveAllPlayers()
bool isCellMarked(uint32 pCellId)
bool GameObjectCellRelocation(GameObject *go, Cell new_cell)
void SendToPlayers(WorldPacket const *data) const
void SaveCreatureRespawnTime(uint32 dbGuid, time_t respawnTime)
bool IsUnderWater(float x, float y, float z) const
GridMap * GetGrid(float x, float y)
static void DeleteStateMachine()
MapRefManager::iterator m_mapRefIter
bool CreatureCellRelocation(Creature *creature, Cell new_cell)
void SetUnloadLock(const GridCoord &p, bool on)
bool GetUnloadLock(const GridCoord &p) const
std::multimap< time_t, ScriptAction > ScriptScheduleMap
std::bitset< TOTAL_NUMBER_OF_CELLS_PER_MAP *TOTAL_NUMBER_OF_CELLS_PER_MAP > marked_cells
bool IsInWater(float x, float y, float z, LiquidData *data=0) const
uint16 GetAreaFlag(float x, float y, float z, bool *isOutdoors=0) const
Creature * _GetScriptCreatureSourceOrTarget(Object *source, Object *target, const ScriptInfo *scriptInfo, bool bReverse=false) const
WorldObject * _GetScriptWorldObject(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
virtual bool CanEnter(Player *)
void VisitAll(const float &x, const float &y, float radius, NOTIFIER ¬ifier)
void RemoveGameObjectFromMoveList(GameObject *go)
void EnsureGridCreated_i(const GridCoord &)
Creature * GetCreature(uint64 guid)
void RemoveWorldObject(WorldObject *obj)
std::set< WorldObject * > i_worldObjects
ActiveNonPlayers m_activeNonPlayers
void UpdateIteratorBack(Player *player)
bool Instanceable() const
float GetWaterOrGroundLevel(float x, float y, float z, float *ground=NULL, bool swim=false) const
void LoadMapAndVMap(int gx, int gy)
std::set< Transport * > TransportsContainer
UNORDERED_MAP< uint32, time_t > _goRespawnTimes
void buildNGridLinkage(NGridType *pNGridType)
void Visit(const Cell &cell, TypeContainerVisitor< T, CONTAINER > &visitor)
MapEntry const * GetEntry() const
bool IsRegularDifficulty() const
std::set< WorldObject * > i_objectsToRemove
void AddToGrid(T *object, Cell const &cell)
uint32 GetPlayersCountExceptGMs() const
bool IsGridLoaded(float x, float y) const
void DeleteFromWorld(T *)
friend class MapReference
void SendInitTransports(Player *player)
bool IsOutdoors(float x, float y, float z) const
float GetVisibilityRange() const
void VisitWorld(const float &x, const float &y, float radius, NOTIFIER ¬ifier)
bool IsRaidOrHeroicDungeon() const
void UpdateObjectsVisibilityFor(Player *player, Cell cell, CellCoord cellpair)
bool CheckGridIntegrity(Creature *c, bool moved) const
const char * GetMapName() const
void SetUnloadReferenceLock(const GridCoord &p, bool on)
InstanceMap * ToInstanceMap()
void RemoveAllObjectsInRemoveList()
void MoveAllCreaturesInMoveList()
CreatureGroupHolderType CreatureGroupHolder
std::set< WorldObject * > ActiveNonPlayers
DynamicObject * GetDynamicObject(uint64 guid)
void markCell(uint32 pCellId)
Player * _GetScriptPlayerSourceOrTarget(Object *source, Object *target, const ScriptInfo *scriptInfo) const
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid, float x, float y, float z) const
void AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang)
time_t GetGridExpiry(void) const
virtual void InitVisibilityDistance()
void setGridObjectDataLoaded(bool pLoaded, uint32 x, uint32 y)
void VisitNearbyCellsOf(WorldObject *obj, TypeContainerVisitor< Skyfire::ObjectUpdater, GridTypeMapContainer > &gridVisitor, TypeContainerVisitor< Skyfire::ObjectUpdater, WorldTypeMapContainer > &worldVisitor)
bool EnsureGridLoaded(Cell const &)
void RemoveFromMap(T *, bool)
virtual bool AddPlayerToMap(Player *)
bool GetAreaInfo(float x, float y, float z, uint32 &mogpflags, int32 &adtId, int32 &rootId, int32 &groupId) const
bool IsNonRaidInstance() const
uint32 GetInstanceId() const
TransportsContainer _transports
void SendRemoveTransports(Player *player)
PlayerList const & GetPlayers() const
UNORDERED_MAP< uint32, time_t > _creatureRespawnTimes
static void InitStateMachine()
time_t GetLinkedRespawnTime(uint64 guid) const
void _ScriptProcessDoor(Object *source, Object *target, const ScriptInfo *scriptInfo) const
MapInstanced * ToMapInstanced()
void PlayerRelocation(Player *, float x, float y, float z, float orientation)
bool CreatureRespawnRelocation(Creature *c, bool diffGridOnly)
static bool ExistVMap(uint32 mapid, int gx, int gy)
void AddObjectToSwitchList(WorldObject *obj, bool on)
ActiveNonPlayers::iterator m_activeNonPlayersIter
void RemoveCreatureRespawnTime(uint32 dbGuid)
bool ContainsGameObjectModel(const GameObjectModel &model) const
void InsertGameObjectModel(const GameObjectModel &model)
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data=0) const
static uint32 GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id)
Player * _GetScriptPlayer(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
bool isGridObjectDataLoaded(uint32 x, uint32 y) const
static bool ExistMap(uint32 mapid, int gx, int gy)
GridMap * GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]
Unit * _GetScriptUnit(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
void setNGrid(NGridType *grid, uint32 x, uint32 y)
bool IsBattleArena() const
LinkedListHead::Iterator< MapReference > iterator
bool isGridObjectDataLoaded() const
grid_state_t GetGridState(void) const
void ResetTimeTracker(time_t interval)
void setGridObjectDataLoaded(bool pLoaded)
void setUnloadExplicitLock(bool on)
void VisitGrid(const uint32 x, const uint32 y, TypeContainerVisitor< T, TypeMapContainer< TT > > &visitor)
void setUnloadReferenceLock(bool on)
bool getUnloadLock() const
void link(GridRefManager< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > *pTo)
CellCoord ComputeCellCoord(float x, float y)
GridCoord ComputeGridCoord(float x, float y)
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
ScriptInfo const * script
Represents a map magic value of 4 bytes (used in versions).