aboutsummaryrefslogtreecommitdiff
path: root/src/game/BattleGroundAB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/BattleGroundAB.cpp')
-rw-r--r--src/game/BattleGroundAB.cpp48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp
index 5c065bc644c..74d97a64695 100644
--- a/src/game/BattleGroundAB.cpp
+++ b/src/game/BattleGroundAB.cpp
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -8,12 +10,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * 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 "Object.h"
@@ -82,19 +84,19 @@ void BattleGroundAB::Update(time_t diff)
else if( GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04) )
{
m_Events |= 0x04;
- SendMessageToAll(GetMangosString(LANG_BG_AB_ONEMINTOSTART));
+ SendMessageToAll(GetTrinityString(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));
+ SendMessageToAll(GetTrinityString(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));
+ SendMessageToAll(GetTrinityString(LANG_BG_AB_STARTED));
// spawn neutral banners
for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
@@ -108,13 +110,9 @@ void BattleGroundAB::Update(time_t diff)
DoorOpen(BG_AB_OBJECT_GATE_A);
DoorOpen(BG_AB_OBJECT_GATE_H);
+ PlaySoundToAll(SOUND_BG_START);
if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
- {
- PlaySoundToAll(SOUND_BG_START);
- PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
- }
- else
- PlaySoundToAll(SOUND_BG_START);
+ PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
SetStatus(STATUS_IN_PROGRESS);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
@@ -162,7 +160,7 @@ void BattleGroundAB::Update(time_t diff)
// Message to chatlog
char buf[256];
uint8 type = (teamIndex == 0) ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE;
- sprintf(buf, GetMangosString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetMangosString(LANG_BG_AB_ALLY) : GetMangosString(LANG_BG_AB_HORDE), _GetNodeName(node));
+ sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE), _GetNodeName(node));
WorldPacket data;
ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, buf, NULL);
SendPacketToAll(&data);
@@ -201,9 +199,9 @@ void BattleGroundAB::Update(time_t diff)
if( !m_IsInformedNearVictory && m_TeamScores[team] > 1800 )
{
if( team == BG_TEAM_ALLIANCE )
- SendMessageToAll(GetMangosString(LANG_BG_AB_A_NEAR_VICTORY));
+ SendMessageToAll(GetTrinityString(LANG_BG_AB_A_NEAR_VICTORY));
else
- SendMessageToAll(GetMangosString(LANG_BG_AB_H_NEAR_VICTORY));
+ SendMessageToAll(GetTrinityString(LANG_BG_AB_H_NEAR_VICTORY));
PlaySoundToAll(SOUND_NEAR_VICTORY);
m_IsInformedNearVictory = true;
}
@@ -314,15 +312,15 @@ const char* BattleGroundAB::_GetNodeName(uint8 node)
switch (node)
{
case BG_AB_NODE_STABLES:
- return GetMangosString(LANG_BG_AB_NODE_STABLES);
+ return GetTrinityString(LANG_BG_AB_NODE_STABLES);
case BG_AB_NODE_BLACKSMITH:
- return GetMangosString(LANG_BG_AB_NODE_BLACKSMITH);
+ return GetTrinityString(LANG_BG_AB_NODE_BLACKSMITH);
case BG_AB_NODE_FARM:
- return GetMangosString(LANG_BG_AB_NODE_FARM);
+ return GetTrinityString(LANG_BG_AB_NODE_FARM);
case BG_AB_NODE_LUMBER_MILL:
- return GetMangosString(LANG_BG_AB_NODE_LUMBER_MILL);
+ return GetTrinityString(LANG_BG_AB_NODE_LUMBER_MILL);
case BG_AB_NODE_GOLD_MINE:
- return GetMangosString(LANG_BG_AB_NODE_GOLD_MINE);
+ return GetTrinityString(LANG_BG_AB_NODE_GOLD_MINE);
default:
ASSERT(0);
}
@@ -477,7 +475,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
_SendNodeUpdate(node);
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
- sprintf(buf, GetMangosString(LANG_BG_AB_NODE_CLAIMED), _GetNodeName(node), (teamIndex == 0) ? GetMangosString(LANG_BG_AB_ALLY) : GetMangosString(LANG_BG_AB_HORDE));
+ sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_CLAIMED), _GetNodeName(node), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE));
sound = SOUND_NODE_CLAIMED;
}
// If node is contested
@@ -495,7 +493,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
_SendNodeUpdate(node);
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
- sprintf(buf, GetMangosString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
+ sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
}
// If contested, change back to occupied
else
@@ -510,7 +508,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_SendNodeUpdate(node);
m_NodeTimers[node] = 0;
_NodeOccupied(node,(teamIndex == 0) ? ALLIANCE:HORDE);
- sprintf(buf, GetMangosString(LANG_BG_AB_NODE_DEFENDED), _GetNodeName(node));
+ sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_DEFENDED), _GetNodeName(node));
}
sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
}
@@ -527,7 +525,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_SendNodeUpdate(node);
_NodeDeOccupied(node);
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
- sprintf(buf, GetMangosString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
+ sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
}
WorldPacket data;
@@ -536,7 +534,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
// If node is occupied again, send "X has taken the Y" msg.
if( m_Nodes[node] >= BG_AB_NODE_TYPE_OCCUPIED )
{
- sprintf(buf, GetMangosString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetMangosString(LANG_BG_AB_ALLY) : GetMangosString(LANG_BG_AB_HORDE), _GetNodeName(node));
+ sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE), _GetNodeName(node));
ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, buf, NULL);
SendPacketToAll(&data);
}