Fix arena unit frames, original code by A Metaphysical Drama

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-08-27 04:49:04 +03:00
parent 8146cff934
commit c247de12a9
3 changed files with 16 additions and 5 deletions
+13 -2
View File
@@ -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
{
@@ -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!");
@@ -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);