mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[9910] Implement expected from 3.2.x time limit for BattleGroundWS.
With updates and fixes from zergtmn. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
df6bd3df30
commit
0828c3aa81
4 changed files with 42 additions and 2 deletions
|
|
@ -86,6 +86,31 @@ void BattleGroundWS::Update(uint32 diff)
|
|||
RespawnFlagAfterDrop(HORDE);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_EndTimer <= diff)
|
||||
{
|
||||
uint32 allianceScore = GetTeamScore(ALLIANCE);
|
||||
uint32 hordeScore = GetTeamScore(HORDE);
|
||||
|
||||
if (allianceScore > hordeScore)
|
||||
EndBattleGround(ALLIANCE);
|
||||
else if (allianceScore < hordeScore)
|
||||
EndBattleGround(HORDE);
|
||||
else
|
||||
{
|
||||
// if 0 => tie
|
||||
EndBattleGround(m_LastCapturedFlagTeam);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 minutesLeftPrev = GetRemainingTimeInMinutes();
|
||||
m_EndTimer -= diff;
|
||||
uint32 minutesLeft = GetRemainingTimeInMinutes();
|
||||
|
||||
if (minutesLeft != minutesLeftPrev)
|
||||
UpdateWorldState(BG_WS_TIME_REMAINING, minutesLeft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -165,6 +190,8 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
|||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
m_LastCapturedFlagTeam = Source->GetTeam();
|
||||
|
||||
uint32 winner = 0;
|
||||
|
||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
|
|
@ -526,6 +553,8 @@ void BattleGroundWS::Reset()
|
|||
m_HonorWinKills = (isBGWeekend) ? 3 : 1;
|
||||
m_HonorEndKills = (isBGWeekend) ? 4 : 2;
|
||||
|
||||
m_EndTimer = BG_WS_TIME_LIMIT;
|
||||
m_LastCapturedFlagTeam = 0;
|
||||
}
|
||||
|
||||
void BattleGroundWS::EndBattleGround(uint32 winner)
|
||||
|
|
@ -626,4 +655,7 @@ void BattleGroundWS::FillInitialWorldStates(WorldPacket& data, uint32& count)
|
|||
FillInitialWorldState(data, count, BG_WS_FLAG_STATE_ALLIANCE, 2);
|
||||
else
|
||||
FillInitialWorldState(data, count, BG_WS_FLAG_STATE_ALLIANCE, 1);
|
||||
|
||||
FillInitialWorldState(data, count, BG_WS_UNK1, 1);
|
||||
FillInitialWorldState(data, count, BG_WS_TIME_REMAINING, GetRemainingTimeInMinutes());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue