[7399] Rewrited BattleGround starting code - moved it to battleground class.

Fixed message color for premature finish warnings.
Fixed .debug bg command won't allow 1v0 arenas now, only battlegrounds 1v0.
Added battleground announcer message removed in [7384].
Patch is tested, everything worked for me. You must execute attached sql file!

Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
Triply 2009-03-07 11:03:56 +01:00
parent 67f307d5f7
commit 1ee2320484
29 changed files with 469 additions and 425 deletions

View file

@ -2836,6 +2836,9 @@ INSERT INTO `mangos_string` VALUES
(746,'Done flushing Arena points.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (746,'Done flushing Arena points.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(750,'Not enough players. This game will close in %u mins.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (750,'Not enough players. This game will close in %u mins.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(751,'Not enough players. This game will close in %u seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (751,'Not enough players. This game will close in %u seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(753,'The battle for Warsong Gulch begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(754,'The battle for Arathi Basin begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(755,'The battle for Eye of the Storm begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),

View file

@ -0,0 +1,3 @@
INSERT INTO mangos_string VALUES (753,'The battle for Warsong Gulch begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO mangos_string VALUES (754,'The battle for Arathi Basin begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO mangos_string VALUES (755,'The battle for Eye of the Storm begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

View file

@ -88,6 +88,16 @@ BattleGround::BattleGround()
m_PrematureCountDown = false; m_PrematureCountDown = false;
m_PrematureCountDown = 0; m_PrematureCountDown = 0;
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_2M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set to some default existing values
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
} }
BattleGround::~BattleGround() BattleGround::~BattleGround()
@ -169,6 +179,11 @@ void BattleGround::Update(uint32 diff)
} }
} }
//TODO: move this system to spell system and ressurect players correclt there!
/*********************************************************/
/*** BATTLEGROUND RESSURECTION SYSTEM ***/
/*********************************************************/
//this should be handled by spell system: //this should be handled by spell system:
m_LastResurrectTime += diff; m_LastResurrectTime += diff;
if (m_LastResurrectTime >= RESURRECTION_INTERVAL) if (m_LastResurrectTime >= RESURRECTION_INTERVAL)
@ -219,6 +234,10 @@ void BattleGround::Update(uint32 diff)
m_ResurrectQueue.clear(); m_ResurrectQueue.clear();
} }
/*********************************************************/
/*** BATTLEGROUND BALLANCE SYSTEM ***/
/*********************************************************/
// if less then minimum players are in on one side, then start premature finish timer // if less then minimum players are in on one side, then start premature finish timer
if(GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattleGroundMgr.GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam())) if(GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattleGroundMgr.GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam()))
{ {
@ -240,13 +259,13 @@ void BattleGround::Update(uint32 diff)
if( newtime > (MINUTE * IN_MILISECONDS) ) if( newtime > (MINUTE * IN_MILISECONDS) )
{ {
if( newtime / (MINUTE * IN_MILISECONDS) != m_PrematureCountDownTimer / (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))); PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, CHAT_MSG_SYSTEM, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS)));
} }
else else
{ {
//announce every 15 seconds //announce every 15 seconds
if( newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS) ) if( newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS) )
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS)); PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS));
} }
m_PrematureCountDownTimer = newtime; m_PrematureCountDownTimer = newtime;
} }
@ -254,6 +273,88 @@ void BattleGround::Update(uint32 diff)
else if (m_PrematureCountDown) else if (m_PrematureCountDown)
m_PrematureCountDown = false; m_PrematureCountDown = false;
/*********************************************************/
/*** BATTLEGROUND STARTING SYSTEM ***/
/*********************************************************/
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
{
ModifyStartDelayTime(diff);
if (!(m_Events & BG_STARTING_EVENT_1))
{
m_Events |= BG_STARTING_EVENT_1;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
StartingEventCloseDoors();
SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]);
//first start warning - 2 or 1 minute
SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
// After 1 minute or 30 seconds, warning is signalled
else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2))
{
m_Events |= BG_STARTING_EVENT_2;
SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_SECOND], CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
// After 30 or 15 seconds, warning is signalled
else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_THIRD] && !(m_Events & BG_STARTING_EVENT_3))
{
m_Events |= BG_STARTING_EVENT_3;
SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_THIRD], CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
// delay expired (atfer 2 or 1 minute)
else if (GetStartDelayTime() <= 0 && !(m_Events & BG_STARTING_EVENT_4))
{
m_Events |= BG_STARTING_EVENT_4;
StartingEventOpenDoors();
SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FOURTH], CHAT_MSG_BG_SYSTEM_NEUTRAL);
SetStatus(STATUS_IN_PROGRESS);
SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FOURTH]);
//remove preparation
if( isArena() )
{
//TODO : add arena sound (PlaySoundToAll(SOUND_ARENA_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player *plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
EndBattleGround(HORDE);
else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
EndBattleGround(ALLIANCE);
}
else
{
PlaySoundToAll(SOUND_BG_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player* plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
//Announce BG starting:
if( sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE) )
{
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
}
}
}
}
/*********************************************************/
/*** BATTLEGROUND ENDING SYSTEM ***/
/*********************************************************/
if(GetStatus() == STATUS_WAIT_LEAVE) if(GetStatus() == STATUS_WAIT_LEAVE)
{ {
// remove all players from battleground after 2 minutes // remove all players from battleground after 2 minutes
@ -267,6 +368,7 @@ void BattleGround::Update(uint32 diff)
// do not change any battleground's private variables // do not change any battleground's private variables
} }
} }
} }
void BattleGround::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O) void BattleGround::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O)
@ -1365,31 +1467,31 @@ bool BattleGround::AddSpiritGuide(uint32 type, float x, float y, float z, float
return true; return true;
} }
void BattleGround::SendMessageToAll(char const* text) void BattleGround::SendMessageToAll(char const* text, uint8 type)
{ {
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, text, NULL); ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, text, NULL);
SendPacketToAll(&data); SendPacketToAll(&data);
} }
void BattleGround::SendMessageToAll(int32 entry) void BattleGround::SendMessageToAll(int32 entry, uint8 type)
{ {
char const* text = GetMangosString(entry); char const* text = GetMangosString(entry);
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, text, NULL); ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, text, NULL);
SendPacketToAll(&data); SendPacketToAll(&data);
} }
//copied from void ChatHandler::PSendSysMessage(int32 entry, ...) //copied from void ChatHandler::PSendSysMessage(int32 entry, ...)
void BattleGround::PSendMessageToAll(int32 entry, ...) void BattleGround::PSendMessageToAll(int32 entry, uint8 type, ...)
{ {
const char *format = GetMangosString(entry); const char *format = GetMangosString(entry);
va_list ap; va_list ap;
char str [2048]; char str [2048];
va_start(ap, entry); va_start(ap, type);
vsnprintf(str,2048,format, ap ); vsnprintf(str,2048,format, ap );
va_end(ap); va_end(ap);
SendMessageToAll(str); SendMessageToAll(str, type);
} }
void BattleGround::EndNow() void BattleGround::EndNow()

