aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Server/Packets/TalentPackets.cpp44
-rw-r--r--src/server/game/Server/Packets/TalentPackets.h21
3 files changed, 41 insertions, 26 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 332e7a3f150..3c07703a70f 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -26446,6 +26446,7 @@ bool Player::CanSeeSpellClickOn(Creature const* c) const
void Player::SendTalentsInfoData()
{
WorldPackets::Talent::UpdateTalentData packet;
+ /*
packet.Info.PrimarySpecialization = AsUnderlyingType(GetPrimarySpecialization());
for (uint8 i = 0; i < MAX_SPECIALIZATIONS; ++i)
@@ -26518,6 +26519,7 @@ void Player::SendTalentsInfoData()
if (!groupInfoPkt.TalentIDs.empty() || !groupInfoPkt.PvPTalents.empty() || i == GetActiveTalentGroup())
packet.Info.TalentGroups.push_back(groupInfoPkt);
}
+ */
SendDirectMessage(packet.Write());
}
diff --git a/src/server/game/Server/Packets/TalentPackets.cpp b/src/server/game/Server/Packets/TalentPackets.cpp
index 57aa6c6d430..0a4918c1e23 100644
--- a/src/server/game/Server/Packets/TalentPackets.cpp
+++ b/src/server/game/Server/Packets/TalentPackets.cpp
@@ -31,24 +31,36 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Talent::PvPTalent const&
return data;
}
+ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Talent::TalentInfo const& talentInfo)
+{
+ data << uint32(talentInfo.TalentID);
+ data << uint8(talentInfo.Rank);
+ return data;
+}
+
+ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Talent::TalentGroupInfo const& talentGroupInfo)
+{
+ data << uint32(talentGroupInfo.GlyphInfo.size());
+ data << uint32(talentGroupInfo.TalentInfos.size());
+ data << uint32(talentGroupInfo.SpecID);
+
+ for (uint16 glyph : talentGroupInfo.GlyphInfo)
+ data << uint16(glyph);
+
+ for (auto& talentInfo : talentGroupInfo.TalentInfos)
+ data << talentInfo;
+
+ return data;
+}
+
WorldPacket const* WorldPackets::Talent::UpdateTalentData::Write()
{
- _worldPacket << uint8(Info.ActiveGroup);
- _worldPacket << uint32(Info.PrimarySpecialization);
- _worldPacket << uint32(Info.TalentGroups.size());
-
- for (auto& talentGroupInfo : Info.TalentGroups)
- {
- _worldPacket << uint32(talentGroupInfo.SpecID);
- _worldPacket << uint32(talentGroupInfo.TalentIDs.size());
- _worldPacket << uint32(talentGroupInfo.PvPTalents.size());
-
- for (uint16 talent : talentGroupInfo.TalentIDs)
- _worldPacket << uint16(talent);
-
- for (PvPTalent talent : talentGroupInfo.PvPTalents)
- _worldPacket << talent;
- }
+ _worldPacket << uint8(ActiveGroup);
+ _worldPacket << uint32(UnspentTalentPoints);
+ _worldPacket << uint32(TalentGroupInfos.size());
+
+ for (auto& talentGroupInfo : TalentGroupInfos)
+ _worldPacket << talentGroupInfo;
return &_worldPacket;
}
diff --git a/src/server/game/Server/Packets/TalentPackets.h b/src/server/game/Server/Packets/TalentPackets.h
index 702b26be149..a7e3b0dc01b 100644
--- a/src/server/game/Server/Packets/TalentPackets.h
+++ b/src/server/game/Server/Packets/TalentPackets.h
@@ -33,28 +33,29 @@ namespace WorldPackets
uint8 Slot = 0;
};
- struct TalentGroupInfo
+ struct TalentInfo
{
- uint32 SpecID = 0;
- std::vector<uint16> TalentIDs;
- std::vector<PvPTalent> PvPTalents;
+ uint32 TalentID = 0;
+ uint8 Rank = 0;
};
- struct TalentInfoUpdate
+ struct TalentGroupInfo
{
- uint8 ActiveGroup = 0;
- uint32 PrimarySpecialization = 0;
- std::vector<TalentGroupInfo> TalentGroups;
+ uint8 SpecID = 0;
+ std::vector<TalentInfo> TalentInfos;
+ std::vector<uint16> GlyphInfo;
};
class UpdateTalentData final : public ServerPacket
{
public:
- UpdateTalentData() : ServerPacket(SMSG_UPDATE_TALENT_DATA, 2+4+4+4+12) { }
+ UpdateTalentData() : ServerPacket(SMSG_UPDATE_TALENT_DATA, 4 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + 2) { }
WorldPacket const* Write() override;
- TalentInfoUpdate Info;
+ uint32 UnspentTalentPoints = 0;
+ uint8 ActiveGroup = 0;
+ std::vector<TalentGroupInfo> TalentGroupInfos;
};
class LearnTalents final : public ClientPacket