Changeset 9 for trunk/src/game/BattleGround.h
- Timestamp:
- 11/19/08 13:22:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/BattleGround.h
r2 r9 142 142 BATTLEGROUND_EY = 7, 143 143 BATTLEGROUND_RL = 8 144 }; 145 146 // handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time 147 enum BattleGroundQueueTypeId 148 { 149 BATTLEGROUND_QUEUE_AV = 1, 150 BATTLEGROUND_QUEUE_WS = 2, 151 BATTLEGROUND_QUEUE_AB = 3, 152 BATTLEGROUND_QUEUE_EY = 4, 153 BATTLEGROUND_QUEUE_2v2 = 5, 154 BATTLEGROUND_QUEUE_3v3 = 6, 155 BATTLEGROUND_QUEUE_5v5 = 7, 144 156 }; 145 157 … … 196 208 }; 197 209 210 enum BattleGroundJoinError 211 { 212 BG_JOIN_ERR_OK = 0, 213 BG_JOIN_ERR_OFFLINE_MEMBER = 1, 214 BG_JOIN_ERR_GROUP_TOO_MANY = 2, 215 BG_JOIN_ERR_MIXED_FACTION = 3, 216 BG_JOIN_ERR_MIXED_LEVELS = 4, 217 BG_JOIN_ERR_MIXED_ARENATEAM = 5, 218 BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE = 6, 219 BG_JOIN_ERR_GROUP_DESERTER = 7, 220 BG_JOIN_ERR_ALL_QUEUES_USED = 8, 221 BG_JOIN_ERR_GROUP_NOT_ENOUGH = 9 222 }; 223 198 224 class BattleGroundScore 199 225 { … … 297 323 bool HasFreeSlotsForTeam(uint32 Team) const; 298 324 bool HasFreeSlots() const; 325 uint32 GetFreeSlotsForTeam(uint32 Team) const; 299 326 300 327 bool isArena() const { return m_IsArena; } … … 367 394 uint8 GetTeamIndexByTeamId(uint32 Team) const { return Team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE; } 368 395 uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; } 396 uint32 GetAlivePlayersCountByTeam(uint32 Team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases 369 397 void UpdatePlayersCountByTeam(uint32 Team, bool remove) 370 398 { … … 375 403 } 376 404 405 // used for rated arena battles 406 void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; } 407 uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; } 408 void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; } 409 int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; } 410 377 411 /* Triggers handle */ 378 412 // must be implemented in BG subclass … … 391 425 392 426 virtual void AddPlayer(Player *plr); // must be implemented in BG subclass 427 393 428 virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket); 394 429 // can be extended in in BG subclass … … 403 438 void SpawnBGObject(uint32 type, uint32 respawntime); 404 439 bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0); 405 Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o); 440 // void SpawnBGCreature(uint32 type, uint32 respawntime); 441 Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0); 406 442 bool DelCreature(uint32 type); 407 443 bool DelObject(uint32 type); … … 411 447 void DoorClose(uint32 type); 412 448 const char *GetMangosString(int32 entry); 449 450 virtual bool HandlePlayerUnderMap(Player * plr) {return false;} 451 452 // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player 453 uint32 GetPlayerTeam(uint64 guid); 454 455 void SetDeleteThis() {m_SetDeleteThis = true;} 413 456 414 457 protected: … … 444 487 uint32 m_Queue_type; 445 488 uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5 489 bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque 490 bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave 446 491 // this variable is not used .... it can be found in many other ways... but to store it in BG object instance is useless 447 492 //uint8 m_BattleGroundType; // 3=BG, 4=arena … … 451 496 int32 m_StartDelayTime; 452 497 bool m_IsRated; // is this battle rated? 498 bool m_PrematureCountDown; 499 uint32 m_PrematureCountDownTimer; 453 500 char const *m_Name; 454 501 … … 468 515 /* Players count by team */ 469 516 uint32 m_PlayersCount[2]; 517 518 /* Arena team ids by team */ 519 uint32 m_ArenaTeamIds[2]; 520 521 int32 m_ArenaTeamRatingChanges[2]; 470 522 471 523 /* Limits */