feat(Core/Battleground): split Arena and Battleground score (#10616)

This commit is contained in:
Kargatum
2022-02-18 05:20:04 +07:00
committed by GitHub
parent dbd7680f5b
commit 5143872aed
41 changed files with 1750 additions and 1766 deletions

View File

@@ -16,28 +16,12 @@
*/
#include "BattlegroundNA.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "WorldPacket.h"
BattlegroundNA::BattlegroundNA()
{
BgObjects.resize(BG_NA_OBJECT_MAX);
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
}
BattlegroundNA::~BattlegroundNA()
{
}
void BattlegroundNA::StartingEventCloseDoors()
@@ -55,39 +39,6 @@ void BattlegroundNA::StartingEventOpenDoors()
SpawnBGObject(i, 60);
}
void BattlegroundNA::AddPlayer(Player* player)
{
Battleground::AddPlayer(player);
PlayerScores[player->GetGUID()] = new BattlegroundScore(player);
Battleground::UpdateArenaWorldState();
}
void BattlegroundNA::RemovePlayer(Player* /*player*/)
{
if (GetStatus() == STATUS_WAIT_LEAVE)
return;
Battleground::UpdateArenaWorldState();
CheckArenaWinConditions();
}
void BattlegroundNA::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
if (!killer)
{
LOG_ERROR("bg.battleground", "BattlegroundNA: Killer player not found");
return;
}
Battleground::HandleKillPlayer(player, killer);
Battleground::UpdateArenaWorldState();
CheckArenaWinConditions();
}
bool BattlegroundNA::HandlePlayerUnderMap(Player* player)
{
player->NearTeleportTo(4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation());
@@ -116,13 +67,7 @@ void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger)
void BattlegroundNA::FillInitialWorldStates(WorldPacket& data)
{
data << uint32(0xa11) << uint32(1); // 9
Battleground::UpdateArenaWorldState();
}
void BattlegroundNA::Init()
{
//call parent's class reset
Battleground::Init();
Arena::FillInitialWorldStates(data);
}
bool BattlegroundNA::SetupBattleground()