1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYCORE_TALENT_PACKETS_H
#define TRINITYCORE_TALENT_PACKETS_H
#include "Packet.h"
#include "DBCEnums.h"
#include "ObjectGuid.h"
#include "PacketUtilities.h"
namespace WorldPackets
{
namespace Talent
{
struct PvPTalent
{
uint16 PvPTalentID = 0;
uint8 Slot = 0;
};
struct TalentGroupInfo
{
uint32 SpecID = 0;
std::vector<uint16> TalentIDs;
std::vector<PvPTalent> PvPTalents;
std::vector<uint32> GlyphIDs;
};
struct TalentInfoUpdate
{
uint8 ActiveGroup = 0;
uint32 PrimarySpecialization = 0;
std::vector<TalentGroupInfo> TalentGroups;
};
struct ClassicTalentEntry
{
int32 TalentID = 0;
int32 Rank = 0;
};
struct ClassicTalentGroupInfo
{
uint8 NumTalents = 0;
std::vector<ClassicTalentEntry> Talents;
uint8 NumGlyphs = 0;
std::vector<uint16> GlyphIDs;
int8 Role = 0;
int32 PrimarySpecialization = 0;
bool Unused1125 = false;
};
struct ClassicTalentInfoUpdate
{
int32 UnspentTalentPoints = 0;
uint8 ActiveGroup = 0;
bool IsPetTalents = false;
std::vector<ClassicTalentGroupInfo> Talents;
};
class UpdateTalentData final : public ServerPacket
{
public:
explicit UpdateTalentData() : ServerPacket(SMSG_UPDATE_TALENT_DATA, 2+4+4+4+12) { }
WorldPacket const* Write() override;
TalentInfoUpdate Info;
};
class LearnTalents final : public ClientPacket
{
public:
explicit LearnTalents(WorldPacket&& packet) : ClientPacket(CMSG_LEARN_TALENTS, std::move(packet)) { }
void Read() override;
Array<uint16, MAX_TALENT_TIERS> Talents;
};
class RespecWipeConfirm final : public ServerPacket
{
public:
explicit RespecWipeConfirm() : ServerPacket(SMSG_RESPEC_WIPE_CONFIRM, 16 + 4 +1) { }
WorldPacket const* Write() override;
ObjectGuid RespecMaster;
uint32 Cost = 0;
int8 RespecType = 0;
};
class ConfirmRespecWipe final : public ClientPacket
{
public:
explicit ConfirmRespecWipe(WorldPacket&& packet) : ClientPacket(CMSG_CONFIRM_RESPEC_WIPE, std::move(packet)) { }
void Read() override;
ObjectGuid RespecMaster;
uint8 RespecType = 0;
};
class LearnTalentFailed final : public ServerPacket
{
public:
explicit LearnTalentFailed() : ServerPacket(SMSG_LEARN_TALENT_FAILED, 1 + 4 + 4 + 2 * MAX_TALENT_TIERS) { }
WorldPacket const* Write() override;
uint32 Reason = 0;
int32 SpellID = 0;
std::vector<uint16> Talents;
};
struct GlyphBinding
{
GlyphBinding(uint32 spellId = 0, uint16 glyphId = 0) : SpellID(spellId), GlyphID(glyphId) { }
uint32 SpellID;
uint16 GlyphID;
};
class ActiveGlyphs final : public ServerPacket
{
public:
explicit ActiveGlyphs() : ServerPacket(SMSG_ACTIVE_GLYPHS) { }
WorldPacket const* Write() override;
std::vector<GlyphBinding> Glyphs;
bool IsFullUpdate = false;
};
class LearnPvpTalents final : public ClientPacket
{
public:
explicit LearnPvpTalents(WorldPacket&& packet) : ClientPacket(CMSG_LEARN_PVP_TALENTS, std::move(packet)) { }
void Read() override;
Array<PvPTalent, 4> Talents;
};
class LearnPvpTalentFailed final : public ServerPacket
{
public:
explicit LearnPvpTalentFailed() : ServerPacket(SMSG_LEARN_PVP_TALENT_FAILED, 1 + 4 + 4 + (2 + 1) * MAX_PVP_TALENT_SLOTS) { }
WorldPacket const* Write() override;
uint32 Reason = 0;
int32 SpellID = 0;
std::vector<PvPTalent> Talents;
};
ByteBuffer& operator<<(ByteBuffer& data, ClassicTalentInfoUpdate const& talentInfoInfo);
}
}
#endif // TRINITYCORE_TALENT_PACKETS_H
|