mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
[7252] Move all world global broadcast string (all arena/bg related) to mangos_string.
PLEASE, NOT USE string world broadcasts in real code. This function _only_ for debug purposes.
Really allow with .debug bg start bg with 1 player.
Added helps for some existed .debug commands.
Author: VladimirMangos
--HG--
branch : trunk
This commit is contained in:
@@ -648,6 +648,14 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, uint32 queue_id, uin
|
||||
}
|
||||
}
|
||||
}
|
||||
// BG case
|
||||
else
|
||||
{
|
||||
if(sBattleGroundMgr.isTesting())
|
||||
{
|
||||
MinPlayersPerTeam = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// found out the minimum and maximum ratings the newly added team should battle against
|
||||
// arenaRating is the rating of the latest joined team
|
||||
@@ -1654,9 +1662,9 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution()
|
||||
void BattleGroundMgr::DistributeArenaPoints()
|
||||
{
|
||||
// used to distribute arena points based on last week's stats
|
||||
sWorld.SendGlobalText("Flushing Arena points based on team ratings, this may take a few minutes. Please stand by...", NULL);
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_START);
|
||||
|
||||
sWorld.SendGlobalText("Distributing arena points to players...", NULL);
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START);
|
||||
|
||||
//temporary structure for storing maximum points to add values for all players
|
||||
std::map<uint32, uint32> PlayerPoints;
|
||||
@@ -1683,9 +1691,9 @@ void BattleGroundMgr::DistributeArenaPoints()
|
||||
|
||||
PlayerPoints.clear();
|
||||
|
||||
sWorld.SendGlobalText("Finished setting arena points for online players.", NULL);
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
|
||||
|
||||
sWorld.SendGlobalText("Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...", NULL);
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
|
||||
for(ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr)
|
||||
{
|
||||
if(ArenaTeam * at = titr->second)
|
||||
@@ -1696,9 +1704,9 @@ void BattleGroundMgr::DistributeArenaPoints()
|
||||
}
|
||||
}
|
||||
|
||||
sWorld.SendGlobalText("Modification done.", NULL);
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END);
|
||||
|
||||
sWorld.SendGlobalText("Done flushing Arena points.", NULL);
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END);
|
||||
}
|
||||
|
||||
void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player* plr, BattleGroundTypeId bgTypeId)
|
||||
@@ -1853,18 +1861,18 @@ void BattleGroundMgr::ToggleTesting()
|
||||
{
|
||||
m_Testing = !m_Testing;
|
||||
if(m_Testing)
|
||||
sWorld.SendGlobalText("Battlegrounds are set to 1v0 for debugging.", NULL);
|
||||
sWorld.SendWorldText(LANG_DEBUG_BG_ON);
|
||||
else
|
||||
sWorld.SendGlobalText("Battlegrounds are set to normal playercount.", NULL);
|
||||
sWorld.SendWorldText(LANG_DEBUG_BG_OFF);
|
||||
}
|
||||
|
||||
void BattleGroundMgr::ToggleArenaTesting()
|
||||
{
|
||||
m_ArenaTesting = !m_ArenaTesting;
|
||||
if(m_ArenaTesting)
|
||||
sWorld.SendGlobalText("Arenas are set to 1v1 for debugging. So, don't join as group.", NULL);
|
||||
sWorld.SendWorldText(LANG_DEBUG_ARENA_ON);
|
||||
else
|
||||
sWorld.SendGlobalText("Arenas are set to normal playercount.", NULL);
|
||||
sWorld.SendWorldText(LANG_DEBUG_ARENA_OFF);
|
||||
}
|
||||
|
||||
void BattleGroundMgr::SetHolidayWeekends(uint32 mask)
|
||||
|
||||
@@ -645,6 +645,39 @@ enum TrinityStrings
|
||||
LANG_YOUR_BG_LEVEL_REQ_ERROR = 715,
|
||||
|
||||
// LANG_YOUR_ARENA_TEAM_FULL = 716, an opcode exists for this
|
||||
LANG_BG_STARTED_ANNOUNCE_WORLD = 717,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN= 718,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT= 719,
|
||||
|
||||
LANG_BG_GROUP_TOO_LARGE = 720, // "Your group is too large for this battleground. Please regroup to join."
|
||||
LANG_ARENA_GROUP_TOO_LARGE = 721, // "Your group is too large for this arena. Please regroup to join."
|
||||
LANG_ARENA_YOUR_TEAM_ONLY = 722, // "Your group has members not in your arena team. Please regroup to join."
|
||||
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!
|
||||
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."
|
||||
LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 730, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
|
||||
LANG_BG_GROUP_MEMBER_DESERTER = 731, // "Someone in your party is Deserter. You can't join as group."
|
||||
LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 732, // "Someone in your party is already in three battleground queues. You cannot join as group."
|
||||
|
||||
LANG_CANNOT_TELE_TO_BG = 733, // "You cannot teleport to a battleground or arena map."
|
||||
LANG_CANNOT_SUMMON_TO_BG = 734, // "You cannot summon players to a battleground or arena map."
|
||||
LANG_CANNOT_GO_TO_BG_GM = 735, // "You must be in GM mode to teleport to a player in a battleground."
|
||||
LANG_CANNOT_GO_TO_BG_FROM_BG = 736, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."
|
||||
LANG_DEBUG_ARENA_ON = 737,
|
||||
LANG_DEBUG_ARENA_OFF = 738,
|
||||
LANG_DEBUG_BG_ON = 739,
|
||||
LANG_DEBUG_BG_OFF = 740,
|
||||
LANG_DIST_ARENA_POINTS_START = 741,
|
||||
LANG_DIST_ARENA_POINTS_ONLINE_START = 742,
|
||||
LANG_DIST_ARENA_POINTS_ONLINE_END = 743,
|
||||
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
|
||||
|
||||
LANG_BG_AV_ALLY = 717,
|
||||
LANG_BG_AV_HORDE = 718,
|
||||
@@ -690,50 +723,6 @@ enum TrinityStrings
|
||||
LANG_AUTO_ANN = 786,
|
||||
LANG_ANNOUNCE_COLOR = 787,
|
||||
|
||||
LANG_BG_GROUP_TOO_LARGE = 1122, // "Your group is too large for this battleground. Please regroup to join."
|
||||
LANG_ARENA_GROUP_TOO_LARGE = 1123, // "Your group is too large for this arena. Please regroup to join."
|
||||
LANG_ARENA_YOUR_TEAM_ONLY = 1124, // "Your group has members not in your arena team. Please regroup to join."
|
||||
LANG_ARENA_NOT_ENOUGH_PLAYERS = 1125, // "Your group does not have enough players to join this match."
|
||||
LANG_ARENA_GOLD_WINS = 1126, // "The Gold Team wins!"
|
||||
LANG_ARENA_GREEN_WINS = 1127, // "The Green Team wins!"
|
||||
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 1128, // The battleground will end soon, because there aren't enough players. Get more ppl or win already!
|
||||
LANG_BG_GROUP_OFFLINE_MEMBER = 1129, // "Your group has an offline member. Please remove him before joining."
|
||||
LANG_BG_GROUP_MIXED_FACTION = 1130, // "Your group has players from the opposing faction. You can't join the battleground as a group."
|
||||
LANG_BG_GROUP_MIXED_LEVELS = 1131, // "Your group has players from different battleground brakets. You can't join as group."
|
||||
LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 1132, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
|
||||
LANG_BG_GROUP_MEMBER_DESERTER = 1133, // "Someone in your party is Deserter. You can't join as group."
|
||||
LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 1134, // "Someone in your party is already in three battleground queues. You cannot join as group."
|
||||
|
||||
LANG_CANNOT_TELE_TO_BG = 1135, // "You cannot teleport to a battleground or arena map."
|
||||
LANG_CANNOT_SUMMON_TO_BG = 1136, // "You cannot summon players to a battleground or arena map."
|
||||
LANG_CANNOT_GO_TO_BG_GM = 1137, // "You must be in GM mode to teleport to a player in a battleground."
|
||||
LANG_CANNOT_GO_TO_BG_FROM_BG = 1138, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."
|
||||
|
||||
// = 716, not used
|
||||
LANG_BG_STARTED_ANNOUNCE_WORLD = 717,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN= 718,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT= 719,
|
||||
|
||||
/*LANG_BG_GROUP_TOO_LARGE = 720, // "Your group is too large for this battleground. Please regroup to join."
|
||||
LANG_ARENA_GROUP_TOO_LARGE = 721, // "Your group is too large for this arena. Please regroup to join."
|
||||
LANG_ARENA_YOUR_TEAM_ONLY = 722, // "Your group has members not in your arena team. Please regroup to join."
|
||||
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!
|
||||
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."
|
||||
LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 730, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
|
||||
LANG_BG_GROUP_MEMBER_DESERTER = 731, // "Someone in your party is Deserter. You can't join as group."
|
||||
LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 732, // "Someone in your party is already in three battleground queues. You cannot join as group."
|
||||
|
||||
LANG_CANNOT_TELE_TO_BG = 733, // "You cannot teleport to a battleground or arena map."
|
||||
LANG_CANNOT_SUMMON_TO_BG = 734, // "You cannot summon players to a battleground or arena map."
|
||||
LANG_CANNOT_GO_TO_BG_GM = 735, // "You must be in GM mode to teleport to a player in a battleground."
|
||||
LANG_CANNOT_GO_TO_BG_FROM_BG = 736, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."*/
|
||||
// Room for batleground/arena strings 737-799 not used
|
||||
|
||||
// in game strings
|
||||
LANG_PET_INVALID_NAME = 800,
|
||||
LANG_NOT_ENOUGH_GOLD = 801,
|
||||
@@ -788,6 +777,25 @@ enum TrinityStrings
|
||||
LANG_SKILL_VALUES = 1122,
|
||||
// Room for more level 3 1123-1199 not used
|
||||
|
||||
/*LANG_BG_GROUP_TOO_LARGE = 1122, // "Your group is too large for this battleground. Please regroup to join."
|
||||
LANG_ARENA_GROUP_TOO_LARGE = 1123, // "Your group is too large for this arena. Please regroup to join."
|
||||
LANG_ARENA_YOUR_TEAM_ONLY = 1124, // "Your group has members not in your arena team. Please regroup to join."
|
||||
LANG_ARENA_NOT_ENOUGH_PLAYERS = 1125, // "Your group does not have enough players to join this match."
|
||||
LANG_ARENA_GOLD_WINS = 1126, // "The Gold Team wins!"
|
||||
LANG_ARENA_GREEN_WINS = 1127, // "The Green Team wins!"
|
||||
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 1128, // The battleground will end soon, because there aren't enough players. Get more ppl or win already!
|
||||
LANG_BG_GROUP_OFFLINE_MEMBER = 1129, // "Your group has an offline member. Please remove him before joining."
|
||||
LANG_BG_GROUP_MIXED_FACTION = 1130, // "Your group has players from the opposing faction. You can't join the battleground as a group."
|
||||
LANG_BG_GROUP_MIXED_LEVELS = 1131, // "Your group has players from different battleground brakets. You can't join as group."
|
||||
LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 1132, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
|
||||
LANG_BG_GROUP_MEMBER_DESERTER = 1133, // "Someone in your party is Deserter. You can't join as group."
|
||||
LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 1134, // "Someone in your party is already in three battleground queues. You cannot join as group."
|
||||
|
||||
LANG_CANNOT_TELE_TO_BG = 1135, // "You cannot teleport to a battleground or arena map."
|
||||
LANG_CANNOT_SUMMON_TO_BG = 1136, // "You cannot summon players to a battleground or arena map."
|
||||
LANG_CANNOT_GO_TO_BG_GM = 1137, // "You must be in GM mode to teleport to a player in a battleground."
|
||||
LANG_CANNOT_GO_TO_BG_FROM_BG = 1138, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."*/
|
||||
|
||||
// FREE IDS 1200-9999
|
||||
|
||||
// Ticket Strings 2000-2029
|
||||
|
||||
@@ -767,10 +767,23 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
|
||||
if(pMap->IsBattleGroundOrArena())
|
||||
{
|
||||
// cannot summon to bg
|
||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_BG,nameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
// only allow if gm mode is on
|
||||
if (!chr->isGameMaster())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chr->GetName());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
// if both players are in different bgs
|
||||
else if (chr->GetBattleGroundId() && m_session->GetPlayer()->GetBattleGroundId() != chr->GetBattleGroundId())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chr->GetName());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
// all's well, set bg id
|
||||
// when porting out from the bg, it will be reset to 0
|
||||
chr->SetBattleGroundId(m_session->GetPlayer()->GetBattleGroundId());
|
||||
}
|
||||
else if(pMap->IsDungeon())
|
||||
{
|
||||
@@ -877,8 +890,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
// if already in a bg, don't let port to other
|
||||
else if (_player->GetBattleGroundId())
|
||||
// if both players are in different bgs
|
||||
else if (_player->GetBattleGroundId() && _player->GetBattleGroundId() != chr->GetBattleGroundId())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
@@ -888,7 +901,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
// when porting out from the bg, it will be reset to 0
|
||||
_player->SetBattleGroundId(chr->GetBattleGroundId());
|
||||
}
|
||||
else if(cMap->IsDungeon())
|
||||
else if(cMap->IsDungeon() && cMap->Instanceable())
|
||||
{
|
||||
Map* pMap = MapManager::Instance().GetMap(_player->GetMapId(),_player);
|
||||
|
||||
|
||||
@@ -2645,7 +2645,7 @@ void World::SendGMText(int32 string_id, ...)
|
||||
delete data_cache[i][j];
|
||||
}
|
||||
|
||||
/// Send a System Message to all players (except self if mentioned)
|
||||
/// DEPRICATED, only for debug purpose. Send a System Message to all players (except self if mentioned)
|
||||
void World::SendGlobalText(const char* text, WorldSession *self)
|
||||
{
|
||||
WorldPacket data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7251"
|
||||
#define REVISION_NR "7252"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user