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
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
|
/*
* 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_MISC_PACKETS_H
#define TRINITYCORE_MISC_PACKETS_H
#include "Packet.h"
#include "CollectionMgr.h"
#include "CUFProfile.h"
#include "ItemPacketsCommon.h"
#include "ObjectGuid.h"
#include "Optional.h"
#include "PacketUtilities.h"
#include "Position.h"
#include "SharedDefines.h"
#include "WowTime.h"
#include <array>
#include <map>
enum class CountdownTimerType : int32;
enum class DisplayToastType : uint8;
enum class DisplayToastMethod : uint8;
enum UnitStandStateType : uint8;
enum WeatherState : uint32;
namespace WorldPackets
{
namespace Misc
{
class BindPointUpdate final : public ServerPacket
{
public:
explicit BindPointUpdate() : ServerPacket(SMSG_BIND_POINT_UPDATE, 20) { }
WorldPacket const* Write() override;
uint32 BindMapID = 0;
TaggedPosition<Position::XYZ> BindPosition;
uint32 BindAreaID = 0;
};
class PlayerBound final : public ServerPacket
{
public:
explicit PlayerBound() : ServerPacket(SMSG_PLAYER_BOUND, 16 + 4) { }
explicit PlayerBound(ObjectGuid binderId, uint32 areaId) : ServerPacket(SMSG_PLAYER_BOUND, 16 + 4),
BinderID(binderId), AreaID(areaId) { }
WorldPacket const* Write() override;
ObjectGuid BinderID;
uint32 AreaID = 0;
};
class InvalidatePlayer final : public ServerPacket
{
public:
explicit InvalidatePlayer() : ServerPacket(SMSG_INVALIDATE_PLAYER, 18) { }
WorldPacket const* Write() override;
ObjectGuid Guid;
};
class LoginSetTimeSpeed final : public ServerPacket
{
public:
explicit LoginSetTimeSpeed() : ServerPacket(SMSG_LOGIN_SET_TIME_SPEED, 20) { }
WorldPacket const* Write() override;
float NewSpeed = 0.0f;
int32 ServerTimeHolidayOffset = 0;
WowTime GameTime;
WowTime ServerTime;
int32 GameTimeHolidayOffset = 0;
};
class ResetWeeklyCurrency final : public ServerPacket
{
public:
explicit ResetWeeklyCurrency() : ServerPacket(SMSG_RESET_WEEKLY_CURRENCY, 0) { }
WorldPacket const* Write() override { return &_worldPacket; }
};
class SetCurrency final : public ServerPacket
{
public:
explicit SetCurrency() : ServerPacket(SMSG_SET_CURRENCY, 12) { }
WorldPacket const* Write() override;
int32 Type = 0;
int32 Quantity = 0;
CurrencyGainFlags Flags = CurrencyGainFlags(0);
std::vector<Item::UiEventToast> Toasts;
Optional<int32> WeeklyQuantity;
Optional<int32> TrackedQuantity;
Optional<int32> MaxQuantity;
Optional<int32> TotalEarned;
Optional<int32> QuantityChange;
Optional<CurrencyGainSource> QuantityGainSource;
Optional<CurrencyDestroyReason> QuantityLostSource;
Optional<uint32> FirstCraftOperationID;
Optional<Timestamp<>> NextRechargeTime;
Optional<Timestamp<>> RechargeCycleStartTime;
Optional<int32> OverflownCurrencyID; // what currency was originally changed but couldn't be incremented because of a cap
bool SuppressChatLog = false;
};
class SetSelection final : public ClientPacket
{
public:
explicit SetSelection(WorldPacket&& packet) : ClientPacket(CMSG_SET_SELECTION, std::move(packet)) { }
void Read() override;
ObjectGuid Selection; ///< Target
};
class SetupCurrency final : public ServerPacket
{
public:
struct Record
{
int32 Type = 0; // ID from CurrencyTypes.dbc
int32 Quantity = 0;
Optional<int32> WeeklyQuantity; // Currency count obtained this Week.
Optional<int32> MaxWeeklyQuantity; // Weekly Currency cap.
Optional<int32> TrackedQuantity;
Optional<int32> MaxQuantity;
Optional<int32> TotalEarned;
Optional<Timestamp<>> NextRechargeTime;
Optional<Timestamp<>> RechargeCycleStartTime;
uint8 Flags = 0;
};
explicit SetupCurrency() : ServerPacket(SMSG_SETUP_CURRENCY, 22) { }
WorldPacket const* Write() override;
std::vector<Record> Data;
};
class ViolenceLevel final : public ClientPacket
{
public:
explicit ViolenceLevel(WorldPacket&& packet) : ClientPacket(CMSG_VIOLENCE_LEVEL, std::move(packet)) { }
void Read() override;
int8 ViolenceLvl = -1; ///< 0 - no combat effects, 1 - display some combat effects, 2 - blood, 3 - bloody, 4 - bloodier, 5 - bloodiest
};
class TimeSyncRequest final : public ServerPacket
{
public:
explicit TimeSyncRequest() : ServerPacket(SMSG_TIME_SYNC_REQUEST, 4) { }
WorldPacket const* Write() override;
uint32 SequenceIndex = 0;
};
class TimeSyncResponse final : public ClientPacket
{
public:
explicit TimeSyncResponse(WorldPacket&& packet) : ClientPacket(CMSG_TIME_SYNC_RESPONSE, std::move(packet)) { }
void Read() override;
TimePoint GetReceivedTime() const { return _worldPacket.GetReceivedTime(); }
uint32 ClientTime = 0; // Client ticks in ms
uint32 SequenceIndex = 0; // Same index as in request
};
class TriggerCinematic final : public ServerPacket
{
public:
explicit TriggerCinematic() : ServerPacket(SMSG_TRIGGER_CINEMATIC, 4) { }
WorldPacket const* Write() override;
uint32 CinematicID = 0;
ObjectGuid ConversationGuid;
};
class TriggerMovie final : public ServerPacket
{
public:
explicit TriggerMovie() : ServerPacket(SMSG_TRIGGER_MOVIE, 4) { }
WorldPacket const* Write() override;
uint32 MovieID = 0;
};
class ServerTimeOffsetRequest final : public ClientPacket
{
public:
explicit ServerTimeOffsetRequest(WorldPacket&& packet) : ClientPacket(CMSG_SERVER_TIME_OFFSET_REQUEST, std::move(packet)) { }
void Read() override { }
};
class ServerTimeOffset final : public ServerPacket
{
public:
explicit ServerTimeOffset() : ServerPacket(SMSG_SERVER_TIME_OFFSET, 4) { }
WorldPacket const* Write() override;
Timestamp<> Time;
};
class TutorialFlags : public ServerPacket
{
public:
explicit TutorialFlags() : ServerPacket(SMSG_TUTORIAL_FLAGS, 32) { }
WorldPacket const* Write() override;
std::array<uint32, MAX_ACCOUNT_TUTORIAL_VALUES> TutorialData = { };
};
class TutorialSetFlag final : public ClientPacket
{
public:
explicit TutorialSetFlag(WorldPacket&& packet) : ClientPacket(CMSG_TUTORIAL, std::move(packet)) { }
void Read() override;
uint8 Action = 0;
uint32 TutorialBit = 0;
};
class WorldServerInfo final : public ServerPacket
{
public:
explicit WorldServerInfo() : ServerPacket(SMSG_WORLD_SERVER_INFO, 26) { }
WorldPacket const* Write() override;
uint32 DifficultyID = 0;
bool IsTournamentRealm = false;
bool XRealmPvpAlert = false;
bool BlockExitingLoadingScreen = false; // when set to true, sending SMSG_UPDATE_OBJECT with CreateObject Self bit = true will not hide loading screen
// instead it will be done after this packet is sent again with false in this bit and SMSG_UPDATE_OBJECT Values for player
Optional<uint32> RestrictedAccountMaxLevel;
Optional<uint64> RestrictedAccountMaxMoney;
Optional<uint32> InstanceGroupSize;
ObjectGuid HouseGuid;
ObjectGuid HouseOwnerBnetAccount;
ObjectGuid HouseOwnerPlayer;
ObjectGuid NeighborhoodGuid;
};
class SetDungeonDifficulty final : public ClientPacket
{
public:
explicit SetDungeonDifficulty(WorldPacket&& packet) : ClientPacket(CMSG_SET_DUNGEON_DIFFICULTY, std::move(packet)) { }
void Read() override;
uint32 DifficultyID = 0;
};
class SetRaidDifficulty final : public ClientPacket
{
public:
explicit SetRaidDifficulty(WorldPacket&& packet) : ClientPacket(CMSG_SET_RAID_DIFFICULTY, std::move(packet)) { }
void Read() override;
int32 Legacy = 0;
int32 DifficultyID = 0;
};
class DungeonDifficultySet final : public ServerPacket
{
public:
explicit DungeonDifficultySet() : ServerPacket(SMSG_SET_DUNGEON_DIFFICULTY, 4) { }
WorldPacket const* Write() override;
int32 DifficultyID = 0;
};
class RaidDifficultySet final : public ServerPacket
{
public:
explicit RaidDifficultySet() : ServerPacket(SMSG_RAID_DIFFICULTY_SET, 4 + 1) { }
WorldPacket const* Write() override;
int32 Legacy = 0;
int32 DifficultyID = 0;
};
class CorpseReclaimDelay : public ServerPacket
{
public:
explicit CorpseReclaimDelay() : ServerPacket(SMSG_CORPSE_RECLAIM_DELAY, 4) { }
WorldPacket const* Write() override;
uint32 Remaining = 0;
};
class DeathReleaseLoc : public ServerPacket
{
public:
explicit DeathReleaseLoc() : ServerPacket(SMSG_DEATH_RELEASE_LOC, 4 + (3 * 4)) { }
WorldPacket const* Write() override;
int32 MapID = 0;
TaggedPosition<Position::XYZ> Loc;
};
class PortGraveyard final : public ClientPacket
{
public:
explicit PortGraveyard(WorldPacket&& packet) : ClientPacket(CMSG_CLIENT_PORT_GRAVEYARD, std::move(packet)) { }
void Read() override { }
};
class PreRessurect : public ServerPacket
{
public:
explicit PreRessurect() : ServerPacket(SMSG_PRE_RESSURECT, 18) { }
WorldPacket const* Write() override;
ObjectGuid PlayerGUID;
};
class ReclaimCorpse final : public ClientPacket
{
public:
explicit ReclaimCorpse(WorldPacket&& packet) : ClientPacket(CMSG_RECLAIM_CORPSE, std::move(packet)) { }
void Read() override;
ObjectGuid CorpseGUID;
};
class RepopRequest final : public ClientPacket
{
public:
explicit RepopRequest(WorldPacket&& packet) : ClientPacket(CMSG_REPOP_REQUEST, std::move(packet)) { }
void Read() override;
bool CheckInstance = false;
};
class RequestCemeteryList final : public ClientPacket
{
public:
explicit RequestCemeteryList(WorldPacket&& packet) : ClientPacket(CMSG_REQUEST_CEMETERY_LIST, std::move(packet)) { }
void Read() override { }
};
class RequestCemeteryListResponse final : public ServerPacket
{
public:
explicit RequestCemeteryListResponse() : ServerPacket(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, 1) { }
WorldPacket const* Write() override;
bool IsGossipTriggered = false;
std::vector<uint32> CemeteryID;
};
class ResurrectResponse final : public ClientPacket
{
public:
explicit ResurrectResponse(WorldPacket&& packet) : ClientPacket(CMSG_RESURRECT_RESPONSE, std::move(packet)) { }
void Read() override;
ObjectGuid Resurrecter;
uint32 Response = 0;
};
class TC_GAME_API Weather final : public ServerPacket
{
public:
explicit Weather() : ServerPacket(SMSG_WEATHER, 4 + 4 + 1) { }
explicit Weather(WeatherState weatherID, float intensity = 0.0f, bool abrupt = false) : ServerPacket(SMSG_WEATHER, 4 + 4 + 1),
Abrupt(abrupt), Intensity(intensity), WeatherID(weatherID) { }
WorldPacket const* Write() override;
bool Abrupt = false;
float Intensity = 0.0f;
WeatherState WeatherID = WeatherState(0);
};
class StandStateChange final : public ClientPacket
{
public:
explicit StandStateChange(WorldPacket&& packet) : ClientPacket(CMSG_STAND_STATE_CHANGE, std::move(packet)) { }
void Read() override;
UnitStandStateType StandState = UnitStandStateType(0);
};
class StandStateUpdate final : public ServerPacket
{
public:
explicit StandStateUpdate() : ServerPacket(SMSG_STAND_STATE_UPDATE, 4 + 1) { }
explicit StandStateUpdate(UnitStandStateType state, uint32 animKitID) : ServerPacket(SMSG_STAND_STATE_UPDATE, 4 + 1),
AnimKitID(animKitID), State(state) { }
WorldPacket const* Write() override;
uint32 AnimKitID = 0;
UnitStandStateType State = UnitStandStateType(0);
};
class SetAnimTier final : public ServerPacket
{
public:
explicit SetAnimTier(): ServerPacket(SMSG_SET_ANIM_TIER, 16 + 1) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
uint8 Tier = 0;
};
class StartMirrorTimer final : public ServerPacket
{
public:
explicit StartMirrorTimer() : ServerPacket(SMSG_START_MIRROR_TIMER, 1 + 4 + 4 + 4 + 4 + 1) { }
explicit StartMirrorTimer(uint8 timer, int32 value, int32 maxValue, int32 scale, int32 spellID, bool paused)
: ServerPacket(SMSG_START_MIRROR_TIMER, 1 + 4 + 4 + 4 + 4 + 1),
Timer(timer), Scale(scale), MaxValue(maxValue), SpellID(spellID), Value(value), Paused(paused) { }
WorldPacket const* Write() override;
uint8 Timer = 0;
int32 Scale = 0;
int32 MaxValue = 0;
int32 SpellID = 0;
int32 Value = 0;
bool Paused = false;
};
class PauseMirrorTimer final : public ServerPacket
{
public:
explicit PauseMirrorTimer() : ServerPacket(SMSG_PAUSE_MIRROR_TIMER, 1 + 1) { }
explicit PauseMirrorTimer(uint8 timer, bool paused) : ServerPacket(SMSG_PAUSE_MIRROR_TIMER, 1 + 1),
Timer(timer), Paused(paused) { }
WorldPacket const* Write() override;
uint8 Timer = 0;
bool Paused = true;
};
class StopMirrorTimer final : public ServerPacket
{
public:
explicit StopMirrorTimer() : ServerPacket(SMSG_STOP_MIRROR_TIMER, 1) { }
explicit StopMirrorTimer(uint8 timer) : ServerPacket(SMSG_STOP_MIRROR_TIMER, 1), Timer(timer) { }
WorldPacket const* Write() override;
uint8 Timer = 0;
};
class ExplorationExperience final : public ServerPacket
{
public:
explicit ExplorationExperience() : ServerPacket(SMSG_EXPLORATION_EXPERIENCE, 8) { }
explicit ExplorationExperience(int32 experience, int32 areaID) : ServerPacket(SMSG_EXPLORATION_EXPERIENCE, 8),
Experience(experience), AreaID(areaID) { }
WorldPacket const* Write() override;
int32 Experience = 0;
int32 AreaID = 0;
};
class LevelUpInfo final : public ServerPacket
{
public:
explicit LevelUpInfo() : ServerPacket(SMSG_LEVEL_UP_INFO, 60) { }
WorldPacket const* Write() override;
int32 Level = 0;
int32 HealthDelta = 0;
std::array<int32, MAX_POWERS_PER_CLASS> PowerDelta = { };
std::array<int32, MAX_STATS> StatDelta = { };
int32 NumNewTalents = 0;
int32 NumNewPvpTalentSlots = 0;
};
class PlayMusic final : public ServerPacket
{
public:
explicit PlayMusic() : ServerPacket(SMSG_PLAY_MUSIC, 4) { }
explicit PlayMusic(uint32 soundKitID) : ServerPacket(SMSG_PLAY_MUSIC, 4), SoundKitID(soundKitID) { }
WorldPacket const* Write() override;
uint32 SoundKitID = 0;
};
class RandomRollClient final : public ClientPacket
{
public:
explicit RandomRollClient(WorldPacket&& packet) : ClientPacket(CMSG_RANDOM_ROLL, std::move(packet)) { }
void Read() override;
int32 Min = 0;
int32 Max = 0;
Optional<uint8> PartyIndex;
};
class RandomRoll final : public ServerPacket
{
public:
explicit RandomRoll() : ServerPacket(SMSG_RANDOM_ROLL, 16 + 16 + 4 + 4 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Roller;
ObjectGuid RollerWowAccount;
int32 Min = 0;
int32 Max = 0;
int32 Result = 0;
};
class EnableBarberShop final : public ServerPacket
{
public:
explicit EnableBarberShop() : ServerPacket(SMSG_ENABLE_BARBER_SHOP, 1) { }
WorldPacket const* Write() override;
uint32 CustomizationFeatureMask = 0;
};
struct PhaseShiftDataPhase
{
uint32 PhaseFlags = 0;
uint16 Id = 0;
};
struct PhaseShiftData
{
uint32 PhaseShiftFlags = 0;
std::vector<PhaseShiftDataPhase> Phases;
ObjectGuid PersonalGUID;
};
class PhaseShiftChange final : public ServerPacket
{
public:
explicit PhaseShiftChange() : ServerPacket(SMSG_PHASE_SHIFT_CHANGE, 16 + 4 + 4 + 16 + 4 + 4 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Client;
PhaseShiftData Phaseshift;
std::vector<uint16> PreloadMapIDs;
std::vector<uint16> UiMapPhaseIDs;
std::vector<uint16> VisibleMapIDs;
};
class ZoneUnderAttack final : public ServerPacket
{
public:
explicit ZoneUnderAttack() : ServerPacket(SMSG_ZONE_UNDER_ATTACK, 4) { }
WorldPacket const* Write() override;
int32 AreaID = 0;
};
class DurabilityDamageDeath final : public ServerPacket
{
public:
explicit DurabilityDamageDeath() : ServerPacket(SMSG_DURABILITY_DAMAGE_DEATH, 4) { }
WorldPacket const* Write() override;
int32 Percent = 0;
};
class ObjectUpdateFailed final : public ClientPacket
{
public:
explicit ObjectUpdateFailed(WorldPacket&& packet) : ClientPacket(CMSG_OBJECT_UPDATE_FAILED, std::move(packet)) { }
void Read() override;
ObjectGuid ObjectGUID;
};
class ObjectUpdateRescued final : public ClientPacket
{
public:
explicit ObjectUpdateRescued(WorldPacket&& packet) : ClientPacket(CMSG_OBJECT_UPDATE_RESCUED, std::move(packet)) { }
void Read() override;
ObjectGuid ObjectGUID;
};
class PlayObjectSound final : public ServerPacket
{
public:
explicit PlayObjectSound() : ServerPacket(SMSG_PLAY_OBJECT_SOUND, 16 + 16 + 4 + 4 * 3 + 4) { }
explicit PlayObjectSound(ObjectGuid targetObjectGUID, ObjectGuid sourceObjectGUID, int32 soundKitID, TaggedPosition<::Position::XYZ> position, int32 broadcastTextID)
: ServerPacket(SMSG_PLAY_OBJECT_SOUND, 16 + 16 + 4 + 4 * 3),
TargetObjectGUID(targetObjectGUID), SourceObjectGUID(sourceObjectGUID), SoundKitID(soundKitID), Position(position),
BroadcastTextID(broadcastTextID) { }
WorldPacket const* Write() override;
ObjectGuid TargetObjectGUID;
ObjectGuid SourceObjectGUID;
int32 SoundKitID = 0;
TaggedPosition<::Position::XYZ> Position;
int32 BroadcastTextID = 0;
};
class TC_GAME_API PlaySound final : public ServerPacket
{
public:
explicit PlaySound() : ServerPacket(SMSG_PLAY_SOUND, 16 + 4 + 4) { }
explicit PlaySound(ObjectGuid sourceObjectGuid, int32 soundKitID, int32 broadcastTextId) : ServerPacket(SMSG_PLAY_SOUND, 16 + 4 + 4),
SourceObjectGuid(sourceObjectGuid), SoundKitID(soundKitID), BroadcastTextID(broadcastTextId) { }
WorldPacket const* Write() override;
ObjectGuid SourceObjectGuid;
int32 SoundKitID = 0;
int32 BroadcastTextID = 0;
};
class PlaySpeakerbotSound final : public ServerPacket
{
public:
explicit PlaySpeakerbotSound(ObjectGuid const& sourceObjectGUID, int32 soundKitID)
: ServerPacket(SMSG_PLAY_SPEAKERBOT_SOUND, 20), SourceObjectGUID(sourceObjectGUID), SoundKitID(soundKitID) { }
WorldPacket const* Write() override;
ObjectGuid SourceObjectGUID;
int32 SoundKitID = 0;
};
class StopSpeakerbotSound final : public ServerPacket
{
public:
explicit StopSpeakerbotSound(ObjectGuid const& sourceObjectGUID)
: ServerPacket(SMSG_STOP_SPEAKERBOT_SOUND, 16), SourceObjectGUID(sourceObjectGUID) { }
WorldPacket const* Write() override;
ObjectGuid SourceObjectGUID;
};
class CompleteCinematic final : public ClientPacket
{
public:
explicit CompleteCinematic(WorldPacket&& packet) : ClientPacket(CMSG_COMPLETE_CINEMATIC, std::move(packet)) { }
void Read() override { }
};
class NextCinematicCamera final : public ClientPacket
{
public:
explicit NextCinematicCamera(WorldPacket&& packet) : ClientPacket(CMSG_NEXT_CINEMATIC_CAMERA, std::move(packet)) { }
void Read() override { }
};
class CompleteMovie final : public ClientPacket
{
public:
explicit CompleteMovie(WorldPacket&& packet) : ClientPacket(CMSG_COMPLETE_MOVIE, std::move(packet)) { }
void Read() override { }
};
class FarSight final : public ClientPacket
{
public:
explicit FarSight(WorldPacket&& packet) : ClientPacket(CMSG_FAR_SIGHT, std::move(packet)) { }
void Read() override;
bool Enable = false;
};
class SaveCUFProfiles final : public ClientPacket
{
public:
explicit SaveCUFProfiles(WorldPacket&& packet) : ClientPacket(CMSG_SAVE_CUF_PROFILES, std::move(packet)) { }
void Read() override;
Array<std::unique_ptr<CUFProfile>, MAX_CUF_PROFILES> CUFProfiles;
};
class LoadCUFProfiles final : public ServerPacket
{
public:
explicit LoadCUFProfiles() : ServerPacket(SMSG_LOAD_CUF_PROFILES, 20) { }
WorldPacket const* Write() override;
std::vector<CUFProfile const*> CUFProfiles;
};
class PlayOneShotAnimKit final : public ServerPacket
{
public:
explicit PlayOneShotAnimKit() : ServerPacket(SMSG_PLAY_ONE_SHOT_ANIM_KIT, 7 + 2) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
uint16 AnimKitID = 0;
};
class SetAIAnimKit final : public ServerPacket
{
public:
explicit SetAIAnimKit() : ServerPacket(SMSG_SET_AI_ANIM_KIT, 16 + 2) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
uint16 AnimKitID = 0;
};
class SetMovementAnimKit final : public ServerPacket
{
public:
explicit SetMovementAnimKit() : ServerPacket(SMSG_SET_MOVEMENT_ANIM_KIT, 16 + 2) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
uint16 AnimKitID = 0;
};
class SetMeleeAnimKit final : public ServerPacket
{
public:
explicit SetMeleeAnimKit() : ServerPacket(SMSG_SET_MELEE_ANIM_KIT, 16 + 2) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
uint16 AnimKitID = 0;
};
class SetPlayHoverAnim final : public ServerPacket
{
public:
explicit SetPlayHoverAnim() : ServerPacket(SMSG_SET_PLAY_HOVER_ANIM, 16 + 1) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
bool PlayHoverAnim = false;
};
class OpeningCinematic final : public ClientPacket
{
public:
explicit OpeningCinematic(WorldPacket&& packet) : ClientPacket(CMSG_OPENING_CINEMATIC, std::move(packet)) { }
void Read() override { }
};
class TogglePvP final : public ClientPacket
{
public:
explicit TogglePvP(WorldPacket&& packet) : ClientPacket(CMSG_TOGGLE_PVP, std::move(packet)) { }
void Read() override { }
};
class SetPvP final : public ClientPacket
{
public:
explicit SetPvP(WorldPacket&& packet) : ClientPacket(CMSG_SET_PVP, std::move(packet)) { }
void Read() override;
bool EnablePVP = false;
};
class SetWarMode final : public ClientPacket
{
public:
explicit SetWarMode(WorldPacket&& packet) : ClientPacket(CMSG_SET_WAR_MODE, std::move(packet)) { }
void Read() override;
bool Enable = false;
};
class AccountHeirloomUpdate final : public ServerPacket
{
public:
explicit AccountHeirloomUpdate() : ServerPacket(SMSG_ACCOUNT_HEIRLOOM_UPDATE) { }
WorldPacket const* Write() override;
bool IsFullUpdate = false;
std::map<uint32, HeirloomData> const* Heirlooms = nullptr;
int32 ItemCollectionType = 0;
};
class MountSpecial final : public ClientPacket
{
public:
explicit MountSpecial(WorldPacket&& packet) : ClientPacket(CMSG_MOUNT_SPECIAL_ANIM, std::move(packet)) { }
void Read() override;
Array<int32, 2> SpellVisualKitIDs;
int32 SequenceVariation = 0;
};
class SpecialMountAnim final : public ServerPacket
{
public:
explicit SpecialMountAnim() : ServerPacket(SMSG_SPECIAL_MOUNT_ANIM, 16) { }
WorldPacket const* Write() override;
ObjectGuid UnitGUID;
std::vector<int32> SpellVisualKitIDs;
int32 SequenceVariation = 0;
};
class CrossedInebriationThreshold final : public ServerPacket
{
public:
explicit CrossedInebriationThreshold() : ServerPacket(SMSG_CROSSED_INEBRIATION_THRESHOLD, 16 + 4 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Guid;
int32 ItemID = 0;
int32 Threshold = 0;
};
class SetTaxiBenchmarkMode final : public ClientPacket
{
public:
explicit SetTaxiBenchmarkMode(WorldPacket&& packet) : ClientPacket(CMSG_SET_TAXI_BENCHMARK_MODE, std::move(packet)) { }
void Read() override;
bool Enable = false;
};
class OverrideLight final : public ServerPacket
{
public:
explicit OverrideLight() : ServerPacket(SMSG_OVERRIDE_LIGHT, 4 + 4 + 4) { }
WorldPacket const* Write() override;
int32 AreaLightID = 0;
int32 TransitionMilliseconds = 0;
int32 OverrideLightID = 0;
};
class TC_GAME_API DisplayGameError final : public ServerPacket
{
public:
explicit DisplayGameError(GameError error) : ServerPacket(SMSG_DISPLAY_GAME_ERROR, 4 + 1), Error(error) { }
explicit DisplayGameError(GameError error, int32 arg) : ServerPacket(SMSG_DISPLAY_GAME_ERROR, 4 + 1 + 4), Error(error), Arg(arg) { }
explicit DisplayGameError(GameError error, int32 arg1, int32 arg2) : ServerPacket(SMSG_DISPLAY_GAME_ERROR, 4 + 1 + 4 + 4), Error(error), Arg(arg1), Arg2(arg2) { }
WorldPacket const* Write() override;
GameError Error;
Optional<int32> Arg;
Optional<int32> Arg2;
};
class AccountMountUpdate final : public ServerPacket
{
public:
explicit AccountMountUpdate() : ServerPacket(SMSG_ACCOUNT_MOUNT_UPDATE) { }
WorldPacket const* Write() override;
bool IsFullUpdate = false;
MountContainer const* Mounts = nullptr;
};
class MountSetFavorite final : public ClientPacket
{
public:
explicit MountSetFavorite(WorldPacket&& packet) : ClientPacket(CMSG_MOUNT_SET_FAVORITE, std::move(packet)) { }
void Read() override;
uint32 MountSpellID = 0;
bool IsFavorite = false;
};
class CloseInteraction final : public ClientPacket
{
public:
explicit CloseInteraction(WorldPacket&& packet) : ClientPacket(CMSG_CLOSE_INTERACTION, std::move(packet)) { }
void Read() override;
ObjectGuid SourceGuid;
};
class StartTimer final : public ServerPacket
{
public:
explicit StartTimer() : ServerPacket(SMSG_START_TIMER, 8 + 4 + 8 + 1 + 16) { }
WorldPacket const* Write() override;
Duration<Seconds> TotalTime;
Duration<Seconds> TimeLeft;
CountdownTimerType Type = {};
Optional<ObjectGuid> PlayerGuid;
};
class QueryCountdownTimer final : public ClientPacket
{
public:
explicit QueryCountdownTimer(WorldPacket&& packet) : ClientPacket(CMSG_QUERY_COUNTDOWN_TIMER, std::move(packet)) { }
void Read() override;
CountdownTimerType TimerType = {};
};
class ConversationLineStarted final : public ClientPacket
{
public:
explicit ConversationLineStarted(WorldPacket&& packet) : ClientPacket(CMSG_CONVERSATION_LINE_STARTED, std::move(packet)) { }
void Read() override;
ObjectGuid ConversationGUID;
uint32 LineID = 0;
};
class RequestLatestSplashScreen final : public ClientPacket
{
public:
explicit RequestLatestSplashScreen(WorldPacket&& packet) : ClientPacket(CMSG_REQUEST_LATEST_SPLASH_SCREEN, std::move(packet)) { }
void Read() override { }
};
class SplashScreenShowLatest final : public ServerPacket
{
public:
explicit SplashScreenShowLatest() : ServerPacket(SMSG_SPLASH_SCREEN_SHOW_LATEST, 4) { }
WorldPacket const* Write() override;
int32 UISplashScreenID = 0;
};
class DisplayToast final : public ServerPacket
{
public:
explicit DisplayToast() : ServerPacket(SMSG_DISPLAY_TOAST) { }
WorldPacket const* Write() override;
uint64 Quantity = 0;
uint32 QuestID = 0;
::DisplayToastMethod DisplayToastMethod = { };
bool Mailed = false;
DisplayToastType Type = { };
bool IsSecondaryResult = false;
Item::ItemInstance Item;
int32 LootSpec = 0;
::Gender Gender = GENDER_NONE;
bool BonusRoll = false;
bool ForceToast = false; ///< Ignores ITEM_FLAG3_DO_NOT_TOAST
uint32 CurrencyID = 0;
};
class AccountWarbandSceneUpdate final : public ServerPacket
{
public:
explicit AccountWarbandSceneUpdate() : ServerPacket(SMSG_ACCOUNT_WARBAND_SCENE_UPDATE) { }
WorldPacket const* Write() override;
bool IsFullUpdate = false;
WarbandSceneCollectionContainer const* WarbandScenes = nullptr;
};
}
}
#endif // TRINITYCORE_MISC_PACKETS_H
|