TrinityCore
Loading...
Searching...
No Matches
TalentPackets.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#include "
TalentPackets.h
"
19
20
namespace
WorldPackets::Talent
21
{
22
ByteBuffer
&
operator<<
(
ByteBuffer
& data,
TalentEntry
const
&
talentEntry
)
23
{
24
data <<
uint32
(
talentEntry
.TalentID);
25
data <<
int8
(
talentEntry
.Rank);
26
27
return
data;
28
}
29
30
ByteBuffer
&
operator<<
(
ByteBuffer
& data,
TalentGroupInfo
const
&
talentGroup
)
31
{
32
data <<
uint8
(
talentGroup
.Talents.
size
());
33
34
for
(
TalentEntry
const
&
talentEntry
:
talentGroup
.Talents)
35
data <<
talentEntry
;
36
37
data <<
uint8
(
talentGroup
.GlyphIDs.
size
());
38
39
for
(
uint16
glyphID
:
talentGroup
.GlyphIDs)
40
data <<
uint16
(
glyphID
);
41
42
return
data;
43
}
44
45
ByteBuffer
&
operator<<
(
ByteBuffer
& data,
TalentInfoUpdate
const
&
talentInfo
)
46
{
47
data <<
uint32
(
talentInfo
.UnspentTalentPoints);
48
data <<
uint8
(
talentInfo
.TalentGroups.
size
());
49
data <<
uint8
(
talentInfo
.ActiveGroup);
50
51
for
(
TalentGroupInfo
const
&
talentGroup
:
talentInfo
.TalentGroups)
52
data <<
talentGroup
;
53
54
return
data;
55
}
56
57
ByteBuffer
&
operator<<
(
ByteBuffer
& data,
PetTalentInfoUpdate
const
&
petTalentInfo
)
58
{
59
data <<
uint32
(
petTalentInfo
.UnspentTalentPoints);
60
data <<
uint8
(
petTalentInfo
.Talents.
size
());
61
62
for
(
TalentEntry
const
&
talentEntry
:
petTalentInfo
.Talents)
63
data <<
talentEntry
;
64
65
return
data;
66
}
67
68
WorldPacket
const
*
UpdateTalentData::Write
()
69
{
70
_worldPacket
<<
uint8
(
Info
.index());
71
72
switch
(
Info
.index())
73
{
74
case
0:
75
_worldPacket << std::get<0>
(
Info
);
76
break
;
77
case
1:
78
_worldPacket << std::get<1>
(
Info
);
79
break
;
80
default
:
81
break
;
82
}
83
84
return
&
_worldPacket
;
85
}
86
87
WorldPacket
const
*
RespecWipeConfirm::Write
()
88
{
89
_worldPacket
<<
RespecMaster
;
90
_worldPacket
<<
uint32
(
Cost
);
91
92
return
&
_worldPacket
;
93
}
94
95
void
ConfirmRespecWipe::Read
()
96
{
97
_worldPacket
>>
RespecMaster
;
98
}
99
100
WorldPacket
const
*
InvoluntarilyReset::Write
()
101
{
102
_worldPacket
<<
uint8
(
IsPetTalents
);
103
104
return
&
_worldPacket
;
105
}
106
}
uint8
uint8_t uint8
Definition
Define.h:135
int8
int8_t int8
Definition
Define.h:131
uint16
uint16_t uint16
Definition
Define.h:134
uint32
uint32_t uint32
Definition
Define.h:133
TalentPackets.h
ByteBuffer
Definition
ByteBuffer.h:70
WorldPacket
Definition
WorldPacket.h:27
WorldPackets::Array
Definition
PacketUtilities.h:120
WorldPackets::Array::size
size_type size() const
Definition
PacketUtilities.h:171
WorldPackets::Packet::_worldPacket
WorldPacket _worldPacket
Definition
Packet.h:42
WorldPackets::Talent::ConfirmRespecWipe::RespecMaster
ObjectGuid RespecMaster
Definition
TalentPackets.h:82
WorldPackets::Talent::ConfirmRespecWipe::Read
void Read() override
Definition
TalentPackets.cpp:95
WorldPackets::Talent::InvoluntarilyReset::Write
WorldPacket const * Write() override
Definition
TalentPackets.cpp:100
WorldPackets::Talent::InvoluntarilyReset::IsPetTalents
uint8 IsPetTalents
Definition
TalentPackets.h:92
WorldPackets::Talent::RespecWipeConfirm::Cost
uint32 Cost
Definition
TalentPackets.h:72
WorldPackets::Talent::RespecWipeConfirm::Write
WorldPacket const * Write() override
Definition
TalentPackets.cpp:87
WorldPackets::Talent::RespecWipeConfirm::RespecMaster
ObjectGuid RespecMaster
Definition
TalentPackets.h:71
WorldPackets::Talent::UpdateTalentData::Write
WorldPacket const * Write() override
Definition
TalentPackets.cpp:68
WorldPackets::Talent::UpdateTalentData::Info
std::variant< TalentInfoUpdate, PetTalentInfoUpdate > Info
Definition
TalentPackets.h:60
WorldPackets::Talent
Definition
Player.h:91
WorldPackets::Talent::operator<<
ByteBuffer & operator<<(ByteBuffer &data, TalentEntry const &talentEntry)
Definition
TalentPackets.cpp:22
WorldPackets::Talent::PetTalentInfoUpdate
Definition
TalentPackets.h:48
WorldPackets::Talent::TalentEntry
Definition
TalentPackets.h:29
WorldPackets::Talent::TalentGroupInfo
Definition
TalentPackets.h:35
WorldPackets::Talent::TalentInfoUpdate
Definition
TalentPackets.h:41
server
game
Server
Packets
TalentPackets.cpp
Generated on Sun May 10 2026 02:30:17 for TrinityCore by
1.9.8