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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
|
/*
* 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_CHARACTER_PACKETS_H
#define TRINITYCORE_CHARACTER_PACKETS_H
#include "Packet.h"
#include "ObjectGuid.h"
#include "Optional.h"
#include "PacketUtilities.h"
#include "Position.h"
#include "RaceMask.h"
#include "SharedDefines.h"
#include "UnitDefines.h"
#include "UpdateFields.h"
#include <array>
#include <memory>
class Field;
namespace UF
{
struct ChrCustomizationChoice;
ByteBuffer& operator<<(ByteBuffer& data, ChrCustomizationChoice const& customizationChoice);
ByteBuffer& operator>>(ByteBuffer& data, ChrCustomizationChoice& customizationChoice);
}
namespace WorldPackets
{
namespace Character
{
using ChrCustomizationChoice = UF::ChrCustomizationChoice;
class EnumCharacters final : public ClientPacket
{
public:
explicit EnumCharacters(WorldPacket&& packet);
void Read() override { }
};
struct CharacterCreateInfo
{
/// User specified variables
uint8 Race = RACE_NONE;
uint8 Class = CLASS_NONE;
uint8 Sex = GENDER_NONE;
Array<ChrCustomizationChoice, 250> Customizations;
Optional<int32> TemplateSet;
int32 TimerunningSeasonID = 0;
bool IsTrialBoost = false;
bool UseNPE = false;
bool HardcoreSelfFound = false;
std::string Name;
/// Server side data
uint8 CharCount = 0;
};
struct CharacterRenameInfo
{
std::string NewName;
ObjectGuid Guid;
};
struct CharCustomizeInfo
{
ObjectGuid CharGUID;
uint8 SexID = GENDER_NONE;
std::string CharName;
Array<ChrCustomizationChoice, 250> Customizations;
};
struct CharRaceOrFactionChangeInfo
{
uint8 RaceID = RACE_NONE;
uint8 InitialRaceID = RACE_NONE;
uint8 SexID = GENDER_NONE;
ObjectGuid Guid;
bool FactionChange = false;
std::string Name;
Array<ChrCustomizationChoice, 250> Customizations;
};
struct CharacterUndeleteInfo
{
/// User specified variables
ObjectGuid CharacterGuid; ///< Guid of the character to restore
int32 ClientToken = 0; ///< @todo: research
/// Server side data
std::string Name;
};
struct CustomTabardInfo
{
int32 EmblemStyle = -1;
int32 EmblemColor = -1;
int32 BorderStyle = -1;
int32 BorderColor = -1;
int32 BackgroundColor = -1;
};
struct WarbandGroupMember
{
uint32 WarbandScenePlacementID = 0;
int32 Type = 0;
int32 ContentSetID = 0;
ObjectGuid Guid;
};
struct WarbandGroup
{
uint64 GroupID = 0;
uint8 OrderIndex = 0;
uint32 WarbandSceneID = 0;
uint32 Flags = 0; ///< enum WarbandGroupFlags { Collapsed = 1 }
int32 ContentSetID = 0;
std::vector<WarbandGroupMember> Members;
std::string_view Name;
};
class EnumCharactersResult final : public ServerPacket
{
public:
struct CharacterInfoBasic
{
/**
* @fn void WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Field* fields);
*
* @brief Initialize the struct with values from QueryResult
*
* @param fields Field set of CharacterDatabaseStatements::CHAR_SEL_ENUM
*/
CharacterInfoBasic(Field const* fields);
ObjectGuid Guid;
uint32 VirtualRealmAddress = 0;
uint64 GuildClubMemberID = 0; ///< same as bgs.protocol.club.v1.MemberId.unique_id, guessed basing on SMSG_QUERY_PLAYER_NAME_RESPONSE (that one is known)
std::string Name;
uint16 ListPosition = 0; ///< Order of the characters in list
uint8 RaceID = 0;
uint8 ClassID = 0;
uint8 SexID = 0;
std::vector<ChrCustomizationChoice> Customizations;
uint8 ExperienceLevel = 0;
int32 ZoneID = 0;
int32 MapID = 0;
TaggedPosition<Position::XYZ> PreloadPos;
ObjectGuid GuildGUID;
uint32 Flags = 0; ///< Character flag @see enum CharacterFlags
uint32 Flags2 = 0; ///< Character customization flags @see enum CharacterCustomizeFlags
uint32 Flags3 = 0; ///< Character flags 3 @todo research
uint32 Flags4 = 0; ///< Character flags 4 @todo research
bool FirstLogin = false;
uint8 CantLoginReason = 0;
Timestamp<> CreateTime;
Timestamp<> LastActiveTime;
uint16 SpecID = 0;
uint32 SaveVersion = 0;
uint32 LastLoginVersion = 0;
uint32 OverrideSelectScreenFileDataID = 0;
int32 TimerunningSeasonID = 0;
uint32 PetCreatureDisplayID = 0;
uint32 PetExperienceLevel = 0;
uint32 PetCreatureFamilyID = 0;
int32 ProfessionIds[2] = { }; ///< @todo
struct VisualItemInfo
{
uint32 DisplayID = 0;
uint32 DisplayEnchantID = 0;
int32 SecondaryItemModifiedAppearanceID = 0; // also -1 is some special value
uint8 InvType = 0;
uint8 Subclass = 0;
uint32 ItemID = 0;
uint32 TransmogrifiedItemID = 0;
};
std::array<VisualItemInfo, 19> VisualItems = { };
CustomTabardInfo PersonalTabard;
uint32 Unused1110_1 = 0;
bool Unused1110_2 = false;
bool Unused1110_3 = false;
};
struct CharacterRestrictionAndMailData
{
bool BoostInProgress = false; ///< @todo
uint32 RestrictionFlags = 0;
std::vector<std::string> MailSenders;
std::vector<uint32> MailSenderTypes;
bool RpeAvailable = false;
};
struct CharacterInfo
{
CharacterInfo(Field const* fields);
CharacterInfoBasic Basic;
CharacterRestrictionAndMailData RestrictionsAndMails;
};
struct RegionwideCharacterListEntry
{
RegionwideCharacterListEntry(Field const* fields);
CharacterInfoBasic Basic;
uint64 Money = 0;
float AvgEquippedItemLevel = 0.0f;
float CurrentSeasonMythicPlusOverallScore = 0.0f;
uint32 CurrentSeasonBestPvpRating = 0;
int8 PvpRatingBracket = 0;
int16 PvpRatingAssociatedSpecID = 0;
};
struct RaceUnlock
{
int8 RaceID = 0;
bool HasUnlockedLicense = false;
bool HasUnlockedAchievement = false;
bool HasHeritageArmorUnlockAchievement = false;
bool HideRaceOnClient = false;
bool Unused1027 = false;
};
struct UnlockedConditionalAppearance
{
int32 AchievementID = 0;
int32 ConditionalType = 0;
};
struct RaceLimitDisableInfo
{
enum
{
Server,
Level
};
int8 RaceID = 0;
int8 Reason = 0;
};
explicit EnumCharactersResult() : ServerPacket(SMSG_ENUM_CHARACTERS_RESULT) { }
WorldPacket const* Write() override;
bool Success = false;
bool Realmless = false;
bool IsDeletedCharacters = false; ///< used for character undelete list
bool IgnoreNewPlayerRestrictions = false; ///< allows client to skip new player restrictions
bool IsRestrictedNewPlayer = false; ///< forbids using level boost and class trials
bool IsNewcomerChatCompleted = false; ///< forbids hero classes and allied races
bool IsRestrictedTrial = false;
bool Unused1127 = false;
bool DontCreateCharacterDisplays = false;
int32 MaxCharacterLevel = 1;
Optional<uint32> ClassDisableMask;
std::vector<CharacterInfo> Characters; ///< all characters on the list
std::vector<RegionwideCharacterListEntry> RegionwideCharacters;
std::vector<RaceUnlock> RaceUnlockData;
std::vector<UnlockedConditionalAppearance> UnlockedConditionalAppearances;
std::vector<RaceLimitDisableInfo> RaceLimitDisables;
std::vector<WarbandGroup> WarbandGroups;
};
class CheckCharacterNameAvailability final : public ClientPacket
{
public:
explicit CheckCharacterNameAvailability(WorldPacket&& packet) : ClientPacket(CMSG_CHECK_CHARACTER_NAME_AVAILABILITY, std::move(packet)) { }
void Read() override;
uint32 SequenceIndex = 0;
std::string Name;
};
class CheckCharacterNameAvailabilityResult final : public ServerPacket
{
public:
explicit CheckCharacterNameAvailabilityResult(uint32 sequenceIndex, uint32 result) : ServerPacket(SMSG_CHECK_CHARACTER_NAME_AVAILABILITY_RESULT, 4 + 4),
SequenceIndex(sequenceIndex), Result(result)
{
}
WorldPacket const* Write() override;
uint32 SequenceIndex;
uint32 Result;
};
class CreateCharacter final : public ClientPacket
{
public:
explicit CreateCharacter(WorldPacket&& packet) : ClientPacket(CMSG_CREATE_CHARACTER, std::move(packet)) { }
void Read() override;
/**
* @var uint8 Race
* @var uint8 Class
* @var uint8 Sex
* @var uint8 Skin
* @var uint8 Face
* @var uint8 HairStyle
* @var uint8 HairColor
* @var uint8 FacialHairStyle
* @var uint8 OutfitId
* @var Optional<int32> TemplateSet
* @var std::string Name
*/
std::shared_ptr<CharacterCreateInfo> CreateInfo;
};
class CreateChar final : public ServerPacket
{
public:
explicit CreateChar() : ServerPacket(SMSG_CREATE_CHAR, 1) { }
WorldPacket const* Write() override;
uint32 Code = 0; ///< Result code @see enum ResponseCodes
ObjectGuid Guid;
};
class CharDelete final : public ClientPacket
{
public:
explicit CharDelete(WorldPacket&& packet): ClientPacket(CMSG_CHAR_DELETE, std::move(packet)) { }
void Read() override;
ObjectGuid Guid; ///< Guid of the character to delete
};
class DeleteChar final : public ServerPacket
{
public:
explicit DeleteChar(): ServerPacket(SMSG_DELETE_CHAR, 1) { }
WorldPacket const* Write() override;
uint32 Code = 0; ///< Result code @see enum ResponseCodes
};
class CharacterRenameRequest final : public ClientPacket
{
public:
explicit CharacterRenameRequest(WorldPacket&& packet) : ClientPacket(CMSG_CHARACTER_RENAME_REQUEST, std::move(packet)) { }
void Read() override;
/**
* @var std::string NewName
* @var ObjectGuid Guid
*/
std::shared_ptr<CharacterRenameInfo> RenameInfo;
};
class CharacterRenameResult final : public ServerPacket
{
public:
explicit CharacterRenameResult() : ServerPacket(SMSG_CHARACTER_RENAME_RESULT, 20) { }
WorldPacket const* Write() override;
std::string Name;
uint32 Result = 0;
Optional<ObjectGuid> Guid;
};
class CharCustomize final : public ClientPacket
{
public:
explicit CharCustomize(WorldPacket&& packet) : ClientPacket(CMSG_CHAR_CUSTOMIZE, std::move(packet)) { }
void Read() override;
/**
* @var uint8 HairStyleID
* @var uint8 FaceID
* @var ObjectGuid CharGUID
* @var uint8 SexID
* @var std::string CharName
* @var uint8 HairColorID
* @var uint8 FacialHairStyleID
* @var uint8 SkinID
*/
std::shared_ptr<CharCustomizeInfo> CustomizeInfo;
};
/// @todo: CharCustomizeResult
class CharRaceOrFactionChange final : public ClientPacket
{
public:
explicit CharRaceOrFactionChange(WorldPacket&& packet) : ClientPacket(CMSG_CHAR_RACE_OR_FACTION_CHANGE, std::move(packet)) { }
void Read() override;
/**
* @var Optional<uint8> HairColorID
* @var uint8 RaceID
* @var uint8 SexID
* @var Optional<uint8> SkinID
* @var Optional<uint8> FacialHairStyleID
* @var ObjectGuid Guid
* @var bool FactionChange
* @var std::string Name
* @var Optional<uint8> FaceID
* @var Optional<uint8> HairStyleID
*/
std::shared_ptr<CharRaceOrFactionChangeInfo> RaceOrFactionChangeInfo;
};
struct CharFactionChangeDisplayInfo
{
std::string Name;
uint8 SexID = 0;
uint8 RaceID = RACE_NONE;
Array<ChrCustomizationChoice, 250> const* Customizations = nullptr;
};
class CharFactionChangeResult final : public ServerPacket
{
public:
explicit CharFactionChangeResult() : ServerPacket(SMSG_CHAR_FACTION_CHANGE_RESULT, 20 + sizeof(CharFactionChangeDisplayInfo)) { }
WorldPacket const* Write() override;
uint32 Result = 0; ///< @see enum ResponseCodes
ObjectGuid Guid;
Optional<CharFactionChangeDisplayInfo> Display;
};
class GenerateRandomCharacterName final : public ClientPacket
{
public:
explicit GenerateRandomCharacterName(WorldPacket&& packet) : ClientPacket(CMSG_GENERATE_RANDOM_CHARACTER_NAME, std::move(packet)) { }
void Read() override;
uint8 Sex = 0;
uint8 Race = 0;
};
class GenerateRandomCharacterNameResult final : public ServerPacket
{
public:
explicit GenerateRandomCharacterNameResult() : ServerPacket(SMSG_GENERATE_RANDOM_CHARACTER_NAME_RESULT, 20) { }
WorldPacket const* Write() override;
std::string Name;
bool Success = false;
};
class ReorderCharacters final : public ClientPacket
{
public:
struct ReorderInfo
{
ObjectGuid PlayerGUID;
uint8 NewPosition = 0;
};
explicit ReorderCharacters(WorldPacket&& packet);
void Read() override;
Array<ReorderInfo, 200> Entries;
};
class UndeleteCharacter final : public ClientPacket
{
public:
explicit UndeleteCharacter(WorldPacket&& packet) : ClientPacket(CMSG_UNDELETE_CHARACTER, std::move(packet)) { }
void Read() override;
/**
* @var ObjectGuid CharacterGuid
* @var int32 ClientToken
*/
std::shared_ptr<CharacterUndeleteInfo> UndeleteInfo;
};
class UndeleteCharacterResponse final : public ServerPacket
{
public:
explicit UndeleteCharacterResponse() : ServerPacket(SMSG_UNDELETE_CHARACTER_RESPONSE, 26) { }
WorldPacket const* Write() override;
/**
* @var ObjectGuid CharacterGuid
* @var int32 ClientToken
*/
CharacterUndeleteInfo const* UndeleteInfo = nullptr;
uint32 Result = 0; ///< @see enum CharacterUndeleteResult
};
class GetUndeleteCharacterCooldownStatus final : public ClientPacket
{
public:
explicit GetUndeleteCharacterCooldownStatus(WorldPacket&& packet) : ClientPacket(CMSG_GET_UNDELETE_CHARACTER_COOLDOWN_STATUS, std::move(packet)) { }
void Read() override { }
};
class UndeleteCooldownStatusResponse final : public ServerPacket
{
public:
explicit UndeleteCooldownStatusResponse() : ServerPacket(SMSG_UNDELETE_COOLDOWN_STATUS_RESPONSE, 9) { }
WorldPacket const* Write() override;
uint32 MaxCooldown = 0; ///< Max. cooldown until next free character restoration. Displayed in undelete confirm message. (in sec)
uint32 CurrentCooldown = 0; ///< Current cooldown until next free character restoration. (in sec)
bool OnCooldown = false; ///<
};
class PlayerLogin final : public ClientPacket
{
public:
explicit PlayerLogin(WorldPacket&& packet) : ClientPacket(CMSG_PLAYER_LOGIN, std::move(packet)) { }
void Read() override;
ObjectGuid Guid; ///< Guid of the player that is logging in
float FarClip = 0.0f; ///< Visibility distance (for terrain)
bool RPE = false;
};
class LoginVerifyWorld final : public ServerPacket
{
public:
explicit LoginVerifyWorld() : ServerPacket(SMSG_LOGIN_VERIFY_WORLD, 4 + 4 * 4 + 4) { }
WorldPacket const* Write() override;
int32 MapID = -1;
TaggedPosition<Position::XYZO> Pos;
uint32 Reason = 0;
};
enum class LoginFailureReason : uint8
{
Failed = 0,
NoWorld = 1,
DuplicateCharacter = 2,
NoInstances = 3,
Disabled = 4,
NoCharacter = 5,
LockedForTransfer = 6,
LockedByBilling = 7,
LockedByMobileAH = 8,
TemporaryGMLock = 9,
LockedByCharacterUpgrade = 10,
LockedByRevokedCharacterUpgrade = 11,
LockedByRevokedVASTransaction = 17,
LockedByRestriction = 19,
LockedForRealmPlaytype = 23
};
class CharacterLoginFailed final : public ServerPacket
{
public:
explicit CharacterLoginFailed(LoginFailureReason code) : ServerPacket(SMSG_CHARACTER_LOGIN_FAILED, 1), Code(code) { }
WorldPacket const* Write() override;
LoginFailureReason Code = LoginFailureReason::Failed;
};
class LogoutRequest final : public ClientPacket
{
public:
explicit LogoutRequest(WorldPacket&& packet) : ClientPacket(CMSG_LOGOUT_REQUEST, std::move(packet)) { }
void Read() override;
bool IdleLogout = false;
};
class LogoutResponse final : public ServerPacket
{
public:
explicit LogoutResponse() : ServerPacket(SMSG_LOGOUT_RESPONSE, 4 + 1) { }
WorldPacket const* Write() override;
int32 LogoutResult = 0;
bool Instant = false;
};
struct GameModeData
{
int32 Unknown_1107_0 = 0;
ObjectGuid Guid;
uint8 GameMode = 0;
int32 MapID = 0;
uint8 Unknown_1107_1 = 0;
uint8 Unknown_1107_2 = 0;
uint8 Unknown_1107_3 = 0;
Array<ChrCustomizationChoice, 250> Customizations;
Array<ChrCustomizationChoice, 250> Unknown_1107_4;
};
struct SwitchGameModeData
{
bool IsFastLogin = false;
GameModeData Current;
GameModeData New;
};
class LogoutComplete final : public ServerPacket
{
public:
LogoutComplete() : ServerPacket(SMSG_LOGOUT_COMPLETE, 1) { }
WorldPacket const* Write() override;
std::unique_ptr<SwitchGameModeData> SwitchGameMode;
};
class LogoutCancel final : public ClientPacket
{
public:
explicit LogoutCancel(WorldPacket&& packet) : ClientPacket(CMSG_LOGOUT_CANCEL, std::move(packet)) { }
void Read() override { }
};
class LogoutCancelAck final : public ServerPacket
{
public:
explicit LogoutCancelAck() : ServerPacket(SMSG_LOGOUT_CANCEL_ACK, 0) { }
WorldPacket const* Write() override { return &_worldPacket; }
};
class LoadingScreenNotify final : public ClientPacket
{
public:
explicit LoadingScreenNotify(WorldPacket&& packet) : ClientPacket(CMSG_LOADING_SCREEN_NOTIFY, std::move(packet)) { }
void Read() override;
int32 MapID = -1;
bool Showing = false;
};
class InitialSetup final : public ServerPacket
{
public:
explicit InitialSetup() : ServerPacket(SMSG_INITIAL_SETUP, 1 + 1) { }
WorldPacket const* Write() override;
uint8 ServerExpansionTier = 0;
uint8 ServerExpansionLevel = 0;
};
class SetActionBarToggles final : public ClientPacket
{
public:
explicit SetActionBarToggles(WorldPacket&& packet) : ClientPacket(CMSG_SET_ACTION_BAR_TOGGLES, std::move(packet)) { }
void Read() override;
uint8 Mask = 0;
};
class RequestPlayedTime final : public ClientPacket
{
public:
explicit RequestPlayedTime(WorldPacket&& packet) : ClientPacket(CMSG_REQUEST_PLAYED_TIME, std::move(packet)) { }
void Read() override;
bool TriggerScriptEvent = false;
};
class PlayedTime final : public ServerPacket
{
public:
explicit PlayedTime() : ServerPacket(SMSG_PLAYED_TIME, 9) { }
WorldPacket const* Write() override;
int32 TotalTime = 0;
int32 LevelTime = 0;
bool TriggerEvent = false;
};
class SetTitle final : public ClientPacket
{
public:
explicit SetTitle(WorldPacket&& packet) : ClientPacket(CMSG_SET_TITLE, std::move(packet)) { }
void Read() override;
int32 TitleID = 0;
};
class AlterApperance final : public ClientPacket
{
public:
explicit AlterApperance(WorldPacket&& packet) : ClientPacket(CMSG_ALTER_APPEARANCE, std::move(packet)) { }
void Read() override;
uint8 NewSex = 0;
Array<ChrCustomizationChoice, 250> Customizations;
int8 CustomizedRace = 0;
int32 CustomizedChrModelID = 0;
int8 UnalteredVisualRaceID = 0;
};
class BarberShopResult final : public ServerPacket
{
public:
enum class ResultEnum : uint8
{
Success = 0,
NoMoney = 1,
NotOnChair = 2,
NoMoney2 = 3
};
explicit BarberShopResult(ResultEnum result) : ServerPacket(SMSG_BARBER_SHOP_RESULT, 4), Result(result) { }
WorldPacket const* Write() override;
ResultEnum Result = ResultEnum::Success;
};
class LogXPGain final : public ServerPacket
{
public:
explicit LogXPGain() : ServerPacket(SMSG_LOG_XP_GAIN, 16 + 4 + 1 + 4 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Victim;
int32 Original = 0;
uint8 Reason = 0;
int32 Amount = 0;
float GroupBonus = 0.0f;
};
class TitleEarned final : public ServerPacket
{
public:
explicit TitleEarned(OpcodeServer opcode) : ServerPacket(opcode, 4) { }
WorldPacket const* Write() override;
uint32 Index = 0;
};
class SetFactionAtWar final : public ClientPacket
{
public:
explicit SetFactionAtWar(WorldPacket&& packet) : ClientPacket(CMSG_SET_FACTION_AT_WAR, std::move(packet)) { }
void Read() override;
uint16 FactionIndex = 0;
};
class SetFactionNotAtWar final : public ClientPacket
{
public:
explicit SetFactionNotAtWar(WorldPacket&& packet) : ClientPacket(CMSG_SET_FACTION_NOT_AT_WAR, std::move(packet)) { }
void Read() override;
uint16 FactionIndex = 0;
};
class SetFactionInactive final : public ClientPacket
{
public:
explicit SetFactionInactive(WorldPacket&& packet) : ClientPacket(CMSG_SET_FACTION_INACTIVE, std::move(packet)) { }
void Read() override;
uint32 Index = 0;
bool State = false;
};
class SetWatchedFaction final : public ClientPacket
{
public:
explicit SetWatchedFaction(WorldPacket&& packet) : ClientPacket(CMSG_SET_WATCHED_FACTION, std::move(packet)) { }
void Read() override;
uint32 FactionIndex = 0;
};
class SetFactionVisible : public ServerPacket
{
public:
explicit SetFactionVisible(bool visible) : ServerPacket(visible ? SMSG_SET_FACTION_VISIBLE : SMSG_SET_FACTION_NOT_VISIBLE, 4) { }
WorldPacket const* Write() override;
uint32 FactionIndex = 0;
};
class CharCustomizeSuccess final : public ServerPacket
{
public:
explicit CharCustomizeSuccess(CharCustomizeInfo const* customizeInfo);
WorldPacket const* Write() override;
ObjectGuid CharGUID;
std::string CharName;
uint8 SexID = 0;
Array<ChrCustomizationChoice, 250> const& Customizations;
};
class CharCustomizeFailure final : public ServerPacket
{
public:
explicit CharCustomizeFailure() : ServerPacket(SMSG_CHAR_CUSTOMIZE_FAILURE, 1 + 16) { }
WorldPacket const* Write() override;
uint32 Result = 0;
ObjectGuid CharGUID;
};
class SetPlayerDeclinedNames final : public ClientPacket
{
public:
explicit SetPlayerDeclinedNames(WorldPacket&& packet) : ClientPacket(CMSG_SET_PLAYER_DECLINED_NAMES, std::move(packet)) { }
void Read() override;
ObjectGuid Player;
DeclinedName DeclinedNames;
};
class SetPlayerDeclinedNamesResult final : public ServerPacket
{
public:
explicit SetPlayerDeclinedNamesResult() : ServerPacket(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 8 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Player;
int32 ResultCode = 0;
};
class SavePersonalEmblem final : public ClientPacket
{
public:
explicit SavePersonalEmblem(WorldPacket&& packet) : ClientPacket(CMSG_SAVE_PERSONAL_EMBLEM, std::move(packet)) { }
void Read() override;
ObjectGuid Vendor;
CustomTabardInfo PersonalTabard;
};
class PlayerSavePersonalEmblem final : public ServerPacket
{
public:
explicit PlayerSavePersonalEmblem(int32 error) : ServerPacket(SMSG_PLAYER_SAVE_PERSONAL_EMBLEM, 4), Error(error) { }
WorldPacket const* Write() override;
int32 Error;
};
}
}
#endif // TRINITYCORE_CHARACTER_PACKETS_H
|