View file

@ -90,16 +90,21 @@ enum BattleGroundTimeIntervals
INVITE_ACCEPT_WAIT_TIME = 80000, // ms INVITE_ACCEPT_WAIT_TIME = 80000, // ms
TIME_TO_AUTOREMOVE = 120000, // ms TIME_TO_AUTOREMOVE = 120000, // ms
MAX_OFFLINE_TIME = 300000, // ms MAX_OFFLINE_TIME = 300000, // ms
START_DELAY0 = 120000, // ms
START_DELAY1 = 60000, // ms
START_DELAY2 = 30000, // ms
START_DELAY3 = 15000, // ms used only in arena
RESPAWN_ONE_DAY = 86400, // secs RESPAWN_ONE_DAY = 86400, // secs
RESPAWN_IMMEDIATELY = 0, // secs RESPAWN_IMMEDIATELY = 0, // secs
BUFF_RESPAWN_TIME = 180, // secs BUFF_RESPAWN_TIME = 180, // secs
BG_HONOR_SCORE_TICKS = 330 // points BG_HONOR_SCORE_TICKS = 330 // points
}; };
enum BattleGroundStartTimeIntervals
{
BG_START_DELAY_2M = 120000, // ms (2 minutes)
BG_START_DELAY_1M = 60000, // ms (1 minute)
BG_START_DELAY_30S = 30000, // ms (30 seconds)
BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
BG_START_DELAY_NONE = 0, // ms
};
enum BattleGroundBuffObjects enum BattleGroundBuffObjects
{ {
BG_OBJECTID_SPEEDBUFF_ENTRY = 179871, BG_OBJECTID_SPEEDBUFF_ENTRY = 179871,
@ -214,6 +219,24 @@ enum BattleGroundTeamId
}; };
#define BG_TEAMS_COUNT 2 #define BG_TEAMS_COUNT 2
enum BattleGroundStartingEvents
{
BG_STARTING_EVENT_NONE = 0x00,
BG_STARTING_EVENT_1 = 0x01,
BG_STARTING_EVENT_2 = 0x02,
BG_STARTING_EVENT_3 = 0x04,
BG_STARTING_EVENT_4 = 0x08
};
enum BattleGroundStartingEventsIds
{
BG_STARTING_EVENT_FIRST = 0,
BG_STARTING_EVENT_SECOND = 1,
BG_STARTING_EVENT_THIRD = 2,
BG_STARTING_EVENT_FOURTH = 3
};
#define BG_STARTING_EVENT_COUNT 4
enum BattleGroundJoinError enum BattleGroundJoinError
{ {
BG_JOIN_ERR_OK = 0, BG_JOIN_ERR_OK = 0,
@ -266,6 +289,8 @@ class BattleGround
return true; return true;
} }
virtual void Reset(); // resets all common properties for battlegrounds, must be implemented and called in BG subclass virtual void Reset(); // resets all common properties for battlegrounds, must be implemented and called in BG subclass
virtual void StartingEventCloseDoors() {}
virtual void StartingEventOpenDoors() {}
/* Battleground */ /* Battleground */
// Get methods: // Get methods:
@ -387,9 +412,9 @@ class BattleGround
void EndBattleGround(uint32 winner); void EndBattleGround(uint32 winner);
void BlockMovement(Player *plr); void BlockMovement(Player *plr);
void SendMessageToAll(char const* text); void SendMessageToAll(char const* text, uint8 type);
void SendMessageToAll(int32 entry); void SendMessageToAll(int32 entry, uint8 type);
void PSendMessageToAll(int32 entry, ... ); void PSendMessageToAll(int32 entry, uint8 type, ... );
/* Raid Group */ /* Raid Group */
Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; } Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
@ -421,7 +446,6 @@ class BattleGround
virtual void HandleKillPlayer(Player *player, Player *killer); virtual void HandleKillPlayer(Player *player, Player *killer);
/* Battleground events */ /* Battleground events */
/* these functions will return true event is possible, but false if player is bugger */
virtual void EventPlayerDroppedFlag(Player* /*player*/) {} virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {} virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
virtual void EventPlayerCapturedFlag(Player* /*player*/) {} virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
@ -480,9 +504,12 @@ class BattleGround
std::map<uint64, std::vector<uint64> > m_ReviveQueue; std::map<uint64, std::vector<uint64> > m_ReviveQueue;
/* /*
this is important variable used for invitation messages these are important variables used for starting messages
*/ */
uint8 m_Events; uint8 m_Events;
BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT];
//this must be filled in constructors!
uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT];
bool m_BuffChange; bool m_BuffChange;

