本文整理汇总了C++中GetTeamScore函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTeamScore函数的具体用法?C++ GetTeamScore怎么用?C++ GetTeamScore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTeamScore函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
if (Team == TEAM_ALLIANCE)
EndBattleground(ALLIANCE);
else
EndBattleground(HORDE);
}
if (Team == TEAM_ALLIANCE)
UpdateWorldState(EY_ALLIANCE_RESOURCES, score);
else
UpdateWorldState(EY_HORDE_RESOURCES, score);
}
示例2: GetTeamScore
void BattlegroundKT::PostUpdateImpl(uint32 diff)
{
if (GetStatus() == STATUS_IN_PROGRESS)
{
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_LastCapturedOrbTeam);
}
}
else
{
uint32 minutesLeftPrev = GetRemainingTimeInMinutes();
m_EndTimer -= diff;
uint32 minutesLeft = GetRemainingTimeInMinutes();
if (minutesLeft != minutesLeftPrev)
UpdateWorldState(BG_KT_TIME_REMAINING, minutesLeft);
}
if (m_UpdatePointsTimer <= diff)
{
for (uint8 i = 0; i < MAX_ORBS; ++i)
if (uint64 guid = m_OrbKeepers[i])
if (m_playersZone.find(guid) != m_playersZone.end())
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
AccumulateScore(player->GetTeamId(), m_playersZone[guid]);
UpdatePlayerScore(player, SCORE_ORB_SCORE, m_playersZone[guid]);
}
m_UpdatePointsTimer = BG_KT_POINTS_UPDATE_TIME;
}
else
m_UpdatePointsTimer -= diff;
}
}
示例3: GetTeamScore
void BattlegroundTP::FillInitialWorldStates(WorldStateBuilder& builder)
{
builder.AppendState(BG_TP_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE));
builder.AppendState(BG_TP_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE));
if (_flagState[TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_GROUND)
builder.AppendState(BG_TP_FLAG_UNK_ALLIANCE, -1);
else if (_flagState[TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_PLAYER)
builder.AppendState(BG_TP_FLAG_UNK_ALLIANCE, 1);
else
builder.AppendState(BG_TP_FLAG_UNK_ALLIANCE, 0);
if (_flagState[TEAM_HORDE] == BG_TP_FLAG_STATE_ON_GROUND)
builder.AppendState(BG_TP_FLAG_UNK_HORDE, -1);
else if (_flagState[TEAM_HORDE] == BG_TP_FLAG_STATE_ON_PLAYER)
builder.AppendState(BG_TP_FLAG_UNK_HORDE, 1);
else
builder.AppendState(BG_TP_FLAG_UNK_HORDE, 0);
builder.AppendState(BG_TP_FLAG_CAPTURES_MAX, BG_TP_MAX_TEAM_SCORE);
if (GetStatus() == STATUS_IN_PROGRESS)
{
builder.AppendState(BG_TP_STATE_TIMER_ACTIVE, 1);
builder.AppendState(BG_TP_STATE_TIMER, 25-_minutesElapsed);
}
else
builder.AppendState(BG_TP_STATE_TIMER_ACTIVE, 0);
if (_flagState[TEAM_HORDE] == BG_TP_FLAG_STATE_ON_PLAYER)
builder.AppendState(BG_TP_FLAG_STATE_HORDE, 2);
else
builder.AppendState(BG_TP_FLAG_STATE_HORDE, 1);
if (_flagState[TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_PLAYER)
builder.AppendState(BG_TP_FLAG_STATE_ALLIANCE, 2);
else
builder.AppendState(BG_TP_FLAG_STATE_ALLIANCE, 1);
}
示例4: uint32
void BattlegroundTP::FillInitialWorldStates(WorldPacket& data)
{
data << uint32(BG_TP_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(TEAM_ALLIANCE));
data << uint32(BG_TP_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(TEAM_HORDE));
if (_flagState[TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_GROUND)
data << uint32(BG_TP_FLAG_UNK_ALLIANCE) << uint32(-1);
else if (_flagState[TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_PLAYER)
data << uint32(BG_TP_FLAG_UNK_ALLIANCE) << uint32(1);
else
data << uint32(BG_TP_FLAG_UNK_ALLIANCE) << uint32(0);
if (_flagState[TEAM_HORDE] == BG_TP_FLAG_STATE_ON_GROUND)
data << uint32(BG_TP_FLAG_UNK_HORDE) << uint32(-1);
else if (_flagState[TEAM_HORDE] == BG_TP_FLAG_STATE_ON_PLAYER)
data << uint32(BG_TP_FLAG_UNK_HORDE) << uint32(1);
else
data << uint32(BG_TP_FLAG_UNK_HORDE) << uint32(0);
data << uint32(BG_TP_FLAG_CAPTURES_MAX) << uint32(BG_TP_MAX_TEAM_SCORE);
if (GetStatus() == STATUS_IN_PROGRESS)
{
data << uint32(BG_TP_STATE_TIMER_ACTIVE) << uint32(1);
data << uint32(BG_TP_STATE_TIMER) << uint32(25-_minutesElapsed);
}
else
data << uint32(BG_TP_STATE_TIMER_ACTIVE) << uint32(0);
if (_flagState[TEAM_HORDE] == BG_TP_FLAG_STATE_ON_PLAYER)
data << uint32(BG_TP_FLAG_STATE_HORDE) << uint32(2);
else
data << uint32(BG_TP_FLAG_STATE_HORDE) << uint32(1);
if (_flagState[TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_PLAYER)
data << uint32(BG_TP_FLAG_STATE_ALLIANCE) << uint32(2);
else
data << uint32(BG_TP_FLAG_STATE_ALLIANCE) << uint32(1);
}
示例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: GetTeamScore
void game_sv_TeamDeathmatch::WriteGameState(CInifile& ini, LPCSTR sect, bool bRoundResult)
{
inherited::WriteGameState(ini, sect, bRoundResult);
for(u32 i=0; i<teams.size(); ++i )
{
string16 buf_name;
sprintf_s (buf_name,"team_%d_score",i);
ini.w_u32 (sect,buf_name, GetTeamScore(i));
}
}
示例7: int32
void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_ALLIANCE), int32(GetTeamScore(TEAM_ALLIANCE)));
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_HORDE), int32(GetTeamScore(TEAM_HORDE)));
if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), -1);
else if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER)
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 1);
else
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 0);
if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), -1);
else if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER)
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 1);
else
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 0);
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_MAX), int32(BG_WS_MAX_TEAM_SCORE));
if (GetStatus() == STATUS_IN_PROGRESS)
{
packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 1);
packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER), int32(25 - _minutesElapsed));
}
else
packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 0);
if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER)
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 2);
else
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 1);
if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER)
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 2);
else
packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 1);
}
示例8: int32
void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(uint32(EY_HORDE_BASE), int32(m_TeamPointsCount[TEAM_HORDE]));
packet.Worldstates.emplace_back(uint32(EY_ALLIANCE_BASE), int32(m_TeamPointsCount[TEAM_ALLIANCE]));
packet.Worldstates.emplace_back(0xAB6, 0x0);
packet.Worldstates.emplace_back(0xAB5, 0x0);
packet.Worldstates.emplace_back(0xAB4, 0x0);
packet.Worldstates.emplace_back(0xAB3, 0x0);
packet.Worldstates.emplace_back(0xAB2, 0x0);
packet.Worldstates.emplace_back(0xAB1, 0x0);
packet.Worldstates.emplace_back(0xAB0, 0x0);
packet.Worldstates.emplace_back(0xAAF, 0x0);
packet.Worldstates.emplace_back(uint32(DRAENEI_RUINS_HORDE_CONTROL), int32(m_PointOwnedByTeam[DRAENEI_RUINS] == HORDE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(DRAENEI_RUINS_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[DRAENEI_RUINS] == ALLIANCE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(DRAENEI_RUINS_UNCONTROL), int32(m_PointState[DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(MAGE_TOWER_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[MAGE_TOWER] == ALLIANCE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(MAGE_TOWER_HORDE_CONTROL), int32(m_PointOwnedByTeam[MAGE_TOWER] == HORDE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(MAGE_TOWER_UNCONTROL), int32(m_PointState[MAGE_TOWER] != EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(FEL_REAVER_HORDE_CONTROL), int32(m_PointOwnedByTeam[FEL_REAVER] == HORDE && m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(FEL_REAVER_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[FEL_REAVER] == ALLIANCE && m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(FEL_REAVER_UNCONTROL), int32(m_PointState[FEL_REAVER] != EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(BLOOD_ELF_HORDE_CONTROL), int32(m_PointOwnedByTeam[BLOOD_ELF] == HORDE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(BLOOD_ELF_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[BLOOD_ELF] == ALLIANCE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(BLOOD_ELF_UNCONTROL), int32(m_PointState[BLOOD_ELF] != EY_POINT_UNDER_CONTROL));
packet.Worldstates.emplace_back(uint32(NETHERSTORM_FLAG), int32(m_FlagState == BG_EY_FLAG_STATE_ON_BASE));
packet.Worldstates.emplace_back(0xAD2, 0x1);
packet.Worldstates.emplace_back(0xAD1, 0x1);
packet.Worldstates.emplace_back(0xABE, int32(GetTeamScore(TEAM_HORDE)));
packet.Worldstates.emplace_back(0xABD, int32(GetTeamScore(TEAM_ALLIANCE)));
packet.Worldstates.emplace_back(0xA05, 0x8E);
packet.Worldstates.emplace_back(0xAA0, 0x0);
packet.Worldstates.emplace_back(0xA9F, 0x0);
packet.Worldstates.emplace_back(0xA9E, 0x0);
packet.Worldstates.emplace_back(0xC0D, 0x17B);
}
示例9: 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);
}
示例10: FillInitialWorldState
void BattleGroundAC::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
FillInitialWorldState(data, count, AC_HORDE_BASE, m_TeamPointsCount[BG_TEAM_HORDE]);
FillInitialWorldState(data, count, AC_ALLIANCE_BASE, m_TeamPointsCount[BG_TEAM_ALLIANCE]);
FillInitialWorldState(data, count, 0xab6, 0x0);
FillInitialWorldState(data, count, 0xab5, 0x0);
FillInitialWorldState(data, count, 0xab4, 0x0);
FillInitialWorldState(data, count, 0xab3, 0x0);
FillInitialWorldState(data, count, 0xab2, 0x0);
FillInitialWorldState(data, count, 0xab1, 0x0);
FillInitialWorldState(data, count, 0xab0, 0x0);
FillInitialWorldState(data, count, 0xaaf, 0x0);
FillInitialWorldState(data, count, TOWER_1_HORDE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_1] == HORDE && m_PointState[BG_AC_NODE_TOWER_1] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_1_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_1] == ALLIANCE && m_PointState[BG_AC_NODE_TOWER_1] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_1_UNCONTROL, m_PointState[BG_AC_NODE_TOWER_1] != AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_2_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_2] == ALLIANCE && m_PointState[BG_AC_NODE_TOWER_2] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_2_HORDE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_2] == HORDE && m_PointState[BG_AC_NODE_TOWER_2] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_2_UNCONTROL, m_PointState[BG_AC_NODE_TOWER_2] != AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_3_HORDE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_3] == HORDE && m_PointState[BG_AC_NODE_TOWER_3] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_3_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_3] == ALLIANCE && m_PointState[BG_AC_NODE_TOWER_3] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_3_UNCONTROL, m_PointState[BG_AC_NODE_TOWER_3] != AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_4_HORDE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_4] == HORDE && m_PointState[BG_AC_NODE_TOWER_4] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_4_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_AC_NODE_TOWER_4] == ALLIANCE && m_PointState[BG_AC_NODE_TOWER_4] == AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, TOWER_4_UNCONTROL, m_PointState[BG_AC_NODE_TOWER_4] != AC_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, FLAG_1_FLAG, m_FlagState == BG_AC_FLAG_STATE_ON_BASE);
FillInitialWorldState(data, count, 0xad2, 0x1);
FillInitialWorldState(data, count, 0xad1, 0x1);
FillInitialWorldState(data, count, 0xabe, GetTeamScore(HORDE));
FillInitialWorldState(data, count, 0xabd, GetTeamScore(ALLIANCE));
FillInitialWorldState(data, count, 0xa05, 0x8e);
FillInitialWorldState(data, count, 0xaa0, 0x0);
FillInitialWorldState(data, count, 0xa9f, 0x0);
FillInitialWorldState(data, count, 0xa9e, 0x0);
FillInitialWorldState(data, count, 0xc0d, 0x17b);
}
示例11: 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);
}
示例12: FillInitialWorldState
void BattleGroundEY::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
FillInitialWorldState(data, count, EY_HORDE_BASE, m_TeamPointsCount[BG_TEAM_HORDE]);
FillInitialWorldState(data, count, EY_ALLIANCE_BASE, m_TeamPointsCount[BG_TEAM_ALLIANCE]);
FillInitialWorldState(data, count, 0xab6, 0x0);
FillInitialWorldState(data, count, 0xab5, 0x0);
FillInitialWorldState(data, count, 0xab4, 0x0);
FillInitialWorldState(data, count, 0xab3, 0x0);
FillInitialWorldState(data, count, 0xab2, 0x0);
FillInitialWorldState(data, count, 0xab1, 0x0);
FillInitialWorldState(data, count, 0xab0, 0x0);
FillInitialWorldState(data, count, 0xaaf, 0x0);
FillInitialWorldState(data, count, DRAENEI_RUINS_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == HORDE && m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, DRAENEI_RUINS_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == ALLIANCE && m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, DRAENEI_RUINS_UNCONTROL, m_PointState[BG_EY_NODE_DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, MAGE_TOWER_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == ALLIANCE && m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, MAGE_TOWER_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == HORDE && m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, MAGE_TOWER_UNCONTROL, m_PointState[BG_EY_NODE_MAGE_TOWER] != EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, FEL_REAVER_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == HORDE && m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, FEL_REAVER_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == ALLIANCE && m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, FEL_REAVER_UNCONTROL, m_PointState[BG_EY_NODE_FEL_REAVER] != EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, BLOOD_ELF_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == HORDE && m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, BLOOD_ELF_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == ALLIANCE && m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, BLOOD_ELF_UNCONTROL, m_PointState[BG_EY_NODE_BLOOD_ELF] != EY_POINT_UNDER_CONTROL);
FillInitialWorldState(data, count, NETHERSTORM_FLAG, m_FlagState == BG_EY_FLAG_STATE_ON_BASE);
FillInitialWorldState(data, count, 0xad2, 0x1);
FillInitialWorldState(data, count, 0xad1, 0x1);
FillInitialWorldState(data, count, 0xabe, GetTeamScore(HORDE));
FillInitialWorldState(data, count, 0xabd, GetTeamScore(ALLIANCE));
FillInitialWorldState(data, count, 0xa05, 0x8e);
FillInitialWorldState(data, count, 0xaa0, 0x0);
FillInitialWorldState(data, count, 0xa9f, 0x0);
FillInitialWorldState(data, count, 0xa9e, 0x0);
FillInitialWorldState(data, count, 0xc0d, 0x17b);
}
示例13: EndBattleground
void BattlegroundTP::Update(uint32 diff)
{
Battleground::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
if (GetStartTime() >= 25*MINUTE*IN_MILLISECONDS)
{
if (GetTeamScore(ALLIANCE) == 0)
{
if (GetTeamScore(HORDE) == 0) // No one scored - result is tie
EndBattleground(NULL);
else // Horde has more points and thus wins
EndBattleground(HORDE);
}
else if (GetTeamScore(HORDE) == 0)
EndBattleground(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the last flag
EndBattleground(m_LastFlagCaptureTeam);
else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE)) // Last but not least, check who has the higher score
EndBattleground(HORDE);
else
EndBattleground(ALLIANCE);
}
else if (GetStartTime() > uint32(m_minutesElapsed * MINUTE * IN_MILLISECONDS))
{
++m_minutesElapsed;
UpdateWorldState(BG_TP_STATE_TIMER, 25 - m_minutesElapsed);
}
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_TP_FLAG_STATE_WAIT_RESPAWN)
{
m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff;
if (m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
{
m_FlagsTimer[BG_TEAM_ALLIANCE] = 0;
RespawnFlag(ALLIANCE, true);
}
}
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_GROUND)
{
m_FlagsDropTimer[BG_TEAM_ALLIANCE] -= diff;
if (m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
{
m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0;
RespawnFlagAfterDrop(ALLIANCE);
m_BothFlagsKept = false;
}
}
if (m_FlagState[BG_TEAM_HORDE] == BG_TP_FLAG_STATE_WAIT_RESPAWN)
{
m_FlagsTimer[BG_TEAM_HORDE] -= diff;
if (m_FlagsTimer[BG_TEAM_HORDE] < 0)
{
m_FlagsTimer[BG_TEAM_HORDE] = 0;
RespawnFlag(HORDE, true);
}
}
if (m_FlagState[BG_TEAM_HORDE] == BG_TP_FLAG_STATE_ON_GROUND)
{
m_FlagsDropTimer[BG_TEAM_HORDE] -= diff;
if (m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
{
m_FlagsDropTimer[BG_TEAM_HORDE] = 0;
RespawnFlagAfterDrop(HORDE);
m_BothFlagsKept = false;
}
}
if (m_BothFlagsKept)
{
m_FlagSpellForceTimer += diff;
if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes
{
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
plr->CastSpell(plr, TP_SPELL_FOCUSED_ASSAULT, true);
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
plr->CastSpell(plr, TP_SPELL_FOCUSED_ASSAULT, true);
m_FlagDebuffState = 1;
}
else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes
{
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
{
plr->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
plr->CastSpell(plr, TP_SPELL_BRUTAL_ASSAULT, true);
}
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
{
plr->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
plr->CastSpell(plr, TP_SPELL_BRUTAL_ASSAULT, true);
}
m_FlagDebuffState = 2;
}
//.........这里部分代码省略.........
示例14: SetHordeFlagPicker
void BattlegroundTP::EventPlayerCapturedFlag(Player *Source)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint32 winner = 0;
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
if (Source->GetTeam() == ALLIANCE)
{
if (!this->IsHordeFlagPickedup())
return;
SetHordeFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
// horde flag in base (but not respawned yet)
m_FlagState[BG_TEAM_HORDE] = BG_TP_FLAG_STATE_WAIT_RESPAWN;
// Drop Horde Flag from Player
Source->RemoveAurasDueToSpell(BG_TP_SPELL_HORDE_FLAG);
if (m_FlagDebuffState == 1)
Source->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
if (m_FlagDebuffState == 2)
Source->RemoveAurasDueToSpell(TP_SPELL_BRUTAL_ASSAULT);
if (GetTeamScore(ALLIANCE) < BG_TP_MAX_TEAM_SCORE)
AddPoint(ALLIANCE, 1);
PlaySoundToAll(BG_TP_SOUND_FLAG_CAPTURED_ALLIANCE);
RewardReputationToTeam(890, m_ReputationCapture, ALLIANCE);
}
else
{
if (!this->IsAllianceFlagPickedup())
return;
SetAllianceFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
// alliance flag in base (but not respawned yet)
m_FlagState[BG_TEAM_ALLIANCE] = BG_TP_FLAG_STATE_WAIT_RESPAWN;
// Drop Alliance Flag from Player
Source->RemoveAurasDueToSpell(BG_TP_SPELL_ALLIANCE_FLAG);
if (m_FlagDebuffState == 1)
Source->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
if (m_FlagDebuffState == 2)
Source->RemoveAurasDueToSpell(TP_SPELL_BRUTAL_ASSAULT);
if (GetTeamScore(HORDE) < BG_TP_MAX_TEAM_SCORE)
AddPoint(HORDE, 1);
PlaySoundToAll(BG_TP_SOUND_FLAG_CAPTURED_HORDE);
RewardReputationToTeam(889, m_ReputationCapture, HORDE);
}
//for flag capture is reward 2 honorable kills
RewardHonorToTeam(GetBonusHonorFromKill(2), Source->GetTeam());
SpawnBGObject(BG_TP_OBJECT_H_FLAG, BG_TP_FLAG_RESPAWN_TIME);
SpawnBGObject(BG_TP_OBJECT_A_FLAG, BG_TP_FLAG_RESPAWN_TIME);
if (Source->GetTeam() == ALLIANCE)
SendMessageToAll(LANG_BG_TP_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
else
SendMessageToAll(LANG_BG_TP_CAPTURED_AF, CHAT_MSG_BG_SYSTEM_HORDE, Source);
UpdateFlagState(Source->GetTeam(), 1); // flag state none
UpdateTeamScore(Source->GetTeam());
// only flag capture should be updated
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
// update last flag capture to be used if teamscore is equal
SetLastFlagCapture(Source->GetTeam());
if (GetTeamScore(ALLIANCE) == BG_TP_MAX_TEAM_SCORE)
winner = ALLIANCE;
if (GetTeamScore(HORDE) == BG_TP_MAX_TEAM_SCORE)
winner = HORDE;
if (winner)
{
UpdateWorldState(BG_TP_FLAG_UNK_ALLIANCE, 0);
UpdateWorldState(BG_TP_FLAG_UNK_HORDE, 0);
UpdateWorldState(BG_TP_FLAG_STATE_ALLIANCE, 1);
UpdateWorldState(BG_TP_FLAG_STATE_HORDE, 1);
UpdateWorldState(BG_TP_STATE_TIMER_ACTIVE, 0);
RewardHonorToTeam(BG_TP_Honor[m_HonorMode][BG_TP_WIN], winner);
EndBattleground(winner);
}
else
{
m_FlagsTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] = BG_TP_FLAG_RESPAWN_TIME;
}
}
示例15: RespawnFlag
void BattleGroundWS::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
{
m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff;
if (m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
{
m_FlagsTimer[BG_TEAM_ALLIANCE] = 0;
RespawnFlag(ALLIANCE, true);
}
}
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
{
m_FlagsDropTimer[BG_TEAM_ALLIANCE] -= diff;
if (m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
{
m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0;
RespawnFlagAfterDrop(ALLIANCE);
}
}
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
{
m_FlagsTimer[BG_TEAM_HORDE] -= diff;
if (m_FlagsTimer[BG_TEAM_HORDE] < 0)
{
m_FlagsTimer[BG_TEAM_HORDE] = 0;
RespawnFlag(HORDE, true);
}
}
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
{
m_FlagsDropTimer[BG_TEAM_HORDE] -= diff;
if (m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
{
m_FlagsDropTimer[BG_TEAM_HORDE] = 0;
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);
}
}
}