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
21{
23{
24 data << uint32(talentEntry.TalentID);
25 data << int8(talentEntry.Rank);
26
27 return data;
28}
29
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
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
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
69{
70 _worldPacket << uint8(Info.index());
71
72 switch (Info.index())
73 {
74 case 0:
76 break;
77 case 1:
79 break;
80 default:
81 break;
82 }
83
84 return &_worldPacket;
85}
86
94
99
106}
uint8_t uint8
Definition Define.h:135
int8_t int8
Definition Define.h:131
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
size_type size() const
WorldPacket _worldPacket
Definition Packet.h:42
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::variant< TalentInfoUpdate, PetTalentInfoUpdate > Info
ByteBuffer & operator<<(ByteBuffer &data, TalentEntry const &talentEntry)