View file

@ -19,10 +19,20 @@
#include "Player.h" #include "Player.h"
#include "BattleGround.h" #include "BattleGround.h"
#include "BattleGroundAA.h" #include "BattleGroundAA.h"
#include "Language.h"
BattleGroundAA::BattleGroundAA() BattleGroundAA::BattleGroundAA()
{ {
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
} }
BattleGroundAA::~BattleGroundAA() BattleGroundAA::~BattleGroundAA()
@ -35,6 +45,14 @@ void BattleGroundAA::Update(uint32 diff)
BattleGround::Update(diff); BattleGround::Update(diff);
} }
void BattleGroundAA::StartingEventCloseDoors()
{
}
void BattleGroundAA::StartingEventOpenDoors()
{
}
void BattleGroundAA::AddPlayer(Player *plr) void BattleGroundAA::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -39,6 +39,9 @@ class BattleGroundAA : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid); void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround(); bool SetupBattleGround();

View file

@ -33,6 +33,11 @@ BattleGroundAB::BattleGroundAB()
m_BuffChange = true; m_BuffChange = true;
m_BgObjects.resize(BG_AB_OBJECT_MAX); m_BgObjects.resize(BG_AB_OBJECT_MAX);
m_BgCreatures.resize(BG_AB_ALL_NODES_COUNT); m_BgCreatures.resize(BG_AB_ALL_NODES_COUNT);
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AB_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AB_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AB_START_HALF_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_AB_HAS_BEGUN;
} }
BattleGroundAB::~BattleGroundAB() BattleGroundAB::~BattleGroundAB()
@ -43,81 +48,7 @@ void BattleGroundAB::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
if( GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize() ) if( GetStatus() == STATUS_IN_PROGRESS )
{
ModifyStartDelayTime(diff);
if( !(m_Events & 0x01) )
{
m_Events |= 0x01;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
sLog.outDebug("Arathi Basin: entering state STATUS_WAIT_JOIN ...");
// despawn banners, auras and buffs
for (int obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * 8; ++obj)
SpawnBGObject(obj, RESPAWN_ONE_DAY);
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT * 3; ++i)
SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + i, RESPAWN_ONE_DAY);
// Starting doors
SpawnBGObject(BG_AB_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
DoorClose(BG_AB_OBJECT_GATE_A);
DoorClose(BG_AB_OBJECT_GATE_H);
// Starting base spirit guides
_NodeOccupied(BG_AB_SPIRIT_ALIANCE,ALLIANCE);
_NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE);
SetStartDelayTime(START_DELAY0);
}
// After 1 minute, warning is signalled
else if( GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04) )
{
m_Events |= 0x04;
SendMessageToAll(GetMangosString(LANG_BG_AB_ONEMINTOSTART));
}
// After 1,5 minute, warning is signalled
else if( GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08) )
{
m_Events |= 0x08;
SendMessageToAll(GetMangosString(LANG_BG_AB_HALFMINTOSTART));
}
// After 2 minutes, gates OPEN ! x)
else if( GetStartDelayTime() < 0 && !(m_Events & 0x10) )
{
m_Events |= 0x10;
SendMessageToAll(GetMangosString(LANG_BG_AB_STARTED));
// spawn neutral banners
for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
SpawnBGObject(banner, RESPAWN_IMMEDIATELY);
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
//randomly select buff to spawn
uint8 buff = urand(0, 2);
SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3, RESPAWN_IMMEDIATELY);
}
DoorOpen(BG_AB_OBJECT_GATE_A);
DoorOpen(BG_AB_OBJECT_GATE_H);
PlaySoundToAll(SOUND_BG_START);
SetStatus(STATUS_IN_PROGRESS);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player* plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
}
}
else if( GetStatus() == STATUS_IN_PROGRESS )
{ {
int team_points[2] = { 0, 0 }; int team_points[2] = { 0, 0 };
@ -195,9 +126,9 @@ void BattleGroundAB::Update(uint32 diff)
if( !m_IsInformedNearVictory && m_TeamScores[team] > 1800 ) if( !m_IsInformedNearVictory && m_TeamScores[team] > 1800 )
{ {
if( team == BG_TEAM_ALLIANCE ) if( team == BG_TEAM_ALLIANCE )
SendMessageToAll(GetMangosString(LANG_BG_AB_A_NEAR_VICTORY)); SendMessageToAll(GetMangosString(LANG_BG_AB_A_NEAR_VICTORY), CHAT_MSG_BG_SYSTEM_NEUTRAL);
else else
SendMessageToAll(GetMangosString(LANG_BG_AB_H_NEAR_VICTORY)); SendMessageToAll(GetMangosString(LANG_BG_AB_H_NEAR_VICTORY), CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(SOUND_NEAR_VICTORY); PlaySoundToAll(SOUND_NEAR_VICTORY);
m_IsInformedNearVictory = true; m_IsInformedNearVictory = true;
} }
@ -219,6 +150,40 @@ void BattleGroundAB::Update(uint32 diff)
} }
} }
void BattleGroundAB::StartingEventCloseDoors()
{
// despawn banners, auras and buffs
for (int obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * 8; ++obj)
SpawnBGObject(obj, RESPAWN_ONE_DAY);
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT * 3; ++i)
SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + i, RESPAWN_ONE_DAY);
// Starting doors
DoorClose(BG_AB_OBJECT_GATE_A);
DoorClose(BG_AB_OBJECT_GATE_H);
SpawnBGObject(BG_AB_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
// Starting base spirit guides
_NodeOccupied(BG_AB_SPIRIT_ALIANCE,ALLIANCE);
_NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE);
}
void BattleGroundAB::StartingEventOpenDoors()
{
// spawn neutral banners
for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
SpawnBGObject(banner, RESPAWN_IMMEDIATELY);
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
//randomly select buff to spawn
uint8 buff = urand(0, 2);
SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3, RESPAWN_IMMEDIATELY);
}
DoorOpen(BG_AB_OBJECT_GATE_A);
DoorOpen(BG_AB_OBJECT_GATE_H);
}
void BattleGroundAB::AddPlayer(Player *plr) void BattleGroundAB::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -238,6 +238,8 @@ class BattleGroundAB : public BattleGround
void Update(uint32 diff); void Update(uint32 diff);
void AddPlayer(Player *plr); void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid); void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);
virtual bool SetupBattleGround(); virtual bool SetupBattleGround();

View file

@ -27,6 +27,11 @@
BattleGroundAV::BattleGroundAV() BattleGroundAV::BattleGroundAV()
{ {
//TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_EY_START_HALF_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_EY_HAS_BEGUN;
} }
BattleGroundAV::~BattleGroundAV() BattleGroundAV::~BattleGroundAV()
@ -39,6 +44,14 @@ void BattleGroundAV::Update(uint32 diff)
BattleGround::Update(diff); BattleGround::Update(diff);
} }
void BattleGroundAV::StartingEventCloseDoors()
{
}
void BattleGroundAV::StartingEventOpenDoors()
{
}
void BattleGroundAV::AddPlayer(Player *plr) void BattleGroundAV::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -46,6 +46,8 @@ class BattleGroundAV : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid); void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);

View file

@ -29,6 +29,16 @@
BattleGroundBE::BattleGroundBE() BattleGroundBE::BattleGroundBE()
{ {
m_BgObjects.resize(BG_BE_OBJECT_MAX); m_BgObjects.resize(BG_BE_OBJECT_MAX);
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
} }
BattleGroundBE::~BattleGroundBE() BattleGroundBE::~BattleGroundBE()
@ -40,73 +50,30 @@ void BattleGroundBE::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
// after bg start we get there
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
{
ModifyStartDelayTime(diff);
if (!(m_Events & 0x01))
{
m_Events |= 0x01;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
SetStartDelayTime(START_DELAY1);
SendMessageToAll(LANG_ARENA_ONE_MINUTE);
}
// After 30 seconds, warning is signalled
else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x04))
{
m_Events |= 0x04;
SendMessageToAll(LANG_ARENA_THIRTY_SECONDS);
}
// After 15 seconds, warning is signalled
else if (GetStartDelayTime() <= START_DELAY3 && !(m_Events & 0x08))
{
m_Events |= 0x08;
SendMessageToAll(LANG_ARENA_FIFTEEN_SECONDS);
}
// delay expired (1 minute)
else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
{
m_Events |= 0x10;
for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; i++)
DoorOpen(i);
for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
SpawnBGObject(i, 60);
SendMessageToAll(LANG_ARENA_BEGUN);
SetStatus(STATUS_IN_PROGRESS);
SetStartDelayTime(0);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player *plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
EndBattleGround(HORDE);
else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
EndBattleGround(ALLIANCE);
}
}
/*if(GetStatus() == STATUS_IN_PROGRESS) /*if(GetStatus() == STATUS_IN_PROGRESS)
{ {
// update something // update something
}*/ }*/
} }
void BattleGroundBE::StartingEventCloseDoors()
{
for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
}
void BattleGroundBE::StartingEventOpenDoors()
{
for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; i++)
DoorOpen(i);
for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
SpawnBGObject(i, 60);
}
void BattleGroundBE::AddPlayer(Player *plr) void BattleGroundBE::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -59,6 +59,8 @@ class BattleGroundBE : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid); void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);

