mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[7446] Applied mangos coding style for AB and EY.
Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
parent
b71759d204
commit
424c8b39df
5 changed files with 82 additions and 66 deletions
|
|
@ -48,7 +48,7 @@ void BattleGroundAB::Update(uint32 diff)
|
|||
|
||||
if( GetStatus() == STATUS_IN_PROGRESS )
|
||||
{
|
||||
int team_points[2] = { 0, 0 };
|
||||
int team_points[BG_TEAMS_COUNT] = { 0, 0 };
|
||||
|
||||
for (int node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
|
||||
{
|
||||
|
|
@ -88,24 +88,24 @@ void BattleGroundAB::Update(uint32 diff)
|
|||
{
|
||||
// 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(SOUND_NODE_CAPTURED_ALLIANCE);
|
||||
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(SOUND_NODE_CAPTURED_HORDE);
|
||||
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_HORDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int team = 0; team < 2; ++team)
|
||||
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 < 2; ++team)
|
||||
for (int team = 0; team < BG_TEAMS_COUNT; ++team)
|
||||
{
|
||||
int points = team_points[team];
|
||||
if( !points )
|
||||
|
|
@ -127,18 +127,18 @@ void BattleGroundAB::Update(uint32 diff)
|
|||
RewardHonorToTeam(GetBonusHonorFromKill(1), (team == BG_TEAM_ALLIANCE) ? ALLIANCE : HORDE);
|
||||
m_HonorScoreTics[team] -= m_HonorTics;
|
||||
}
|
||||
if( !m_IsInformedNearVictory && m_TeamScores[team] > 1800 )
|
||||
if( !m_IsInformedNearVictory && m_TeamScores[team] > BG_AB_WARNING_NEAR_VICTORY_SCORE )
|
||||
{
|
||||
if( team == BG_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(SOUND_NEAR_VICTORY);
|
||||
PlaySoundToAll(BG_AB_SOUND_NEAR_VICTORY);
|
||||
m_IsInformedNearVictory = true;
|
||||
}
|
||||
|
||||
if( m_TeamScores[team] > 2000 )
|
||||
m_TeamScores[team] = 2000;
|
||||
if( m_TeamScores[team] > BG_AB_MAX_TEAM_SCORE )
|
||||
m_TeamScores[team] = BG_AB_MAX_TEAM_SCORE;
|
||||
if( team == BG_TEAM_ALLIANCE )
|
||||
UpdateWorldState(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[team]);
|
||||
if( team == BG_TEAM_HORDE )
|
||||
|
|
@ -147,9 +147,9 @@ void BattleGroundAB::Update(uint32 diff)
|
|||
}
|
||||
|
||||
// Test win condition
|
||||
if( m_TeamScores[BG_TEAM_ALLIANCE] >= 2000 )
|
||||
if( m_TeamScores[BG_TEAM_ALLIANCE] >= BG_AB_MAX_TEAM_SCORE )
|
||||
EndBattleGround(ALLIANCE);
|
||||
if( m_TeamScores[BG_TEAM_HORDE] >= 2000 )
|
||||
if( m_TeamScores[BG_TEAM_HORDE] >= BG_AB_MAX_TEAM_SCORE )
|
||||
EndBattleGround(HORDE);
|
||||
}
|
||||
}
|
||||
|
|
@ -313,7 +313,7 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
|
|||
|
||||
// Team scores
|
||||
data << uint32(BG_AB_OP_RESOURCES_MAX) << uint32(BG_AB_MAX_TEAM_SCORE);
|
||||
data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_SCORE);
|
||||
data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_NEAR_VICTORY_SCORE);
|
||||
data << uint32(BG_AB_OP_RESOURCES_ALLY) << uint32(m_TeamScores[BG_TEAM_ALLIANCE]);
|
||||
data << uint32(BG_AB_OP_RESOURCES_HORDE) << uint32(m_TeamScores[BG_TEAM_HORDE]);
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
|
|||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_AB_HORDE);
|
||||
|
||||
sound = SOUND_NODE_CLAIMED;
|
||||
sound = BG_AB_SOUND_NODE_CLAIMED;
|
||||
}
|
||||
// If node is contested
|
||||
else if( (m_Nodes[node] == BG_AB_NODE_STATUS_ALLY_CONTESTED) || (m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_CONTESTED) )
|
||||
|
|
@ -484,7 +484,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
|
|||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
}
|
||||
sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
|
||||
sound = (teamIndex == 0) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE;
|
||||
}
|
||||
// If node is occupied, change to enemy-contested
|
||||
else
|
||||
|
|
@ -506,7 +506,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
|
|||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
|
||||
sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
|
||||
sound = (teamIndex == 0) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE;
|
||||
}
|
||||
|
||||
// If node is occupied again, send "X has taken the Y" msg.
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ enum BG_AB_Timers
|
|||
|
||||
enum BG_AB_Score
|
||||
{
|
||||
BG_AB_MAX_TEAM_SCORE = 2000,
|
||||
BG_AB_WARNING_SCORE = 1800
|
||||
BG_AB_WARNING_NEAR_VICTORY_SCORE = 1800,
|
||||
BG_AB_MAX_TEAM_SCORE = 2000
|
||||
};
|
||||
|
||||
/* do NOT change the order, else wrong behaviour */
|
||||
|
|
@ -162,12 +162,12 @@ enum BG_AB_NodeStatus
|
|||
|
||||
enum BG_AB_Sounds
|
||||
{
|
||||
SOUND_NODE_CLAIMED = 8192,
|
||||
SOUND_NODE_CAPTURED_ALLIANCE = 8173,
|
||||
SOUND_NODE_CAPTURED_HORDE = 8213,
|
||||
SOUND_NODE_ASSAULTED_ALLIANCE = 8174,
|
||||
SOUND_NODE_ASSAULTED_HORDE = 8212,
|
||||
SOUND_NEAR_VICTORY = 8456
|
||||
BG_AB_SOUND_NODE_CLAIMED = 8192,
|
||||
BG_AB_SOUND_NODE_CAPTURED_ALLIANCE = 8173,
|
||||
BG_AB_SOUND_NODE_CAPTURED_HORDE = 8213,
|
||||
BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE = 8174,
|
||||
BG_AB_SOUND_NODE_ASSAULTED_HORDE = 8212,
|
||||
BG_AB_SOUND_NEAR_VICTORY = 8456
|
||||
};
|
||||
|
||||
#define BG_AB_NotABBGWeekendHonorTicks 330
|
||||
|
|
@ -283,10 +283,10 @@ class BattleGroundAB : public BattleGround
|
|||
uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT];
|
||||
BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT];
|
||||
int32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT];
|
||||
uint32 m_TeamScores[2];
|
||||
uint32 m_lastTick[2];
|
||||
uint32 m_HonorScoreTics[2];
|
||||
uint32 m_ReputationScoreTics[2];
|
||||
uint32 m_TeamScores[BG_TEAMS_COUNT];
|
||||
uint32 m_lastTick[BG_TEAMS_COUNT];
|
||||
uint32 m_HonorScoreTics[BG_TEAMS_COUNT];
|
||||
uint32 m_ReputationScoreTics[BG_TEAMS_COUNT];
|
||||
bool m_IsInformedNearVictory;
|
||||
uint32 m_HonorTics;
|
||||
uint32 m_ReputationTics;
|
||||
|
|
|
|||
|
|
@ -258,9 +258,20 @@ void BattleGroundEY::UpdatePointStatuses()
|
|||
void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
{
|
||||
uint32 score = GetTeamScore(Team);
|
||||
if(score >= EY_MAX_TEAM_SCORE)
|
||||
//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 )
|
||||
{
|
||||
score = EY_MAX_TEAM_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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
class BattleGround;
|
||||
|
||||
#define EY_MAX_TEAM_SCORE 2000
|
||||
#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILISECONDS) //10 seconds
|
||||
#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILISECONDS) //2 seconds
|
||||
|
||||
|
|
@ -213,6 +212,12 @@ enum EYBattleGroundObjectTypes
|
|||
#define BG_EY_NotEYWeekendHonorTicks 330
|
||||
#define BG_EY_EYWeekendHonorTicks 200
|
||||
|
||||
enum BG_EY_Score
|
||||
{
|
||||
BG_EY_WARNING_NEAR_VICTORY_SCORE = 1800,
|
||||
BG_EY_MAX_TEAM_SCORE = 2000
|
||||
};
|
||||
|
||||
enum BG_EY_FlagState
|
||||
{
|
||||
BG_EY_FLAG_STATE_ON_BASE = 0,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7445"
|
||||
#define REVISION_NR "7446"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue