[7388] Fixed battleground premature warning message. SQL files are attached, you must execute them!

Fix for message's color will be soon.

Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
Triply 2009-03-06 13:24:55 +01:00
parent a07718fe29
commit 17100c67a8
7 changed files with 39 additions and 8 deletions

View file

@ -226,7 +226,6 @@ void BattleGround::Update(uint32 diff)
{
m_PrematureCountDown = true;
m_PrematureCountDownTimer = sBattleGroundMgr.GetPrematureFinishTime();
SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
}
else if(m_PrematureCountDownTimer < diff)
{
@ -238,8 +237,17 @@ void BattleGround::Update(uint32 diff)
{
uint32 newtime = m_PrematureCountDownTimer - diff;
// announce every minute
if(m_PrematureCountDownTimer != sBattleGroundMgr.GetPrematureFinishTime() && newtime / 60000 != m_PrematureCountDownTimer / 60000)
SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
if( newtime > (MINUTE * IN_MILISECONDS) )
{
if( newtime / (MINUTE * IN_MILISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS) )
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS)));
}
else
{
//announce every 15 seconds
if( newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS) )
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS));
}
m_PrematureCountDownTimer = newtime;
}
}
@ -1024,7 +1032,7 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
// returns the number how many players can join battleground to MaxPlayersPerTeam
uint32 BattleGround::GetFreeSlotsForTeam(uint32 Team) const
{
//if BG is starting ... invite anyone
//return free slot count to MaxPlayerPerTeam
if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS)
return (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0;
@ -1372,6 +1380,18 @@ void BattleGround::SendMessageToAll(int32 entry)
SendPacketToAll(&data);
}
//copied from void ChatHandler::PSendSysMessage(int32 entry, ...)
void BattleGround::PSendMessageToAll(int32 entry, ...)
{
const char *format = GetMangosString(entry);
va_list ap;
char str [2048];
va_start(ap, entry);
vsnprintf(str,2048,format, ap );
va_end(ap);
SendMessageToAll(str);
}
void BattleGround::EndNow()
{
RemoveFromBGFreeSlotQueue();

View file

@ -389,6 +389,7 @@ class BattleGround
void SendMessageToAll(char const* text);
void SendMessageToAll(int32 entry);
void PSendMessageToAll(int32 entry, ... );
/* Raid Group */
Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }

View file

@ -658,7 +658,7 @@ enum MangosStrings
LANG_ARENA_NOT_ENOUGH_PLAYERS = 723, // "Your group does not have enough players to join this match."
LANG_ARENA_GOLD_WINS = 724, // "The Gold Team wins!"
LANG_ARENA_GREEN_WINS = 725, // "The Green Team wins!"
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 726, // The battleground will end soon, because there aren't enough players. Get more ppl or win already!
// = 726, not used
LANG_BG_GROUP_OFFLINE_MEMBER = 727, // "Your group has an offline member. Please remove him before joining."
LANG_BG_GROUP_MIXED_FACTION = 728, // "Your group has players from the opposing faction. You can't join the battleground as a group."
LANG_BG_GROUP_MIXED_LEVELS = 729, // "Your group has players from different battleground brakets. You can't join as group."
@ -680,7 +680,12 @@ enum MangosStrings
LANG_DIST_ARENA_POINTS_TEAM_START = 744,
LANG_DIST_ARENA_POINTS_TEAM_END = 745,
LANG_DIST_ARENA_POINTS_END = 746,
// Room for batleground/arena strings 747-799 not used
// = 747, not used
// = 748, not used
// = 749, not used
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 750, // "Not enough players. This game will close in %u mins."
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS = 751, // "Not enough players. This game will close in %u seconds."
// Room for batleground/arena strings 752-799 not used
// in game strings
// = 800, not used

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7387"
#define REVISION_NR "7388"
#endif // __REVISION_NR_H__