View file

@ -19,10 +19,20 @@
#include "Player.h" #include "Player.h"
#include "BattleGround.h" #include "BattleGround.h"
#include "BattleGroundDS.h" #include "BattleGroundDS.h"
#include "Language.h"
BattleGroundDS::BattleGroundDS() BattleGroundDS::BattleGroundDS()
{ {
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
} }
BattleGroundDS::~BattleGroundDS() BattleGroundDS::~BattleGroundDS()
@ -35,6 +45,14 @@ void BattleGroundDS::Update(uint32 diff)
BattleGround::Update(diff); BattleGround::Update(diff);
} }
void BattleGroundDS::StartingEventCloseDoors()
{
}
void BattleGroundDS::StartingEventOpenDoors()
{
}
void BattleGroundDS::AddPlayer(Player *plr) void BattleGroundDS::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -39,6 +39,9 @@ class BattleGroundDS : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid); void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround(); bool SetupBattleGround();

View file

@ -37,6 +37,11 @@ BattleGroundEY::BattleGroundEY()
m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF; m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF; m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF; m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_EY_START_HALF_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_EY_HAS_BEGUN;
} }
BattleGroundEY::~BattleGroundEY() BattleGroundEY::~BattleGroundEY()
@ -46,71 +51,8 @@ BattleGroundEY::~BattleGroundEY()
void BattleGroundEY::Update(uint32 diff) void BattleGroundEY::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
// after bg start we get there (once)
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
{
ModifyStartDelayTime(diff);
if(!(m_Events & 0x01)) if( GetStatus() == STATUS_IN_PROGRESS )
{
m_Events |= 0x01;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_IMMEDIATELY);
// SpawnBGCreature(EY_SPIRIT_MAIN_ALLIANCE, RESPAWN_IMMEDIATELY);
// SpawnBGCreature(EY_SPIRIT_MAIN_HORDE, RESPAWN_IMMEDIATELY);
for(uint32 i = BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER; i < BG_EY_OBJECT_MAX; ++i)
SpawnBGObject(i, RESPAWN_ONE_DAY);
SetStartDelayTime(START_DELAY0);
}
// After 1 minute, warning is signalled
else if(GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
{
m_Events |= 0x04;
SendMessageToAll(GetMangosString(LANG_BG_EY_ONE_MINUTE));
}
// After 1,5 minute, warning is signalled
else if(GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
{
m_Events |= 0x08;
SendMessageToAll(GetMangosString(LANG_BG_EY_HALF_MINUTE));
}
// After 2 minutes, gates OPEN ! x)
else if(GetStartDelayTime() < 0 && !(m_Events & 0x10))
{
m_Events |= 0x10;
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_ONE_DAY);
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_ONE_DAY);
for(uint32 i = BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER; i <= BG_EY_OBJECT_FLAG_NETHERSTORM; ++i)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for(uint32 i = 0; i < EY_POINTS_MAX; ++i)
{
//randomly spawn buff
uint8 buff = urand(0, 2);
SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + buff + i * 3, RESPAWN_IMMEDIATELY);
}
SendMessageToAll(GetMangosString(LANG_BG_EY_BEGIN));
PlaySoundToAll(SOUND_BG_START);
SetStatus(STATUS_IN_PROGRESS);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player *plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
}
}
else if(GetStatus() == STATUS_IN_PROGRESS)
{ {
m_PointAddingTimer -= diff; m_PointAddingTimer -= diff;
if(m_PointAddingTimer <= 0) if(m_PointAddingTimer <= 0)
@ -152,6 +94,30 @@ void BattleGroundEY::Update(uint32 diff)
} }
} }
void BattleGroundEY::StartingEventCloseDoors()
{
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_IMMEDIATELY);
for(uint32 i = BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER; i < BG_EY_OBJECT_MAX; ++i)
SpawnBGObject(i, RESPAWN_ONE_DAY);
}
void BattleGroundEY::StartingEventOpenDoors()
{
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_ONE_DAY);
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_ONE_DAY);
for(uint32 i = BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER; i <= BG_EY_OBJECT_FLAG_NETHERSTORM; ++i)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for(uint32 i = 0; i < EY_POINTS_MAX; ++i)
{
//randomly spawn buff
uint8 buff = urand(0, 2);
SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + buff + i * 3, RESPAWN_IMMEDIATELY);
}
}
void BattleGroundEY::AddPoints(uint32 Team, uint32 Points) void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
{ {
uint8 team_index = GetTeamIndexByTeamId(Team); uint8 team_index = GetTeamIndexByTeamId(Team);
@ -554,7 +520,7 @@ void BattleGroundEY::RespawnFlag(bool send_message)
if(send_message) if(send_message)
{ {
SendMessageToAll(GetMangosString(LANG_BG_EY_RESETED_FLAG)); SendMessageToAll(GetMangosString(LANG_BG_EY_RESETED_FLAG), CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_EY_SOUND_FLAG_RESET); // flags respawned sound... PlaySoundToAll(BG_EY_SOUND_FLAG_RESET); // flags respawned sound...
} }

View file

@ -302,6 +302,8 @@ class BattleGroundEY : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
/* BG Flags */ /* BG Flags */
uint64 GetFlagPickerGUID() const { return m_FlagKeeper; } uint64 GetFlagPickerGUID() const { return m_FlagKeeper; }

View file

@ -622,7 +622,7 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BGQueueIdBas
return false; return false;
} }
//allow 1v0 if debug bg //allow 1v0 if debug bg
if( sBattleGroundMgr.isTesting() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()) ) if( sBattleGroundMgr.isTesting() && bg_template->isBattleGround() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()) )
return true; return true;
//return true if there are enough players in selection pools - enable to work .debug bg command correctly //return true if there are enough players in selection pools - enable to work .debug bg command correctly
return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers; return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers;

