Professional Documents
Culture Documents
cpp
player->ResetAllPowers();
player->CombatStopWithPets(true);
- player->setFactionForRace(player->getRace());
- uint32 team;
- uint64 guid;
-
// score struct must be created in inherited class
- if (/* sWorld->getBoolConfig(CONFIG_BG_CROSSFRACTION) == 1 && */!isArena())
- {
- uint32 hCount = GetPlayersCountByTeam(HORDE);
- uint32 aCount = GetPlayersCountByTeam(ALLIANCE);
- guid = player->GetGUID();
if (isArena())
BattlegroundPlayer bp;
bp.OfflineRemoveTime = 0;
@@ -1254,14 +1229,14 @@ void Battleground::AddPlayer(Player* player)
player->RemoveArenaEnchantments(TEMP_ENCHANTMENT_SLOT);
if (team == ALLIANCE) // gold
{
- if (player->GetBGTeam() == HORDE)
+ if (player->GetTeam() == HORDE)
player->CastSpell(player, SPELL_HORDE_GOLD_FLAG, true);
else
player->CastSpell(player, SPELL_ALLIANCE_GOLD_FLAG, true);
}
else // green
{
- if (player->GetBGTeam() == HORDE)
+ if (player->GetTeam() == HORDE)
player->CastSpell(player, SPELL_HORDE_GREEN_FLAG, true);
else
player->CastSpell(player, SPELL_ALLIANCE_GREEN_FLAG, true);
@@ -1922,7 +1897,7 @@ void Battleground::HandleKillPlayer(Player* victim, Player*
killer)
if (!creditedPlayer || creditedPlayer == killer)
continue;
src/server/game/Battlegrounds/Battleground.h
struct BattlegroundPlayer
{
- time_t OfflineRemoveTime; // for tracking and removing offline players from
queue after 5 minutes
- uint32 hCount;
- uint32 aCount;
- uint32 Team; // Player's team
+ time_t OfflineRemoveTime; // for tracking and
removing offline players from queue after 5 minutes
+ uint32 Team; // Player's team
};
struct BattlegroundObjectInfo
src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -21,7 +21,7 @@
#include "ArenaTeamMgr.h"
#include "World.h"
#include "WorldPacket.h"
-#include "Battleground.h"
+
#include "ArenaTeam.h"
#include "BattlegroundMgr.h"
#include "BattlegroundAV.h"
@@ -45,7 +45,6 @@
#include "Formulas.h"
#include "DisableMgr.h"
#include "Opcodes.h"
-#include "Player.h"
bg->GetTeamStartLoc(team, x, y, z, O);
sLog->outDebug(LOG_FILTER_BATTLEGROUND,
"BattlegroundMgr::SendToBattleground: Sending %s to map %u, X %f, Y %f, Z %f, O %f
(bgType %u)", player->GetName().c_str(), mapid, x, y, z, O, bgTypeId);
@@ -1217,47 +1207,3 @@ void BattlegroundMgr::RemoveBattleground(BattlegroundTypeId
bgTypeId, uint32 ins
{
bgDataStore[bgTypeId].m_Battlegrounds.erase(instanceId);
}
-
-bool BattlegroundMgr::HasBattleground(Battleground *_bg)
-{
- BattlegroundContainer::iterator itr, next;
- for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; ++i)
- {
- itr = m_Battlegrounds[i].begin();
- // skip updating battleground template
- if (itr != m_Battlegrounds[i].end())
- ++itr;
- for (; itr != m_Battlegrounds[i].end(); itr = next)
- {
- next = itr;
- ++next;
- Battleground* bg = itr->second;
- if (bg == _bg)
- return true;
- }
- }
-
- return false;
-}
-
-void BattlegroundMgr::HandleCrossfactionSendToBattle(Player* player, Battleground*
bg, uint32 InstanceID, BattlegroundTypeId bgTypeId)
-{
- if (!player || !bg)
- return;
-
- if (/* sWorld->getBoolConfig(CONFIG_BG_CROSSFRACTION) == 1 && */!bg-
>isArena())
- {
- if (bg->GetPlayersCountByTeam(HORDE) < bg->GetMaxPlayersPerTeam() &&
bg->GetPlayersCountByTeam(HORDE) <= bg->GetPlayersCountByTeam(ALLIANCE))
- player->SetBGTeam(HORDE);
- else
- if (bg->GetPlayersCountByTeam(ALLIANCE) < bg-
>GetMaxPlayersPerTeam())
- player->SetBGTeam(ALLIANCE);
-
- if (player->GetBGTeam() == HORDE)
- player->setFaction(2); // Horde Faction
- else
- if (player->GetBGTeam() == ALLIANCE)
- player->setFaction(1); // Alliance Faction
- }
- bg->UpdatePlayersCountByTeam(player->GetBGTeam(), false); // Add here instead
of in AddPlayer, because AddPlayer is not made until loading screen is finished.
Which can cause unbalance in the system.
-}
src/server/game/Battlegrounds/BattlegroundMgr.h
BattlegroundQueue m_BattlegroundQueues[MAX_BATTLEGROUND_QUEUE_TYPES];
src/server/game/Battlegrounds/BattlegroundQueue.cpp
src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -219,13 +219,13 @@ void BattlegroundAB::HandleAreaTrigger(Player* player, uint32
trigger)
switch (trigger)
{
case 3948: // Arathi Basin
Alliance Exit.
- if (player->GetBGTeam() != ALLIANCE)
+ if (player->GetTeam() != ALLIANCE)
player->GetSession()->SendAreaTriggerMessage("Only The Alliance
can use that portal");
else
player->LeaveBattleground();
break;
case 3949: // Arathi Basin Horde
Exit.
- if (player->GetBGTeam() != HORDE)
+ if (player->GetTeam() != HORDE)
player->GetSession()->SendAreaTriggerMessage("Only The Horde can
use that portal");
else
player->LeaveBattleground();
@@ -442,7 +442,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source,
GameObject* /*targ
return;
}
src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -54,7 +54,7 @@ void BattlegroundAV::HandleKillPlayer(Player* player, Player*
killer)
return;
Battleground::HandleKillPlayer(player, killer);
- UpdateScore(player->GetBGTeam(), -1);
+ UpdateScore(player->GetTeam(), -1);
}
player->GetPosition(x, y);
- pGraveyard =
sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[GetTeamIndexByTeamId(player-
>GetBGTeam())+7]);
+ pGraveyard =
sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[GetTeamIndexByTeamId(player-
>GetTeam())+7]);
minDist = (pGraveyard->x - x)*(pGraveyard->x - x)+(pGraveyard->y -
y)*(pGraveyard->y - y);
src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE,
NULL);
else
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
@@ -632,7 +632,7 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player* Source,
GameObject* target
if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source-
>IsWithinDistInMap(target_obj, 10))
return;
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE,
BG_EY_FLAG_STATE_ON_PLAYER);
PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE);
@@ -653,7 +653,7 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player* Source,
GameObject* target
Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE,
NULL, Source->GetName().c_str());
else
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE,
NULL, Source->GetName().c_str());
@@ -712,7 +712,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* Source,
uint32 Point)
if (GetStatus() != STATUS_IN_PROGRESS)
return;
SpawnBGObject(m_CapturingPointTypes[Point].DespawnNeutralObjectType,
RESPAWN_ONE_DAY);
SpawnBGObject(m_CapturingPointTypes[Point].DespawnNeutralObjectType + 1,
RESPAWN_ONE_DAY);
@@ -785,7 +785,7 @@ void BattlegroundEY::EventPlayerCapturedFlag(Player* Source,
uint32 BgObjectType
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE);
else
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE);
@@ -796,7 +796,7 @@ void BattlegroundEY::EventPlayerCapturedFlag(Player* Source,
uint32 BgObjectType
m_FlagCapturedBgObjectType = BgObjectType;
uint8 team_id = 0;
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
team_id = TEAM_ALLIANCE;
SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_A, CHAT_MSG_BG_SYSTEM_ALLIANCE,
Source);
@@ -808,7 +808,7 @@ void BattlegroundEY::EventPlayerCapturedFlag(Player* Source,
uint32 BgObjectType
}
if (m_TeamPointsCount[team_id] > 0)
- AddPoints(Source->GetBGTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id]
- 1]);
+ AddPoints(Source->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] -
1]);
- switch (player->GetBGTeam())
+ switch (player->GetTeam())
{
case ALLIANCE: g_id = EY_GRAVEYARD_MAIN_ALLIANCE; break;
case HORDE: g_id = EY_GRAVEYARD_MAIN_HORDE; break;
@@ -914,7 +914,7 @@ WorldSafeLocsEntry const*
BattlegroundEY::GetClosestGraveYard(Player* player)
src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -282,7 +282,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* Source)
uint32 winner = 0;
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
if (!IsHordeFlagPickedup())
return;
@@ -319,23 +319,23 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* Source)
RewardReputationToTeam(889, m_ReputationCapture, HORDE);
}
//for flag capture is reward 2 honorable kills
- RewardHonorToTeam(GetBonusHonorFromKill(2), Source->GetBGTeam());
+ RewardHonorToTeam(GetBonusHonorFromKill(2), Source->GetTeam());
SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, BG_WS_FLAG_RESPAWN_TIME);
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
SendMessageToAll(LANG_BG_WS_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE,
Source);
else
SendMessageToAll(LANG_BG_WS_CAPTURED_AF, CHAT_MSG_BG_SYSTEM_HORDE,
Source);
if (GetTeamScore(TEAM_ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
winner = ALLIANCE;
@@ -356,7 +356,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* Source)
}
else
{
- _flagsTimer[GetTeamIndexByTeamId(Source->GetBGTeam()) ? 0 : 1] =
BG_WS_FLAG_RESPAWN_TIME;
+ _flagsTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] =
BG_WS_FLAG_RESPAWN_TIME;
}
}
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
if (!IsHordeFlagPickedup())
return;
@@ -429,9 +429,9 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
if (set)
{
Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
- UpdateFlagState(Source->GetBGTeam(), 1);
+ UpdateFlagState(Source->GetTeam(), 1);
- if (Source->GetBGTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
SendMessageToAll(LANG_BG_WS_DROPPED_HF, CHAT_MSG_BG_SYSTEM_HORDE,
Source);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, uint32(-1));
@@ -442,7 +442,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, uint32(-1));
}
- _flagsDropTimer[GetTeamIndexByTeamId(Source->GetBGTeam()) ? 0 : 1] =
BG_WS_FLAG_DROP_TIME;
+ _flagsDropTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] =
BG_WS_FLAG_DROP_TIME;
}
}