18 #ifndef BATTLEFIELD_H_
19 #define BATTLEFIELD_H_
97 virtual bool HandlePlayerEnter(
Player* player);
98 virtual GuidSet::iterator HandlePlayerLeave(
Player* player);
102 bool IsInsideObjective(
Player* player)
const;
107 virtual void SendChangePhase();
109 bool SetCapturePointData(
GameObject* capturePoint);
116 bool DelCapturePoint();
155 void GiveControlTo(
TeamId team);
159 float GetDistance(
Player* player);
177 void RelocateDeadPlayers();
213 void SendUpdateWorldState(uint32 variable, uint32
value,
bool hidden =
false);
222 virtual bool Update(uint32 diff);
225 void InvitePlayersInZoneToQueue();
227 void InvitePlayersInQueueToWar();
229 void InvitePlayersInZoneToWar();
238 void TeamApplyBuff(
TeamId team, uint32 spellId, uint32 spellId2 = 0);
254 void KickPlayerFromBattlefield(
ObjectGuid guid);
266 virtual uint32
GetData(uint32 dataId)
const override {
return m_Data32[dataId]; }
285 bool AddOrSetPlayerToCorrectBfGroup(
Player* player);
292 void RemovePlayerFromResurrectQueue(
ObjectGuid player_guid);
297 virtual Creature* SpawnCreature(uint32 entry,
float x,
float y,
float z,
float o,
TeamId );
299 GameObject* SpawnGameObject(uint32 entry,
float x,
float y,
float z,
float o);
323 void PlayerAcceptInviteToQueue(
Player* player);
324 void PlayerAcceptInviteToWar(
Player* player);
326 void AskToLeaveQueue(
Player* player);
331 virtual void SendInitWorldStatesToAll() = 0;
337 void SendAreaSpiritHealerQueryOpcode(
Player* player,
ObjectGuid const& guid);
340 void EndBattle(
bool endByTimer);
343 void ShowNpc(
Creature* creature,
bool aggressive);
350 void DoPlaySoundToAll(uint32 SoundID);
352 void InvitePlayerToQueue(
Player* player);
353 void InvitePlayerToWar(
Player* player);
355 void InitStalker(uint32 entry,
Position const& pos);
404 void KickAfkPlayers();
410 void BroadcastPacketToZone(
WorldPacket const* data)
const;
411 void BroadcastPacketToQueue(
WorldPacket const* data)
const;
412 void BroadcastPacketToWar(
WorldPacket const* data)
const;
418 void RegisterZone(uint32 zoneid);
419 bool HasPlayer(
Player* player)
const;
virtual uint32 GetData(uint32 dataId) const override
Definition: Battlefield.h:266
bool HasPlayer(ObjectGuid guid)
Definition: Battlefield.h:183
virtual void OnPlayerLeaveWar(Player *)
Called when a player leave the battle.
Definition: Battlefield.h:315
TeamId GetOtherTeam(TeamId team) const
Definition: Battlefield.h:273
Map * m_Map
Definition: Battlefield.h:379
Definition: Battlefield.h:27
Definition: Battlefield.h:49
Definition: Battlefield.h:50
virtual bool SetupBattlefield()
Call this to init the Battlefield.
Definition: Battlefield.h:210
Definition: Position.h:228
WorldLocation KickPosition
Definition: Battlefield.h:388
bool CanFlyIn()
Return if we can use mount in battlefield.
Definition: Battlefield.h:335
Battlefield * m_Bf
Definition: Battlefield.h:193
int8_t int8
Definition: Define.h:148
float m_maxSpeed
Definition: Battlefield.h:126
IntFormatSpec< int, AlignTypeSpec< TYPE_CODE >, Char > pad(int value, unsigned width, Char fill= ' ')
Definition: Battlefield.h:53
Definition: Battlefield.h:52
int8 GetState() const
Definition: Battlefield.h:243
Definition: Battlefield.h:51
GuidSet m_ResurrectQueue
Definition: Battlefield.h:192
Definition: DBCStructure.h:1434
std::vector< BfGraveyard * > GraveyardVect
Definition: Battlefield.h:76
virtual void OnPlayerJoinWar(Player *)
Called when a player accept to join the battle.
Definition: Battlefield.h:313
GraveyardVect m_GraveyardList
Definition: Battlefield.h:393
virtual uint64 GetData64(uint32 dataId) const override
Definition: Battlefield.h:262
Definition: Battlefield.h:41
BattlefieldObjectiveStates m_State
Definition: Battlefield.h:134
Definition: Creature.h:467
virtual void OnPlayerLeaveZone(Player *)
Called when a player leave battlefield zone.
Definition: Battlefield.h:317
virtual void SendRemoveWorldStates(Player *)
Definition: Battlefield.h:407
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &)
Definition: Battlefield.h:88
uint64 MAKE_PAIR64(uint32 l, uint32 h)
Definition: ObjectDefines.h:34
ObjectGuid m_capturePointGUID
Definition: Battlefield.h:146
virtual void OnBattleStart()
Called on start.
Definition: Battlefield.h:307
void HandlePlayerLeaveZone(Player *player, uint32 zoneId)
Definition: BattlefieldMgr.cpp:92
virtual void SetData64(uint32 dataId, uint64 value) override
Definition: Battlefield.h:263
Definition: Battlefield.h:47
float m_minValue
Definition: Battlefield.h:123
uint32 m_BattleId
Definition: Battlefield.h:376
#define BG_TEAMS_COUNT
Definition: SharedDefines.h:4555
virtual void DoCompleteOrIncrementAchievement(uint32, Player *, uint8)
Definition: Battlefield.h:328
virtual void HandleKill(Player *, Unit *)
Called when a Unit is kill in battlefield zone.
Definition: Battlefield.h:232
Definition: Battlefield.h:60
virtual void ChangeTeam(TeamId)
Definition: Battlefield.h:106
void ToggleBattlefield(bool enable)
Enable or Disable battlefield.
Definition: Battlefield.h:246
uint32 GetTimer() const
Definition: Battlefield.h:347
Definition: Battlefield.h:65
BattlefieldState
Definition: Battlefield.h:38
uint32 m_neutralValuePct
Definition: Battlefield.h:137
std::vector< uint64 > m_Data64
Definition: Battlefield.h:401
uint32 m_GraveyardId
Definition: Battlefield.h:190
Definition: ZoneScript.h:26
void SetDefenderTeam(TeamId team)
Definition: Battlefield.h:274
Definition: Battlefield.h:59
virtual ~BfCapturePoint()
Definition: Battlefield.h:86
BattlefieldSounds
Definition: Battlefield.h:56
uint32 m_LastResurrectTimer
Definition: Battlefield.h:394
uint32 m_TimeForAcceptInvite
Definition: Battlefield.h:386
BfCapturePointMap m_capturePoints
Definition: Battlefield.h:365
TeamId GetTeamId() const
Definition: Battlefield.h:113
virtual void OnStartGrouping()
Called x minutes before battle start when player in zone are invite to join queue.
Definition: Battlefield.h:311
uint32 m_StartGroupingTimer
Definition: Battlefield.h:396
void Resurrect(Creature *target)
Definition: bosses_opera.cpp:1037
G3D::int16 z
Definition: Vector3int16.h:46
uint32 m_Timer
Definition: Battlefield.h:359
uint32 m_MaxPlayer
Definition: Battlefield.h:380
Definition: BattlefieldMgr.h:27
virtual void OnBattleEnd(bool)
Called at the end of battle.
Definition: Battlefield.h:309
TeamId m_team
Definition: Battlefield.h:130
int32_t int32
Definition: Define.h:146
uint32 m_MapId
Definition: Battlefield.h:378
void SetTimer(uint32 timer)
Definition: Battlefield.h:348
uint32_t uint32
Definition: Define.h:150
static void Initialize(PCASC_SALSA20 pState, LPBYTE pbKey, DWORD cbKeyLength, LPBYTE pbVector)
Definition: CascDecrypt.cpp:81
bool IsWarTime() const
Return true if battle is start, false if battle is not started.
Definition: Battlefield.h:241
uint64_t uint64
Definition: Define.h:149
Definition: Battlefield.h:196
G3D::int16 y
Definition: Vector2int16.h:38
Definition: WorldStatePackets.h:27
Definition: SharedDefines.h:992
uint32 m_ZoneId
Definition: Battlefield.h:377
Definition: GameObject.h:880
void SetGraveyardNumber(uint32 number)
Definition: Battlefield.h:293
uint32 GetTypeId() const
Definition: Battlefield.h:234
virtual void UpdateData(uint32 index, int32 pad)
Definition: Battlefield.h:268
TeamId m_ControlTeam
Definition: Battlefield.h:189
Definition: Battlefield.h:28
GraveyardVect GetGraveyardVector() const
Definition: Battlefield.h:345
BattlefieldIDs
Definition: Battlefield.h:31
TeamId
Definition: SharedDefines.h:990
uint32 GetBattleId() const
Definition: Battlefield.h:325
uint32 m_uiKickDontAcceptTimer
Definition: Battlefield.h:387
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
uint32 m_MinPlayer
Definition: Battlefield.h:381
bool m_IsEnabled
Definition: Battlefield.h:360
void HandlePlayerEnterZone(Player *player, uint32 zoneId)
Definition: BattlefieldMgr.cpp:78
BattlefieldObjectiveStates
Definition: Battlefield.h:45
TeamId GetAttackerTeam() const
Definition: Battlefield.h:272
float m_maxValue
Definition: Battlefield.h:122
uint32 m_BattleTime
Definition: Battlefield.h:383
uint32 m_uiKickAfkPlayersTimer
Definition: Battlefield.h:390
Definition: Battlefield.h:42
uint64 GetQueueId() const
Definition: Battlefield.h:236
std::map< uint32, BfCapturePoint * > BfCapturePointMap
typedef of map witch store capturepoint and the associate gameobject entry
Definition: Battlefield.h:207
Definition: Battlefield.h:58
std::vector< uint32 > m_Data32
Definition: Battlefield.h:402
virtual void OnPlayerEnterZone(Player *)
Called when a player enter in battlefield zone.
Definition: Battlefield.h:319
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
Definition: Battlefield.h:33
#define TC_GAME_API
Definition: Define.h:134
ObjectGuid StalkerGuid
Definition: Battlefield.h:358
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
virtual void SetData(uint32 dataId, uint32 value) override
Definition: Battlefield.h:267
TeamId GetControlTeamId() const
Definition: Battlefield.h:156
uint8_t uint8
Definition: Define.h:152
Definition: Position.h:27
Definition: Battlefield.h:35
std::map< ObjectGuid, time_t > PlayerTimerMap
Definition: Battlefield.h:79
uint32 m_NoWarBattleTime
Definition: Battlefield.h:384
bool m_StartGrouping
Definition: Battlefield.h:397
BattlefieldTimers
Definition: Battlefield.h:63
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: Battlefield.h:40
bool m_isActive
Definition: Battlefield.h:361
Definition: ObjectGuid.h:189
uint32 GetZoneId() const
Definition: Battlefield.h:235
BattlefieldObjectiveStates m_OldState
Definition: Battlefield.h:133
TeamId GetDefenderTeam() const
Definition: Battlefield.h:271
uint32 m_TypeId
Definition: Battlefield.h:375
G3D::int16 x
Definition: Vector2int16.h:37
Battlefield * m_Bf
Definition: Battlefield.h:140
Definition: Battlefield.h:48
uint32 m_capturePointEntry
Definition: Battlefield.h:143
Definition: Battlefield.h:34
Definition: SharedDefines.h:993
uint32 m_RestartAfterCrash
Definition: Battlefield.h:385
uint32 m_MinLevel
Definition: Battlefield.h:382
float m_value
Definition: Battlefield.h:129
TeamId m_DefenderTeam
Definition: Battlefield.h:362
bool IsEnabled() const
Return if battlefield is enable.
Definition: Battlefield.h:248
Definition: WorldPacket.h:26
BattlefieldTypes
Definition: Battlefield.h:25
uint32 GetGraveyardId() const
Definition: Battlefield.h:186
Definition: Battlefield.h:81
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
Definition: Battlefield.h:149
uint32 GetCapturePointEntry() const
Definition: Battlefield.h:111