View file

@ -29,6 +29,16 @@
BattleGroundNA::BattleGroundNA() BattleGroundNA::BattleGroundNA()
{ {
m_BgObjects.resize(BG_NA_OBJECT_MAX); m_BgObjects.resize(BG_NA_OBJECT_MAX);
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
} }
BattleGroundNA::~BattleGroundNA() BattleGroundNA::~BattleGroundNA()
@ -40,70 +50,27 @@ void BattleGroundNA::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
// after bg start we get there
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
{
ModifyStartDelayTime(diff);
if (!(m_Events & 0x01))
{
m_Events |= 0x01;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
SetStartDelayTime(START_DELAY1);
SendMessageToAll(LANG_ARENA_ONE_MINUTE);
}
// After 30 seconds, warning is signalled
else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x04))
{
m_Events |= 0x04;
SendMessageToAll(LANG_ARENA_THIRTY_SECONDS);
}
// After 15 seconds, warning is signalled
else if (GetStartDelayTime() <= START_DELAY3 && !(m_Events & 0x08))
{
m_Events |= 0x08;
SendMessageToAll(LANG_ARENA_FIFTEEN_SECONDS);
}
// delay expired (1 minute)
else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
{
m_Events |= 0x10;
for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; i++)
DoorOpen(i);
for(uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; i++)
SpawnBGObject(i, 60);
SendMessageToAll(LANG_ARENA_BEGUN);
SetStatus(STATUS_IN_PROGRESS);
SetStartDelayTime(0);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player *plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
EndBattleGround(HORDE);
else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
EndBattleGround(ALLIANCE);
}
}
/*if(GetStatus() == STATUS_IN_PROGRESS) /*if(GetStatus() == STATUS_IN_PROGRESS)
{ {
// update something // update something
}*/ }*/
} }
void BattleGroundNA::StartingEventCloseDoors()
{
for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
void BattleGroundNA::StartingEventOpenDoors()
{
for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; i++)
DoorOpen(i);
for(uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; i++)
SpawnBGObject(i, 60);
}
void BattleGroundNA::AddPlayer(Player *plr) void BattleGroundNA::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -60,6 +60,8 @@ class BattleGroundNA : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid); void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);

View file

@ -29,6 +29,16 @@
BattleGroundRL::BattleGroundRL() BattleGroundRL::BattleGroundRL()
{ {
m_BgObjects.resize(BG_RL_OBJECT_MAX); m_BgObjects.resize(BG_RL_OBJECT_MAX);
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
} }
BattleGroundRL::~BattleGroundRL() BattleGroundRL::~BattleGroundRL()
@ -40,71 +50,27 @@ void BattleGroundRL::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
{
ModifyStartDelayTime(diff);
if (!(m_Events & 0x01))
{
m_Events |= 0x01;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
SetStartDelayTime(START_DELAY1);
SendMessageToAll(LANG_ARENA_ONE_MINUTE);
}
// After 30 seconds, warning is signalled
else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x04))
{
m_Events |= 0x04;
SendMessageToAll(LANG_ARENA_THIRTY_SECONDS);
}
// After 15 seconds, warning is signalled
else if (GetStartDelayTime() <= START_DELAY3 && !(m_Events & 0x08))
{
m_Events |= 0x08;
SendMessageToAll(LANG_ARENA_FIFTEEN_SECONDS);
}
// delay expired (1 minute)
else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
{
m_Events |= 0x10;
for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
DoorOpen(i);
for(uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; i++)
SpawnBGObject(i, 60);
SendMessageToAll(LANG_ARENA_BEGUN);
SetStatus(STATUS_IN_PROGRESS);
SetStartDelayTime(0);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player *plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
EndBattleGround(HORDE);
else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
EndBattleGround(ALLIANCE);
}
}
/*if(GetStatus() == STATUS_IN_PROGRESS) /*if(GetStatus() == STATUS_IN_PROGRESS)
{ {
// update something // update something
}*/ }*/
} }
void BattleGroundRL::StartingEventCloseDoors()
{
for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
void BattleGroundRL::StartingEventOpenDoors()
{
for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
DoorOpen(i);
for(uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; i++)
SpawnBGObject(i, 60);
}
void BattleGroundRL::AddPlayer(Player *plr) void BattleGroundRL::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -58,6 +58,8 @@ class BattleGroundRL : public BattleGround
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void Reset(); virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d); virtual void FillInitialWorldStates(WorldPacket &d);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid); void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);

