本文整理匯總了C++中EndBattleGround函數的典型用法代碼示例。如果您正苦於以下問題:C++ EndBattleGround函數的具體用法?C++ EndBattleGround怎麽用?C++ EndBattleGround使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EndBattleGround函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: DEBUG_LOG
void BattleGroundAV::HandleKillUnit(Creature *creature, Player *killer)
{
DEBUG_LOG("BattleGroundAV: HandleKillUnit %i", creature->GetEntry());
if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint8 event1 = (sBattleGroundMgr.GetCreatureEventIndex(creature->GetGUIDLow())).event1;
if (event1 == BG_EVENT_NONE)
return;
switch(event1)
{
case BG_AV_BOSS_A:
CastSpellOnTeam(BG_AV_BOSS_KILL_QUEST_SPELL, HORDE); // this is a spell which finishes a quest where a player has to kill the boss
RewardReputationToTeam(BG_AV_FACTION_H, m_RepBoss, HORDE);
RewardHonorToTeam(GetBonusHonorFromKill(BG_AV_KILL_BOSS), HORDE);
SendYellToAll(LANG_BG_AV_A_GENERAL_DEAD, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0));
EndBattleGround(HORDE);
break;
case BG_AV_BOSS_H:
CastSpellOnTeam(BG_AV_BOSS_KILL_QUEST_SPELL, ALLIANCE); // this is a spell which finishes a quest where a player has to kill the boss
RewardReputationToTeam(BG_AV_FACTION_A, m_RepBoss, ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(BG_AV_KILL_BOSS), ALLIANCE);
SendYellToAll(LANG_BG_AV_H_GENERAL_DEAD, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0));
EndBattleGround(ALLIANCE);
break;
case BG_AV_CAPTAIN_A:
if (IsActiveEvent(BG_AV_NodeEventCaptainDead_A, 0))
return;
RewardReputationToTeam(BG_AV_FACTION_H, m_RepCaptain, HORDE);
RewardHonorToTeam(GetBonusHonorFromKill(BG_AV_KILL_CAPTAIN), HORDE);
UpdateScore(BG_TEAM_ALLIANCE, (-1) * BG_AV_RES_CAPTAIN);
// spawn destroyed aura
SpawnEvent(BG_AV_NodeEventCaptainDead_A, 0, true);
break;
case BG_AV_CAPTAIN_H:
if (IsActiveEvent(BG_AV_NodeEventCaptainDead_H, 0))
return;
RewardReputationToTeam(BG_AV_FACTION_A, m_RepCaptain, ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(BG_AV_KILL_CAPTAIN), ALLIANCE);
UpdateScore(BG_TEAM_HORDE, (-1) * BG_AV_RES_CAPTAIN);
// spawn destroyed aura
SpawnEvent(BG_AV_NodeEventCaptainDead_H, 0, true);
break;
case BG_AV_MINE_BOSSES_NORTH:
ChangeMineOwner(BG_AV_NORTH_MINE, GetAVTeamIndexByTeamId(killer->GetTeam()));
break;
case BG_AV_MINE_BOSSES_SOUTH:
ChangeMineOwner(BG_AV_SOUTH_MINE, GetAVTeamIndexByTeamId(killer->GetTeam()));
break;
}
}
示例2: GetTeamScore
void BattleGroundEY::UpdateTeamScore(uint32 Team)
{
uint32 score = GetTeamScore(Team);
//TODO there should be some sound played when one team is near victory!! - and define variables
/*if (!m_IsInformedNearVictory && score >= BG_EY_WARNING_NEAR_VICTORY_SCORE)
{
if (Team == ALLIANCE)
SendMessageToAll(LANG_BG_EY_A_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else
SendMessageToAll(LANG_BG_EY_H_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_EY_SOUND_NEAR_VICTORY);
m_IsInformedNearVictory = true;
}*/
if (score >= BG_EY_MAX_TEAM_SCORE)
{
score = BG_EY_MAX_TEAM_SCORE;
EndBattleGround(Team);
}
if (Team == ALLIANCE)
UpdateWorldState(EY_ALLIANCE_RESOURCES, score);
else
UpdateWorldState(EY_HORDE_RESOURCES, score);
}
示例3: RewardHonorToTeam
void BattleGroundIC::HandleKillUnit(Creature *unit, Player *killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint32 entry = unit->GetEntry();
if (entry == 34924)
{
RewardHonorToTeam(500,HORDE);
EndBattleGround(HORDE);
}
else if (entry == 34922)
{
RewardHonorToTeam(500,ALLIANCE);
EndBattleGround(ALLIANCE);
}
}
示例4: RewardHonorToTeam
void BattleGroundIC::HandleKillUnit(Creature *unit, Player *killer)
{
sLog.outDebug("bg_ic HandleKillUnit %i",unit->GetEntry());
if(GetStatus() != STATUS_IN_PROGRESS)
return;
uint32 entry = unit->GetEntry();
if(entry == BG_IC_StaticCreatureInfo[IC_NPC_A_BOSS][0])
{
RewardHonorToTeam(GetBonusHonor(BG_IC_KILL_BOSS),HORDE);
EndBattleGround(HORDE);
}
else if ( entry == BG_IC_StaticCreatureInfo[IC_NPC_H_BOSS][0] )
{
RewardHonorToTeam(GetBonusHonor(BG_IC_KILL_BOSS),ALLIANCE);
EndBattleGround(ALLIANCE);
}
}
示例5: AddPoint
void BattleGroundAB::Update(time_t diff)
{
BattleGround::Update(diff);
//If BG-Status = WAIT_JOIN, we must start BG
if(GetStatus() == STATUS_WAIT_JOIN)
{
}
if(GetStatus() == STATUS_IN_PROGRESS)
{
for(int i = 0;i < 5; i++)
if(m_Points[i]) //If point is controled
AddPoint(m_Points[i], diff);
if(GetTeamScore(ALLIANCE) >= (2000*1000)) //1 score/per second
EndBattleGround(ALLIANCE);
if(GetTeamScore(HORDE) >= (2000*1000)) //1 score/per second
EndBattleGround(HORDE);
}
}
示例6: SendMessageToAll
void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] && GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED)
{
if (Source->GetTeamId() == attackers)
{
if (Source->GetTeamId() == ALLIANCE)
SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
if (status == BG_SA_ROUND_ONE)
{
RoundScores[0].winner = attackers;
RoundScores[0].time = TotalTime;
attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
status = BG_SA_SECOND_WARMUP;
TotalTime = 0;
ToggleTimer();
SendWarningToAll(LANG_BG_SA_ROUND_ONE_END);
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ResetObjs();
}
else if (status == BG_SA_ROUND_TWO)
{
RoundScores[1].winner = attackers;
RoundScores[1].time = TotalTime;ToggleTimer();
if (RoundScores[0].time == RoundScores[1].time)
EndBattleGround(NULL);
else if (RoundScores[0].time < RoundScores[1].time)
EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
else
EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
}
}
}
}
示例7: GetTeamScore
void BattleGroundEY::UpdateTeamScore(uint32 Team)
{
uint32 score = GetTeamScore(Team);
if(score >= EY_MAX_TEAM_SCORE)
{
score = EY_MAX_TEAM_SCORE;
EndBattleGround(Team);
}
if(Team == ALLIANCE)
UpdateWorldState(EY_ALLIANCE_RESOURCES, score);
else
UpdateWorldState(EY_HORDE_RESOURCES, score);
}
示例8: GetTeamScore
void BattleGroundBG::UpdateTeamScore(Team team)
{
uint32 score = GetTeamScore(team);
if (score >= BG_BG_MAX_TEAM_SCORE)
{
score = BG_BG_MAX_TEAM_SCORE;
EndBattleGround(team);
}
if (team == ALLIANCE)
UpdateWorldState(BG_ALLIANCE_RESOURCES, score);
else
UpdateWorldState(BG_HORDE_RESOURCES, score);
}
示例9: EndBattleGround
void BattleGroundEY::UpdateTeamScore(Team team)
{
uint32 score = m_TeamScores[GetTeamIndexByTeamId(team)];
if (score >= EY_MAX_TEAM_SCORE)
{
score = EY_MAX_TEAM_SCORE;
EndBattleGround(team);
}
if (team == ALLIANCE)
UpdateWorldState(WORLD_STATE_EY_RESOURCES_ALLIANCE, score);
else
UpdateWorldState(WORLD_STATE_EY_RESOURCES_HORDE, score);
}
示例10: MANGOS_ASSERT
void BattleGroundIC::UpdateScore(TeamIndex teamIdx, int32 points )
{
// note: to remove reinforcements points must be negative, for adding reinforcements points must be positive
MANGOS_ASSERT( teamIdx == TEAM_INDEX_ALLIANCE || teamIdx == TEAM_INDEX_HORDE);
m_TeamScores[teamIdx] += points; // m_TeamScores is int32 - so no problems here
if (points < 0)
{
if (m_TeamScores[teamIdx] < 1)
{
m_TeamScores[teamIdx] = 0;
// other team will win:
EndBattleGround((teamIdx == TEAM_INDEX_ALLIANCE)? HORDE : ALLIANCE);
}
}
// must be called here, else it could display a negative value
UpdateWorldState(((teamIdx == TEAM_INDEX_HORDE) ? BG_TEAM_HORDE_REINFORC : BG_TEAM_ALLIANCE_REINFORC), m_TeamScores[teamIdx]);
}
示例11: GetTeamIndexByTeamId
void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
{
if(GetStatus() != STATUS_IN_PROGRESS)
return;
if(!killer)
{
sLog.outError("BattleGroundNA: Killer player not found");
return;
}
uint32 killer_team_index = GetTeamIndexByTeamId(killer->GetTeam());
++m_TeamKills[killer_team_index]; // add kills to killer's team
if(m_TeamKills[killer_team_index] >= GetPlayersCountByTeam(player->GetTeam()))
{
// all opponents killed
EndBattleGround(killer->GetTeam());
}
}
示例12: MANGOS_ASSERT
void BattleGroundAV::UpdateScore(BattleGroundTeamIndex teamIdx, int32 points )
{
// note: to remove reinforcements points must be negative, for adding reinforcements points must be positive
MANGOS_ASSERT( teamIdx == BG_TEAM_ALLIANCE || teamIdx == BG_TEAM_HORDE);
m_TeamScores[teamIdx] += points; // m_TeamScores is int32 - so no problems here
if (points < 0)
{
if (m_TeamScores[teamIdx] < 1)
{
m_TeamScores[teamIdx] = 0;
// other team will win:
EndBattleGround((teamIdx == BG_TEAM_ALLIANCE)? HORDE : ALLIANCE);
}
else if (!m_IsInformedNearLose[teamIdx] && m_TeamScores[teamIdx] < BG_AV_SCORE_NEAR_LOSE)
{
SendMessageToAll((teamIdx == BG_TEAM_HORDE) ? LANG_BG_AV_H_NEAR_LOSE : LANG_BG_AV_A_NEAR_LOSE, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_AV_SOUND_NEAR_LOSE);
m_IsInformedNearLose[teamIdx] = true;
}
}
// must be called here, else it could display a negative value
UpdateWorldState(((teamIdx == BG_TEAM_HORDE) ? BG_AV_Horde_Score : BG_AV_Alliance_Score), m_TeamScores[teamIdx]);
}
示例13: StartShips
void BattleGroundSA::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_WAIT_JOIN && !shipsStarted)
if (Phase == SA_ROUND_ONE) // Round one not started yet
if (shipsTimer <= diff)
StartShips();
else
shipsTimer -= diff;
if (GetStatus() == STATUS_IN_PROGRESS) // Battleground already in progress
{
if (Round_timer >= BG_SA_ROUNDLENGTH)
{
if(Phase == SA_ROUND_ONE) // Timeout of second round
{
PlaySoundToAll(BG_SA_SOUND_GYD_VICTORY);
SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_1ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_1ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
RoundScores[0].winner = GetDefender();
RoundScores[0].time = Round_timer;
ResetBattle(0, defender);
}
else // Timeout of second round
{
SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_2ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_2ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
RoundScores[1].winner = GetDefender();
RoundScores[1].time = Round_timer;
EndBattleGround(TEAM_NONE);
return;
}
}
else
Round_timer += diff;
for (int gyd = 0; gyd < BG_SA_GRY_MAX; ++gyd)
{
// 3 sec delay to spawn new banner instead previous despawned one
if (m_BannerTimers[gyd].timer)
{
if (m_BannerTimers[gyd].timer > diff)
m_BannerTimers[gyd].timer -= diff;
else
{
m_BannerTimers[gyd].timer = 0;
_CreateBanner(gyd, m_BannerTimers[gyd].type, m_BannerTimers[gyd].teamIndex, false);
}
}
// 1-minute to occupy a node from contested state
if (m_GydTimers[gyd])
{
if (m_GydTimers[gyd] > diff)
m_GydTimers[gyd] -= diff;
else
{
m_GydTimers[gyd] = 0;
// Change from contested to occupied !
uint8 teamIndex = m_Gyd[gyd]-1;
m_prevGyd[gyd] = m_Gyd[gyd];
m_Gyd[gyd] += 2;
// create new occupied banner
_CreateBanner(gyd, BG_SA_GARVE_TYPE_OCCUPIED, teamIndex, true);
//_SendNodeUpdate(node);
_GydOccupied(gyd,(teamIndex == 0) ? ALLIANCE:HORDE);
// Message to chatlog
RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE:HORDE);
RewardXpToTeam(0, 0.6f, (teamIndex == 0) ? ALLIANCE:HORDE);
RewardReputationToTeam((teamIndex == 0) ? 1050:1085, 65, (teamIndex == 0) ? ALLIANCE:HORDE);
switch(gyd)
{
case 0: SpawnEvent(SA_EVENT_ADD_VECH_W, 0, true);break;
case 1: SpawnEvent(SA_EVENT_ADD_VECH_E, 0, true);break;
}
if (teamIndex == 0)
{
// SendMessage2ToAll(LANG_BG_SA_AH_SEIZES_GRAVEYARD,CHAT_MSG_BG_SYSTEM_ALLIANCE,NULL,LANG_BG_ALLY,_GydName(gyd));
PlaySoundToAll(BG_SA_SOUND_GYD_CAPTURED_ALLIANCE);
SendWarningToAllSA(gyd, STATUS_CONQUESTED, ALLIANCE);
}
else
{
// SendMessage2ToAll(LANG_BG_SA_AH_SEIZES_GRAVEYARD,CHAT_MSG_BG_SYSTEM_HORDE,NULL,LANG_BG_HORDE,_GydName(gyd));
PlaySoundToAll(BG_SA_SOUND_GYD_CAPTURED_HORDE);
SendWarningToAllSA(gyd, STATUS_CONQUESTED, HORDE);
}
}
}
}
UpdateTimer();
}
if (GetStatus() == STATUS_WAIT_JOIN && Phase == SA_ROUND_TWO) // Round two, not yet started
{
if (!shipsStarted)
if (shipsTimer <= diff)
{
SendMessageToAll(LANG_BG_SA_START_ONE_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
StartShips();
}
else
shipsTimer -= diff;
//.........這裏部分代碼省略.........
示例14: GetTeamIndex
//.........這裏部分代碼省略.........
break;
case 19042:
SendWarningToAllSA(SA_EVENT_NONE, TEAM_NONE, true, type);
UpdateWorldState(BG_SA_GateStatus[type], GateStatus[type] = BG_SA_GO_GATES_DAMAGE);
break;
case 19047:
SendWarningToAllSA(SA_EVENT_NONE, TEAM_NONE, true, type, true);
UpdateWorldState(BG_SA_GateStatus[type], GateStatus[type] = BG_SA_GO_GATES_DESTROY);
UpdatePlayerScore(player, SCORE_GATES_DESTROYED, 1);
RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE : HORDE);
// make the central graveyard capturable
MakeInteractive(SA_EVENT_ADD_GRAVE_C, (GetDefender() == ALLIANCE) ? BG_SA_GRAVE_STATUS_ALLY_CONTESTED : BG_SA_GRAVE_STATUS_HORDE_CONTESTED, true);
SpawnEvent(SA_EVENT_ADD_RED_SIGIL, 0, false);
break;
}
break;
}
case BG_SA_GO_GATES_YELLOW_MOON:
{
type = BG_SA_GO_GATES_T_YELLOW_MOON;
switch (eventId)
{
case 21630:
if (!GateYellowMoonDamaged)
{
SendMessageSA(player, BG_SA_ATTACK, _GatesName(target_obj));
GateYellowMoonDamaged = true;
}
break;
case 19044:
SendWarningToAllSA(SA_EVENT_NONE, TEAM_NONE, true, type);
UpdateWorldState(BG_SA_GateStatus[type], GateStatus[type] = BG_SA_GO_GATES_DAMAGE);
break;
case 19049:
SendWarningToAllSA(SA_EVENT_NONE, TEAM_NONE, true, type, true);
UpdateWorldState(BG_SA_GateStatus[type], GateStatus[type] = BG_SA_GO_GATES_DESTROY);
UpdatePlayerScore(player, SCORE_GATES_DESTROYED, 1);
RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE : HORDE);
SpawnEvent(SA_EVENT_ADD_YELLOW_SIGIL, 0, false);
break;
}
break;
}
case BG_SA_GO_TITAN_RELIC_A:
case BG_SA_GO_TITAN_RELIC_H:
{
if (eventId == 20572 && player->GetTeam() != GetDefender())
{
if (!relicGateDestroyed)
{
player->GetSession()->KickPlayer();
sLog.outError("Player %s has clicked SOTA Relic without Relic gate being destroyed", player->GetName());
return;
}
//Achievement Storm the Beach (1310)
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player* plr = sObjectMgr.GetPlayer(itr->first);
if (plr)
{
if (plr->GetTeam() != defender)
plr->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, BG_SA_STORM_THE_BEACH);
}
}
if (Phase == SA_ROUND_ONE) // Victory at first round
{
RoundScores[0].winner = GetDefender() == ALLIANCE ? HORDE : ALLIANCE;
RoundScores[0].time = Round_timer;
PlaySoundToAll(BG_SA_SOUND_GYD_VICTORY);
SendMessageToAll(defender == HORDE ? LANG_BG_SA_ALLIANCE_END_1ROUND : LANG_BG_SA_HORDE_END_1ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
SendWarningToAll(LANG_BG_SA_END_1ROUND);
RewardHonorToTeam(150, (teamIndex == 0) ? ALLIANCE : HORDE);
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
{
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, BG_SA_STORM_THE_BEACH);
}
}
ResetBattle(player->GetTeam(), GetDefender());
}
else // Victory at second round
{
RoundScores[1].winner = GetDefender() == ALLIANCE ? HORDE : ALLIANCE;
SendMessageToAll(defender == HORDE ? LANG_BG_SA_ALLIANCE_END_2ROUND : LANG_BG_SA_HORDE_END_2ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
RewardHonorToTeam(150, (teamIndex == 0) ? ALLIANCE : HORDE);
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
{
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, BG_SA_STORM_THE_BEACH);
}
}
EndBattleGround(player->GetTeam());
}
}
break;
}
}
}
示例15: StartShips
void BattleGroundSA::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_WAIT_JOIN && !shipsStarted)
if (Phase == SA_ROUND_ONE) // Round one not started yet
{
if (shipsTimer <= diff)
StartShips();
else
shipsTimer -= diff;
}
if (GetStatus() == STATUS_IN_PROGRESS) // Battleground already in progress
{
if (Round_timer >= BG_SA_ROUNDLENGTH)
{
if (Phase == SA_ROUND_ONE) // Timeout of first round
{
PlaySoundToAll(BG_SA_SOUND_GYD_VICTORY);
SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_1ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_1ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
SendWarningToAll(LANG_BG_SA_END_1ROUND);
RoundScores[0].winner = GetDefender();
RoundScores[0].time = BG_SA_ROUNDLENGTH;
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player* plr = sObjectMgr.GetPlayer(itr->first);
if (plr)
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, BG_SA_END_OF_ROUND);
}
ResetBattle(0, defender);
}
else // Timeout of second round
{
SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_2ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_2ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
RoundScores[1].winner = GetDefender();
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player* plr = sObjectMgr.GetPlayer(itr->first);
if (plr)
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, BG_SA_END_OF_ROUND);
}
if (RoundScores[0].winner == GetDefender())
EndBattleGround(GetDefender());
else
EndBattleGround(TEAM_NONE);
return;
}
}
else
Round_timer += diff;
for (int gyd = 0; gyd < BG_SA_GRY_MAX; ++gyd)
{
// 3 sec delay to spawn new banner instead previous despawned one
if (m_BannerTimers[gyd].timer)
{
if (m_BannerTimers[gyd].timer > diff)
m_BannerTimers[gyd].timer -= diff;
else
{
m_BannerTimers[gyd].timer = 0;
_CreateBanner(gyd, m_BannerTimers[gyd].type, m_BannerTimers[gyd].teamIndex, false);
}
}
}
UpdateTimer();
}
if (GetStatus() == STATUS_WAIT_JOIN && Phase == SA_ROUND_TWO) // Round two, not yet started
{
if (!shipsStarted)
{
if (shipsTimer <= diff)
{
SendMessageToAll(LANG_BG_SA_START_ONE_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
StartShips();
}
else
shipsTimer -= diff;
}
if (TimeST2Round < diff)
{
Phase = SA_ROUND_TWO;
SpawnEvent(SA_EVENT_ADD_NPC, 0, true);
SpawnEvent(SA_EVENT_ADD_BOMB_B, (GetDefender() == ALLIANCE ? BG_SA_GRAVE_STATUS_HORDE_OCCUPIED : BG_SA_GRAVE_STATUS_ALLY_OCCUPIED), true);
ToggleTimer();
SetStatus(STATUS_IN_PROGRESS); // Start round two
PlaySoundToAll(SOUND_BG_START);
SendWarningToAll(LANG_BG_SA_HAS_BEGUN);
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player* plr = sObjectMgr.GetPlayer(itr->first);
if (plr)
//.........這裏部分代碼省略.........