aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShocker <none@none>2010-08-27 04:49:04 +0300
committerShocker <none@none>2010-08-27 04:49:04 +0300
commitc247de12a938f022bcc73f30a75a4da6994aec41 (patch)
treef926184f89991ade304351683d610f7969668f6b
parent8146cff934ec257fc8709196a79df7ac09500c3c (diff)
Fix arena unit frames, original code by A Metaphysical Drama
--HG-- branch : trunk
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp15
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp4
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.h2
3 files changed, 16 insertions, 5 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index f7958287ecd..2eb52e53264 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -428,6 +428,13 @@ void Battleground::Update(uint32 diff)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
{
+ // BG Status packet
+ WorldPacket status;
+ BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr.BGQueueTypeId(m_eTypeID, GetArenaType());
+ uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId);
+ sBattlegroundMgr.BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType());
+ plr->GetSession()->SendPacket(&status);
+
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
// remove auras with duration lower than 30s
Unit::AuraApplicationMap & auraMap = plr->GetAppliedAuras();
@@ -1078,9 +1085,9 @@ void Battleground::AddPlayer(Player *plr)
// BG Status packet
WorldPacket status;
- BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(m_TypeID, GetArenaType());
+ BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr.BGQueueTypeId(m_TypeID, GetArenaType());
uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId);
- sBattlegroundMgr.BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType());
+ sBattlegroundMgr.BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1);
plr->GetSession()->SendPacket(&status);
plr->RemoveAurasByType(SPELL_AURA_MOUNTED);
@@ -1116,6 +1123,10 @@ void Battleground::AddPlayer(Player *plr)
plr->SetFullHealth();
plr->SetPower(POWER_MANA, plr->GetMaxPower(POWER_MANA));
}
+ WorldPacket teammate;
+ teammate.Initialize(SMSG_ARENA_OPPONENT_UPDATE, 8);
+ teammate << uint64(plr->GetGUID());
+ SendPacketToTeam(team, &teammate, plr, false);
}
else
{
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 0effb1fa80b..cb832457054 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -176,7 +176,7 @@ void BattlegroundMgr::Update(uint32 diff)
}
}
-void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype)
+void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame)
{
// we can be in 2 queues in same time...
@@ -221,7 +221,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
*data << uint64(0); // 3.3.5, unknown
*data << uint32(Time1); // time to bg auto leave, 0 at bg start, 120000 after bg end, milliseconds
*data << uint32(Time2); // time from bg start, milliseconds
- *data << uint8(/*bg->isArena() ? 0 :*/ 1); // unk, possibly 0 == preparation phase, 1 == battle
+ *data << uint8(uiFrame);
break;
default:
sLog.outError("Unknown BG status!");
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index c0cd4fb3e46..c645aa8b1f9 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -52,7 +52,7 @@ class BattlegroundMgr
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, GroupJoinBattlegroundResult result);
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
void BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg);
- void BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype);
+ void BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame = 1);
void BuildPlaySoundPacket(WorldPacket *data, uint32 soundid);
void SendAreaSpiritHealerQueryOpcode(Player *pl, Battleground *bg, const uint64& guid);