View file

@ -19,10 +19,20 @@
#include "Player.h" #include "Player.h"
#include "BattleGround.h" #include "BattleGround.h"
#include "BattleGroundRV.h" #include "BattleGroundRV.h"
#include "Language.h"
BattleGroundRV::BattleGroundRV() BattleGroundRV::BattleGroundRV()
{ {
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
//we must set messageIds
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
} }
BattleGroundRV::~BattleGroundRV() BattleGroundRV::~BattleGroundRV()
@ -35,6 +45,14 @@ void BattleGroundRV::Update(uint32 diff)
BattleGround::Update(diff); BattleGround::Update(diff);
} }
void BattleGroundRV::StartingEventCloseDoors()
{
}
void BattleGroundRV::StartingEventOpenDoors()
{
}
void BattleGroundRV::AddPlayer(Player *plr) void BattleGroundRV::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -39,6 +39,9 @@ class BattleGroundRV : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid); void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround(); bool SetupBattleGround();

View file

@ -16,13 +16,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "Player.h"
#include "BattleGround.h" #include "BattleGround.h"
#include "BattleGroundSA.h" #include "BattleGroundSA.h"
#include "Player.h" #include "Language.h"
BattleGroundSA::BattleGroundSA() BattleGroundSA::BattleGroundSA()
{ {
//TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
} }
BattleGroundSA::~BattleGroundSA() BattleGroundSA::~BattleGroundSA()
@ -35,6 +40,14 @@ void BattleGroundSA::Update(uint32 diff)
BattleGround::Update(diff); BattleGround::Update(diff);
} }
void BattleGroundSA::StartingEventCloseDoors()
{
}
void BattleGroundSA::StartingEventOpenDoors()
{
}
void BattleGroundSA::AddPlayer(Player *plr) void BattleGroundSA::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);

View file

@ -39,6 +39,8 @@ class BattleGroundSA : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid); void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleAreaTrigger(Player *Source, uint32 Trigger);

View file

@ -32,6 +32,11 @@ BattleGroundWS::BattleGroundWS()
{ {
m_BgObjects.resize(BG_WS_OBJECT_MAX); m_BgObjects.resize(BG_WS_OBJECT_MAX);
m_BgCreatures.resize(BG_CREATURES_MAX_WS); m_BgCreatures.resize(BG_CREATURES_MAX_WS);
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
} }
BattleGroundWS::~BattleGroundWS() BattleGroundWS::~BattleGroundWS()
@ -42,75 +47,7 @@ void BattleGroundWS::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
// after bg start we get there (once) if(GetStatus() == STATUS_IN_PROGRESS)
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
{
ModifyStartDelayTime(diff);
if(!(m_Events & 0x01))
{
m_Events |= 0x01;
// setup here, only when at least one player has ported to the map
if(!SetupBattleGround())
{
EndNow();
return;
}
// for(uint32 i = WS_SPIRIT_MAIN_ALLIANCE; i <= WS_SPIRIT_MAIN_HORDE; i++)
// SpawnBGCreature(i, RESPAWN_IMMEDIATELY);
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; i++)
{
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
DoorClose(i);
}
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
SetStartDelayTime(START_DELAY0);
}
// After 1 minute, warning is signalled
else if(GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
{
m_Events |= 0x04;
SendMessageToAll(GetMangosString(LANG_BG_WS_ONE_MINUTE));
}
// After 1,5 minute, warning is signalled
else if(GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
{
m_Events |= 0x08;
SendMessageToAll(GetMangosString(LANG_BG_WS_HALF_MINUTE));
}
// After 2 minutes, gates OPEN ! x)
else if(GetStartDelayTime() < 0 && !(m_Events & 0x10))
{
m_Events |= 0x10;
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; i++)
DoorOpen(i);
for(uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; i++)
DoorOpen(i);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY);
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
SendMessageToAll(GetMangosString(LANG_BG_WS_BEGIN));
PlaySoundToAll(SOUND_BG_START);
SetStatus(STATUS_IN_PROGRESS);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if(Player* plr = objmgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
}
}
else if(GetStatus() == STATUS_IN_PROGRESS)
{ {
if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN) if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
{ {
@ -155,6 +92,33 @@ void BattleGroundWS::Update(uint32 diff)
} }
} }
void BattleGroundWS::StartingEventCloseDoors()
{
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; i++)
{
DoorClose(i);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
}
void BattleGroundWS::StartingEventOpenDoors()
{
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; i++)
DoorOpen(i);
for(uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; i++)
DoorOpen(i);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY);
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
void BattleGroundWS::AddPlayer(Player *plr) void BattleGroundWS::AddPlayer(Player *plr)
{ {
BattleGround::AddPlayer(plr); BattleGround::AddPlayer(plr);
@ -182,7 +146,7 @@ void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
//when map_update will be allowed for battlegrounds this code will be useless //when map_update will be allowed for battlegrounds this code will be useless
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY); SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY); SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
SendMessageToAll(GetMangosString(LANG_BG_WS_F_PLACED)); SendMessageToAll(GetMangosString(LANG_BG_WS_F_PLACED), CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound... PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound...
} }
} }
@ -196,12 +160,12 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
if(team == ALLIANCE) if(team == ALLIANCE)
{ {
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY); SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
SendMessageToAll(GetMangosString(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED)); SendMessageToAll(GetMangosString(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED), CHAT_MSG_BG_SYSTEM_NEUTRAL);
} }
else else
{ {
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY); SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
SendMessageToAll(GetMangosString(LANG_BG_WS_HORDE_FLAG_RESPAWNED)); SendMessageToAll(GetMangosString(LANG_BG_WS_HORDE_FLAG_RESPAWNED), CHAT_MSG_BG_SYSTEM_NEUTRAL);
} }
PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED);

