本文整理汇总了C++中GetBonusHonorFromKill函数的典型用法代码示例。如果您正苦于以下问题:C++ GetBonusHonorFromKill函数的具体用法?C++ GetBonusHonorFromKill怎么用?C++ GetBonusHonorFromKill使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetBonusHonorFromKill函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DEBUG_LOG
void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
{
DEBUG_LOG("BattleGroundAV: player destroyed point node %i", node);
STRAWBERRY_ASSERT(m_Nodes[node].Owner != BG_AV_TEAM_NEUTRAL)
BattleGroundTeamIndex ownerTeamIdx = BattleGroundTeamIndex(m_Nodes[node].Owner);
Team ownerTeam = ownerTeamIdx == BG_TEAM_ALLIANCE ? ALLIANCE : HORDE;
// despawn banner
DestroyNode(node);
PopulateNode(node);
UpdateNodeWorldState(node);
if (IsTower(node))
{
uint8 tmp = node - BG_AV_NODES_DUNBALDAR_SOUTH;
// despawn marshal (one of those guys protecting the boss)
SpawnEvent(BG_AV_MARSHAL_A_SOUTH + tmp, 0, false);
UpdateScore(GetOtherTeamIndex(ownerTeamIdx), (-1) * BG_AV_RES_TOWER);
RewardReputationToTeam((ownerTeam == ALLIANCE) ? BG_AV_FACTION_A : BG_AV_FACTION_H, m_RepTowerDestruction, ownerTeam);
RewardHonorToTeam(GetBonusHonorFromKill(BG_AV_KILL_TOWER), ownerTeam);
SendYell2ToAll(LANG_BG_AV_TOWER_TAKEN, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0), GetNodeName(node), (ownerTeam == ALLIANCE) ? LANG_BG_ALLY : LANG_BG_HORDE);
}
else
{
SendYell2ToAll(LANG_BG_AV_GRAVE_TAKEN, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0), GetNodeName(node), (ownerTeam == ALLIANCE) ? LANG_BG_ALLY : LANG_BG_HORDE);
}
}
开发者ID:Bootz,项目名称:StrawberryCore,代码行数:29,代码来源:BattleGroundAV.cpp
示例2: RewardXpToTeam
void BattleGroundEY::EndBattleGround(Team winner)
{
//win reward
if(winner)
RewardXpToTeam(0, 0.8f, winner);
if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
//complete map reward
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
RewardXpToTeam(0, 0.8f, ALLIANCE);
RewardXpToTeam(0, 0.8f, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:KioM,项目名称:mangos,代码行数:17,代码来源:BattleGroundEY.cpp
示例3: RewardHonorToTeam
void BattleGroundSA::EndBattleGround(Team winner)
{
//win reward
if(winner)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), winner);
RewardXpToTeam(0, 0.8f, winner);
}
//complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(2), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(2), HORDE);
RewardXpToTeam(0, 0.8f, ALLIANCE);
RewardXpToTeam(0, 0.8f, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:Sar777,项目名称:mangos,代码行数:17,代码来源:BattleGroundSA.cpp
示例4: RewardHonorToTeam
void BattleGroundEY::EndBattleGround(uint32 winner)
{
//win reward
if (winner)
{
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_EOS_WIN)), winner);
RewardXpToTeam(0, 0.8, winner);
}
//complete map reward
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_EOS_END)), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_EOS_END)), HORDE);
RewardXpToTeam(0, 0.8, ALLIANCE);
RewardXpToTeam(0, 0.8, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:christof69,项目名称:fusion,代码行数:17,代码来源:BattleGroundEY.cpp
示例5: RewardHonorToTeam
void BattleGroundWS::EndBattleGround(uint32 winner)
{
//win reward
if (winner)
{
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_WSG_WIN)), winner);
RewardXpToTeam(0, 0.8f, winner);
}
//complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_WSG_END)), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_WSG_END)), HORDE);
RewardXpToTeam(0, 0.8f, ALLIANCE);
RewardXpToTeam(0, 0.8f, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:Archives,项目名称:try,代码行数:17,代码来源:BattleGroundWS.cpp
示例6: RewardHonorToTeam
void BattleGroundEY::EndBattleGround(Team winner)
{
// win reward
if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
// complete map reward
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
// disable capture points
for (uint8 i = 0; i < EY_NODES_MAX; ++i)
if (GameObject* go = GetBgMap()->GetGameObject(m_towers[i]))
go->SetLootState(GO_JUST_DEACTIVATED);
BattleGround::EndBattleGround(winner);
}
开发者ID:mangosfour,项目名称:server,代码行数:18,代码来源:BattleGroundEY.cpp
示例7: RemoveAuraOnTeam
void BattlegroundWS::EndBattleground(uint32 winner)
{
// Remove flag debuff
RemoveAuraOnTeam(BG_WS_SPELL_FOCUSED_ASSAULT, ALLIANCE);
RemoveAuraOnTeam(BG_WS_SPELL_BRUTAL_ASSAULT, ALLIANCE);
RemoveAuraOnTeam(BG_WS_SPELL_FOCUSED_ASSAULT, HORDE);
RemoveAuraOnTeam(BG_WS_SPELL_BRUTAL_ASSAULT, HORDE);
// Win reward
if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE);
if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE);
//complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE);
Battleground::EndBattleground(winner);
}
开发者ID:boom8866,项目名称:new,代码行数:19,代码来源:BattlegroundWS.cpp
示例8: GetTeamIndexByTeamId
void BattleGroundEY::AddPoints(Team team, uint32 points)
{
BattleGroundTeamIndex team_index = GetTeamIndexByTeamId(team);
m_TeamScores[team_index] += points;
m_honorScoreTicks[team_index] += points;
if (m_honorScoreTicks[team_index] >= m_honorTicks)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), team);
m_honorScoreTicks[team_index] -= m_honorTicks;
}
}
开发者ID:mangosfour,项目名称:server,代码行数:11,代码来源:BattleGroundEY.cpp
示例9: RewardHonorToTeam
void BattleGroundEY::EndBattleGround(uint32 winner)
{
//win reward
if (winner == ALLIANCE)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
RewardXpToTeam(0, 0.8, winner);
}
if (winner == HORDE)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
RewardXpToTeam(0, 0.8, winner);
}
//complete map reward
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
RewardXpToTeam(0, 0.8, ALLIANCE);
RewardXpToTeam(0, 0.8, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:Ankso,项目名称:mangos,代码行数:20,代码来源:BattleGroundEY.cpp
示例10: RewardHonorToTeam
void BattleGroundWS::EndBattleGround(uint32 winner)
{
//win reward
if (winner == ALLIANCE)
{
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE);
RewardXpToTeam(0, 0.8, winner);
}
if (winner == HORDE)
{
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE);
RewardXpToTeam(0, 0.8, winner);
}
//complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE);
RewardXpToTeam(0, 0.8, ALLIANCE);
RewardXpToTeam(0, 0.8, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:Ankso,项目名称:mangos,代码行数:21,代码来源:BattleGroundWS.cpp
示例11: GetTeamIndexByTeamId
void BattlegroundEY::AddPoints(uint32 Team, uint32 Points)
{
BattlegroundTeamId team_index = GetTeamIndexByTeamId(Team);
m_TeamScores[team_index] += Points;
m_HonorScoreTics[team_index] += Points;
if (m_HonorScoreTics[team_index] >= m_HonorTics)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), Team);
m_HonorScoreTics[team_index] -= m_HonorTics;
}
UpdateTeamScore(Team);
}
开发者ID:Gamerzon94,项目名称:wowrean-emu,代码行数:12,代码来源:BattlegroundEY.cpp
示例12: GetTeamIndexByTeamId
void BattleGroundBG::AddPoints(Team team, uint32 points)
{
TeamIndex team_index = GetTeamIndexByTeamId(team);
m_TeamScores[team_index] += points;
m_HonorScoreTics[team_index] += points;
if (m_HonorScoreTics[team_index] >= m_HonorTics)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), team);
m_HonorScoreTics[team_index] -= m_HonorTics;
}
UpdateTeamScore(team);
}
开发者ID:Jojo2323,项目名称:mangos3,代码行数:12,代码来源:BattleGroundBG.cpp
示例13: getGateIdFromDamagedOrDestroyEventId
void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
{
uint32 i = getGateIdFromDamagedOrDestroyEventId(go->GetGOInfo()->building.destroyedEvent);
if (!GateStatus[i])
return;
if (GameObject* g = GetBGObject(i))
{
if (g->GetGOValue()->Building.Health == 0)
{
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws = getWorldStateFromGateId(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
bool rewardHonor = true;
gateDestroyed = true;
switch (i)
{
case BG_SA_GREEN_GATE:
if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_BLUE_GATE:
if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_RED_GATE:
if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_PURPLE_GATE:
if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
default:
break;
}
if (i < 5)
DelObject(i + 14);
UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1);
if (rewardHonor)
UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1));
}
}
}
开发者ID:Asandru,项目名称:Script-Land,代码行数:52,代码来源:BattlegroundSA.cpp
示例14: if
void BattleGroundSA::EndBattleGround(Team winner)
{
if (RoundScores[0].time == RoundScores[1].time) // Noone got in time
winner = TEAM_NONE;
else if (RoundScores[0].time < RoundScores[1].time)
winner = RoundScores[0].winner == ALLIANCE ? ALLIANCE : HORDE;
else
winner = RoundScores[1].winner == ALLIANCE ? ALLIANCE : HORDE;
//win reward
if(winner)
{
RewardXpToTeam(0, 0.8f, winner);
}
//complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(2), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(2), HORDE);
RewardXpToTeam(0, 0.8f, ALLIANCE);
RewardXpToTeam(0, 0.8f, HORDE);
BattleGround::EndBattleGround(winner);
}
开发者ID:Nedj,项目名称:mangos,代码行数:23,代码来源:BattleGroundSA.cpp
示例15: GetTeamIndexByTeamId
void BattleGroundEY::AddPoints(Team team, uint32 Points)
{
BattleGroundTeamIndex team_index = GetTeamIndexByTeamId(team);
m_TeamScores[team_index] += Points;
m_HonorScoreTics[team_index] += Points;
m_ExperienceTics[team_index] += Points;
if (m_HonorScoreTics[team_index] >= m_HonorTics )
{
RewardHonorToTeam(GetBonusHonorFromKill(1), team);
m_HonorScoreTics[team_index] -= m_HonorTics;
}
if (m_ExperienceTics[team_index] >= BG_EY_ExperienceTicks )
{
RewardXpToTeam(0, 0.8f, team);
m_ExperienceTics[team_index] -= m_HonorTics;
}
UpdateTeamScore(team);
}
开发者ID:SeTM,项目名称:mangos-1,代码行数:18,代码来源:BattleGroundEY.cpp
示例16: GetTeamIndexByTeamId
void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
{
BattleGroundTeamId team_index = GetTeamIndexByTeamId(Team);
m_TeamScores[team_index] += Points;
m_HonorScoreTics[team_index] += Points;
m_ExperienceTics[team_index] += Points;
if (m_HonorScoreTics[team_index] >= m_HonorTics )
{
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_FLAG_EOS)), Team);
m_HonorScoreTics[team_index] -= m_HonorTics;
}
if (m_ExperienceTics[team_index] >= BG_EY_ExperienceTicks )
{
RewardXpToTeam(0, 0.8, Team);
m_ExperienceTics[team_index] -= m_HonorTics;
}
UpdateTeamScore(Team);
}
开发者ID:christof69,项目名称:fusion,代码行数:18,代码来源:BattleGroundEY.cpp
示例17: GetGateIDFromDestroyEventID
void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroyedEvent)
{
uint32 i = GetGateIDFromDestroyEventID(destroyedEvent);
if (!GateStatus[i])
return;
if (GameObject* g = GetBGObject(i))
{
if (g->GetGOValue()->building.health == 0)
{
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws = GetWorldStateFromGateID(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
bool rewardHonor = true;
switch(i)
{
case BG_SA_GREEN_GATE:
if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_BLUE_GATE:
if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_RED_GATE:
if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_PURPLE_GATE:
if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
}
if (i < 5)
DelObject(i+9);
UpdatePlayerScore(pl,SCORE_DESTROYED_WALL, 1);
if (rewardHonor)
UpdatePlayerScore(pl,SCORE_BONUS_HONOR,(GetBonusHonorFromKill(1)));
}
}
}
开发者ID:mmihail,项目名称:trinitycore10353,代码行数:43,代码来源:BattlegroundSA.cpp
示例18: SetHordeFlagPicker
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);
if (Source->HasAura(BG_WS_SPELL_FOCUSED_ASSAULT))
Source->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
if (Source->HasAura(BG_WS_SPELL_BRUTAL_ASSAULT))
Source->RemoveAurasDueToSpell(BG_WS_SPELL_BRUTAL_ASSAULT);
if (Source->GetTeam() == ALLIANCE)
{
if (!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_WS_FLAG_STATE_WAIT_RESPAWN;
// Drop Horde Flag from Player
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
if (GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
AddPoint(ALLIANCE, 1);
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE);
RewardReputationToTeam(BATTLEGROUND_WS, m_ReputationCapture, ALLIANCE);
}
else
{
if (!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_WS_FLAG_STATE_WAIT_RESPAWN;
// Drop Alliance Flag from Player
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
if (GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
AddPoint(HORDE, 1);
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE);
RewardReputationToTeam(BATTLEGROUND_WS, m_ReputationCapture, HORDE);
}
//for flag capture is reward 2 honorable kills
RewardHonorToTeam(GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_FLAG_WSG)), Source->GetTeam());
RewardXpToTeam(0, 0.6f, Source->GetTeam());
//flag carrier gets another 2 honorable kills
Source->RewardHonor(NULL, 0, GetBonusHonorFromKill(sWorld.getConfig(CONFIG_UINT32_BONUS_HONOR_FLAG_WSG)));
// despawn flags
SpawnEvent(WS_EVENT_FLAG_A, 0, false);
SpawnEvent(WS_EVENT_FLAG_H, 0, false);
if (Source->GetTeam() == ALLIANCE)
SendMessageToAll(LANG_BG_WS_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
else
SendMessageToAll(LANG_BG_WS_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
Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE,1);
if (GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
winner = ALLIANCE;
if (GetTeamScore(HORDE) == BG_WS_MAX_TEAM_SCORE)
winner = HORDE;
if (winner)
{
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 0);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 0);
UpdateWorldState(BG_WS_FLAG_STATE_ALLIANCE, 1);
UpdateWorldState(BG_WS_FLAG_STATE_HORDE, 1);
EndBattleGround(winner);
}
else
{
m_FlagsTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] = BG_WS_FLAG_RESPAWN_TIME;
}
}
开发者ID:Archives,项目名称:try,代码行数:84,代码来源:BattleGroundWS.cpp
示例19: while
void BattlegroundAB::PostUpdateImpl(uint32 diff)
{
if (GetStatus() == STATUS_IN_PROGRESS)
{
_bgEvents.Update(diff);
while (uint32 eventId =_bgEvents.ExecuteEvent())
switch (eventId)
{
case BG_AB_EVENT_UPDATE_BANNER_STABLE:
case BG_AB_EVENT_UPDATE_BANNER_FARM:
case BG_AB_EVENT_UPDATE_BANNER_BLACKSMITH:
case BG_AB_EVENT_UPDATE_BANNER_LUMBERMILL:
case BG_AB_EVENT_UPDATE_BANNER_GOLDMINE:
CreateBanner(eventId - BG_AB_EVENT_UPDATE_BANNER_STABLE, false);
break;
case BG_AB_EVENT_CAPTURE_STABLE:
case BG_AB_EVENT_CAPTURE_FARM:
case BG_AB_EVENT_CAPTURE_BLACKSMITH:
case BG_AB_EVENT_CAPTURE_LUMBERMILL:
case BG_AB_EVENT_CAPTURE_GOLDMINE:
{
uint8 node = eventId - BG_AB_EVENT_CAPTURE_STABLE;
TeamId teamId = _capturePointInfo[node]._state == BG_AB_NODE_STATE_ALLY_CONTESTED ? TEAM_ALLIANCE : TEAM_HORDE;
DeleteBanner(node);
_capturePointInfo[node]._ownerTeamId = teamId;
_capturePointInfo[node]._state = teamId == TEAM_ALLIANCE ? BG_AB_NODE_STATE_ALLY_OCCUPIED : BG_AB_NODE_STATE_HORDE_OCCUPIED;
_capturePointInfo[node]._captured = true;
CreateBanner(node, false);
NodeOccupied(node);
SendNodeUpdate(node);
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, teamId == TEAM_ALLIANCE ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE, NULL, teamId == TEAM_ALLIANCE ? LANG_BG_AB_ALLY : LANG_BG_AB_HORDE, LANG_BG_AB_NODE_STABLES + node);
PlaySoundToAll(teamId == TEAM_ALLIANCE ? BG_AB_SOUND_NODE_CAPTURED_ALLIANCE : BG_AB_SOUND_NODE_CAPTURED_HORDE);
break;
}
case BG_AB_EVENT_ALLIANCE_TICK:
case BG_AB_EVENT_HORDE_TICK:
{
TeamId teamId = TeamId(eventId - BG_AB_EVENT_ALLIANCE_TICK);
uint8 controlledPoints = _controlledPoints[teamId];
if (controlledPoints == 0)
{
_bgEvents.ScheduleEvent(eventId, 3000);
break;
}
uint8 honorRewards = uint8(m_TeamScores[teamId] / _honorTics);
uint8 reputationRewards = uint8(m_TeamScores[teamId] / _reputationTics);
uint8 information = uint8(m_TeamScores[teamId] / BG_AB_WARNING_NEAR_VICTORY_SCORE);
m_TeamScores[teamId] += BG_AB_TickPoints[controlledPoints];
if (m_TeamScores[teamId] > BG_AB_MAX_TEAM_SCORE)
m_TeamScores[teamId] = BG_AB_MAX_TEAM_SCORE;
if (honorRewards < uint8(m_TeamScores[teamId] / _honorTics))
RewardHonorToTeam(GetBonusHonorFromKill(1), teamId);
if (reputationRewards < uint8(m_TeamScores[teamId] / _reputationTics))
RewardReputationToTeam(teamId == TEAM_ALLIANCE ? 509 : 510, 10, teamId);
if (information < uint8(m_TeamScores[teamId] / BG_AB_WARNING_NEAR_VICTORY_SCORE))
{
SendMessageToAll(teamId == TEAM_ALLIANCE ? LANG_BG_AB_A_NEAR_VICTORY : LANG_BG_AB_H_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_AB_SOUND_NEAR_VICTORY);
}
UpdateWorldState(teamId == TEAM_ALLIANCE ? BG_AB_OP_RESOURCES_ALLY : BG_AB_OP_RESOURCES_HORDE, m_TeamScores[teamId]);
if (m_TeamScores[teamId] > m_TeamScores[GetOtherTeamId(teamId)] + 500)
_teamScores500Disadvantage[GetOtherTeamId(teamId)] = true;
if (m_TeamScores[teamId] >= BG_AB_MAX_TEAM_SCORE)
EndBattleground(teamId);
_bgEvents.ScheduleEvent(eventId, BG_AB_TickIntervals[controlledPoints]);
break;
}
}
}
}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:76,代码来源:BattlegroundAB.cpp
示例20: _CreateBanner
void BattlegroundAB::PostUpdateImpl(uint32 diff)
{
if (GetStatus() == STATUS_IN_PROGRESS)
{
int team_points[BG_TEAMS_COUNT] = { 0, 0 };
for (int node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
{
// 3 sec delay to spawn new banner instead previous despawned one
if (m_BannerTimers[node].timer)
{
if (m_BannerTimers[node].timer > diff)
m_BannerTimers[node].timer -= diff;
else
{
m_BannerTimers[node].timer = 0;
_CreateBanner(node, m_BannerTimers[node].type, m_BannerTimers[node].teamIndex, false);
}
}
// 1-minute to occupy a node from contested state
if (m_NodeTimers[node])
{
if (m_NodeTimers[node] > diff)
m_NodeTimers[node] -= diff;
else
{
m_NodeTimers[node] = 0;
// Change from contested to occupied !
uint8 teamIndex = m_Nodes[node]-1;
m_prevNodes[node] = m_Nodes[node];
m_Nodes[node] += 2;
// burn current contested banner
_DelBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex);
// create new occupied banner
_CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true);
_SendNodeUpdate(node);
_NodeOccupied(node, (teamIndex == 0) ? ALLIANCE:HORDE);
// Message to chatlog
if (teamIndex == 0)
{
// FIXME: team and node names not localized
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node));
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_ALLIANCE);
}
else
{
// FIXME: team and node names not localized
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node));
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_HORDE);
}
}
}
for (int team = 0; team < BG_TEAMS_COUNT; ++team)
if (m_Nodes[node] == team + BG_AB_NODE_TYPE_OCCUPIED)
++team_points[team];
}
// Accumulate points
for (int team = 0; team < BG_TEAMS_COUNT; ++team)
{
int points = team_points[team];
if (!points)
continue;
m_lastTick[team] += diff;
if (m_lastTick[team] > BG_AB_TickIntervals[points])
{
m_lastTick[team] -= BG_AB_TickIntervals[points];
m_TeamScores[team] += BG_AB_TickPoints[points];
m_HonorScoreTics[team] += BG_AB_TickPoints[points];
m_ReputationScoreTics[team] += BG_AB_TickPoints[points];
if (m_ReputationScoreTics[team] >= m_ReputationTics)
{
(team == TEAM_ALLIANCE) ? RewardReputationToTeam(509, 10, ALLIANCE) : RewardReputationToTeam(510, 10, HORDE);
m_ReputationScoreTics[team] -= m_ReputationTics;
}
if (m_HonorScoreTics[team] >= m_HonorTics)
{
RewardHonorToTeam(GetBonusHonorFromKill(1), (team == TEAM_ALLIANCE) ? ALLIANCE : HORDE);
m_HonorScoreTics[team] -= m_HonorTics;
}
if (!m_IsInformedNearVictory && m_TeamScores[team] > BG_AB_WARNING_NEAR_VICTORY_SCORE)
{
if (team == TEAM_ALLIANCE)
SendMessageToAll(LANG_BG_AB_A_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else
SendMessageToAll(LANG_BG_AB_H_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_AB_SOUND_NEAR_VICTORY);
m_IsInformedNearVictory = true;
}
if (m_TeamScores[team] > BG_AB_MAX_TEAM_SCORE)
m_TeamScores[team] = BG_AB_MAX_TEAM_SCORE;
//.........这里部分代码省略.........
开发者ID:BravadoToDeath,项目名称:ArkCORE-NG,代码行数:101,代码来源:BattlegroundAB.cpp
注:本文中的GetBonusHonorFromKill函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论