View file

@ -138,6 +138,8 @@ class BattleGroundWS : public BattleGround
/* inherited from BattlegroundClass */ /* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr); virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
/* BG Flags */ /* BG Flags */
uint64 GetAllianceFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_ALLIANCE]; } uint64 GetAllianceFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_ALLIANCE]; }

View file

@ -569,9 +569,11 @@ enum MangosStrings
// Battleground // Battleground
LANG_BG_A_WINS = 600, LANG_BG_A_WINS = 600,
LANG_BG_H_WINS = 601, LANG_BG_H_WINS = 601,
LANG_BG_WS_ONE_MINUTE = 602,
LANG_BG_WS_HALF_MINUTE = 603, LANG_BG_WS_START_TWO_MINUTES = 753,
LANG_BG_WS_BEGIN = 604, LANG_BG_WS_START_ONE_MINUTE = 602,
LANG_BG_WS_START_HALF_MINUTE = 603,
LANG_BG_WS_HAS_BEGUN = 604,
LANG_BG_WS_CAPTURED_HF = 605, LANG_BG_WS_CAPTURED_HF = 605,
LANG_BG_WS_CAPTURED_AF = 606, LANG_BG_WS_CAPTURED_AF = 606,
@ -585,9 +587,10 @@ enum MangosStrings
LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED = 614, LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED = 614,
LANG_BG_WS_HORDE_FLAG_RESPAWNED = 615, LANG_BG_WS_HORDE_FLAG_RESPAWNED = 615,
LANG_BG_EY_ONE_MINUTE = 636, LANG_BG_EY_START_TWO_MINUTES = 755,
LANG_BG_EY_HALF_MINUTE = 637, LANG_BG_EY_START_ONE_MINUTE = 636,
LANG_BG_EY_BEGIN = 638, LANG_BG_EY_START_HALF_MINUTE = 637,
LANG_BG_EY_HAS_BEGUN = 638,
LANG_BG_AB_ALLY = 650, LANG_BG_AB_ALLY = 650,
LANG_BG_AB_HORDE = 651, LANG_BG_AB_HORDE = 651,
@ -600,9 +603,11 @@ enum MangosStrings
LANG_BG_AB_NODE_DEFENDED = 658, LANG_BG_AB_NODE_DEFENDED = 658,
LANG_BG_AB_NODE_ASSAULTED = 659, LANG_BG_AB_NODE_ASSAULTED = 659,
LANG_BG_AB_NODE_CLAIMED = 660, LANG_BG_AB_NODE_CLAIMED = 660,
LANG_BG_AB_ONEMINTOSTART = 661,
LANG_BG_AB_HALFMINTOSTART = 662, LANG_BG_AB_START_TWO_MINUTES = 754,
LANG_BG_AB_STARTED = 663, LANG_BG_AB_START_ONE_MINUTE = 661,
LANG_BG_AB_START_HALF_MINUTE = 662,
LANG_BG_AB_HAS_BEGUN = 663,
LANG_BG_AB_A_NEAR_VICTORY = 664, LANG_BG_AB_A_NEAR_VICTORY = 664,
LANG_BG_AB_H_NEAR_VICTORY = 665, LANG_BG_AB_H_NEAR_VICTORY = 665,
LANG_BG_MARK_BY_MAIL = 666, LANG_BG_MARK_BY_MAIL = 666,
@ -633,7 +638,7 @@ enum MangosStrings
LANG_ARENA_ONE_MINUTE = 701, LANG_ARENA_ONE_MINUTE = 701,
LANG_ARENA_THIRTY_SECONDS = 702, LANG_ARENA_THIRTY_SECONDS = 702,
LANG_ARENA_FIFTEEN_SECONDS = 703, LANG_ARENA_FIFTEEN_SECONDS = 703,
LANG_ARENA_BEGUN = 704, LANG_ARENA_HAS_BEGUN = 704,
LANG_WAIT_BEFORE_SPEAKING = 705, LANG_WAIT_BEFORE_SPEAKING = 705,
LANG_NOT_EQUIPPED_ITEM = 706, LANG_NOT_EQUIPPED_ITEM = 706,
@ -685,7 +690,11 @@ enum MangosStrings
// = 749, 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 = 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." 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 // = 752, not used
// LANG_BG_WS_START_TWO_MINUTES = 753,
// LANG_BG_AB_START_TWO_MINUTES = 754,
// LANG_BG_EY_START_TWO_MINUTES = 755,
// Room for batleground/arena strings 756-799 not used
// in game strings // in game strings
// = 800, not used // = 800, not used

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7398" #define REVISION_NR "7399"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__