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
|
/*
* 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_QUEST_PACKETS_H
#define TRINITYCORE_QUEST_PACKETS_H
#include "Packet.h"
#include "ItemPacketsCommon.h"
#include "LootItemType.h"
#include "NPCPackets.h"
#include "ObjectGuid.h"
#include "QuestDef.h"
#include "RaceMask.h"
#include <array>
namespace WorldPackets
{
namespace Quest
{
class QuestGiverStatusQuery final : public ClientPacket
{
public:
explicit QuestGiverStatusQuery(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_STATUS_QUERY, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID;
};
// Empty packet, server replies with quest giver status of visible creatures
class QuestGiverStatusMultipleQuery final : public ClientPacket
{
public:
explicit QuestGiverStatusMultipleQuery(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_STATUS_MULTIPLE_QUERY, std::move(packet)) { }
void Read() override { }
};
struct QuestGiverInfo
{
QuestGiverInfo() { }
QuestGiverInfo(ObjectGuid const& guid, ::QuestGiverStatus status)
: Guid(guid), Status(status) { }
ObjectGuid Guid;
::QuestGiverStatus Status = ::QuestGiverStatus::None;
};
class QuestGiverStatus final : public ServerPacket
{
public:
explicit QuestGiverStatus() : ServerPacket(SMSG_QUEST_GIVER_STATUS, 22) { }
WorldPacket const* Write() override;
QuestGiverInfo QuestGiver;
};
class QuestGiverStatusMultiple final : public ServerPacket
{
public:
explicit QuestGiverStatusMultiple() : ServerPacket(SMSG_QUEST_GIVER_STATUS_MULTIPLE, 24) { }
WorldPacket const* Write() override;
std::vector<QuestGiverInfo> QuestGiver;
};
class QuestGiverHello final : public ClientPacket
{
public:
explicit QuestGiverHello(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_HELLO, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID;
};
class QueryQuestInfo final : public ClientPacket
{
public:
explicit QueryQuestInfo(WorldPacket&& packet) : ClientPacket(CMSG_QUERY_QUEST_INFO, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiver;
int32 QuestID = 0;
};
struct QuestInfoChoiceItem
{
int32 ItemID = 0;
int32 Quantity = 0;
int32 DisplayID = 0;
};
struct QuestCompleteDisplaySpell
{
int32 SpellID = 0;
int32 PlayerConditionID = 0;
int32 Type = 0;
};
struct ConditionalQuestText
{
int32 PlayerConditionID = 0;
int32 QuestGiverCreatureID = 0;
std::string_view Text;
};
struct QuestInfo
{
int32 QuestID = 0;
int32 QuestType = 0; // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
int32 ContentTuningID = 0;
int32 QuestPackageID = 0;
int32 QuestSortID = 0; // zone or sort to display in quest log
int32 QuestInfoID = 0;
int32 SuggestedGroupNum = 0;
int32 RewardNextQuest = 0; // client will request this quest from NPC, if not 0
int32 RewardXPDifficulty = 0; // used for calculating rewarded experience
float RewardXPMultiplier = 1.0f;
int32 RewardMoney = 0; // reward money (below max lvl)
int32 RewardMoneyDifficulty = 0;
float RewardMoneyMultiplier = 1.0f;
int32 RewardBonusMoney = 0;
std::vector<QuestCompleteDisplaySpell> RewardDisplaySpell; // reward spell, this spell will be displayed (icon)
int32 RewardSpell = 0;
int32 RewardHonor = 0;
float RewardKillHonor = 0.0f;
int32 RewardArtifactXPDifficulty = 0;
float RewardArtifactXPMultiplier = 0.0f;
int32 RewardArtifactCategoryID = 0;
int32 StartItem = 0;
uint32 Flags = 0;
uint32 FlagsEx = 0;
uint32 FlagsEx2 = 0;
uint32 FlagsEx3 = 0;
int32 POIContinent = 0;
float POIx = 0.0f;
float POIy = 0.0f;
int32 POIPriority = 0;
Trinity::RaceMask<uint64> AllowableRaces = { UI64LIT(0xFFFFFFFFFFFFFFFF) };
std::string LogTitle;
std::string LogDescription;
std::string QuestDescription;
std::string AreaDescription;
int32 RewardTitle = 0; // new 2.4.0, player gets this title (id from CharTitles)
int32 RewardArenaPoints = 0;
int32 RewardSkillLineID = 0; // reward skill id
int32 RewardNumSkillUps = 0; // reward skill points
int32 PortraitGiver = 0; // quest giver entry ?
int32 PortraitGiverMount = 0;
int32 PortraitGiverModelSceneID = 0;
int32 PortraitTurnIn = 0; // quest turn in entry ?
std::string PortraitGiverText;
std::string PortraitGiverName;
std::string PortraitTurnInText;
std::string PortraitTurnInName;
std::string QuestCompletionLog;
int32 RewardFactionFlags = 0; // rep mask (unsure on what it does)
int32 AcceptedSoundKitID = 0;
int32 CompleteSoundKitID = 0;
int32 AreaGroupID = 0;
int64 TimeAllowed = 0;
std::span<int32 const> TreasurePickerID;
std::span<int32 const> TreasurePickerID2; // unknown purpose, used only sometimes and only if TreasurePickerID is empty
int32 Expansion = 0;
int32 ManagedWorldStateID = 0;
int32 QuestSessionBonus = 0;
int32 QuestGiverCreatureID = 0; // used to select ConditionalQuestText
std::vector<QuestObjective> Objectives;
std::vector<ConditionalQuestText> ConditionalQuestDescription;
std::vector<ConditionalQuestText> ConditionalQuestCompletionLog;
std::span<int32 const> RewardHouseRoomIDs;
std::span<int32 const> RewardHouseDecorIDs;
int32 RewardItems[QUEST_REWARD_ITEM_COUNT] = { };
int32 RewardAmount[QUEST_REWARD_ITEM_COUNT] = { };
int32 ItemDrop[QUEST_ITEM_DROP_COUNT] = { };
int32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT] = { };
QuestInfoChoiceItem UnfilteredChoiceItems[QUEST_REWARD_CHOICES_COUNT];
int32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT] = { };
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = { };
int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = { };
int32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = { };
int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT] = { };
int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = { };
bool ReadyForTranslation = false;
bool ResetByScheduler = false;
};
class QueryQuestInfoResponse final : public ServerPacket
{
public:
explicit QueryQuestInfoResponse() : ServerPacket(SMSG_QUERY_QUEST_INFO_RESPONSE, 1200) { }
WorldPacket const* Write() override;
bool Allow = false;
QuestInfo Info;
uint32 QuestID = 0;
};
class QuestUpdateAddCredit final : public ServerPacket
{
public:
explicit QuestUpdateAddCredit() : ServerPacket(SMSG_QUEST_UPDATE_ADD_CREDIT, 16 + 4 + 4 + 2 + 2 + 1) { }
WorldPacket const* Write() override;
ObjectGuid VictimGUID;
int32 ObjectID = 0;
int32 QuestID = 0;
uint16 Count = 0;
uint16 Required = 0;
uint32 ObjectiveType = 0;
};
class QuestUpdateAddCreditSimple final : public ServerPacket
{
public:
explicit QuestUpdateAddCreditSimple() : ServerPacket(SMSG_QUEST_UPDATE_ADD_CREDIT_SIMPLE, 4 + 4 + 1) { }
WorldPacket const* Write() override;
int32 QuestID = 0;
int32 ObjectID = 0;
uint32 ObjectiveType = 0;
};
class QuestUpdateAddPvPCredit final : public ServerPacket
{
public:
explicit QuestUpdateAddPvPCredit() : ServerPacket(SMSG_QUEST_UPDATE_ADD_PVP_CREDIT, 4 + 2) { }
WorldPacket const* Write() override;
int32 QuestID = 0;
uint16 Count = 0;
};
struct QuestRewardItem
{
int32 ItemID = 0;
int32 ItemQty = 0;
Optional<QuestRewardContextFlags> ContextFlags;
};
struct QuestChoiceItem
{
::LootItemType LootItemType = ::LootItemType::Item;
Item::ItemInstance Item;
int32 Quantity = 0;
Optional<QuestRewardContextFlags> ContextFlags;
};
struct QuestRewardCurrency
{
int32 CurrencyID = 0;
int32 CurrencyQty = 0;
int32 BonusQty = 0;
Optional<QuestRewardContextFlags> ContextFlags;
};
struct QuestRewards
{
int32 ChoiceItemCount = 0;
int32 ItemCount = 0;
int32 Money = 0;
int32 XP = 0;
int32 ArtifactXP = 0;
int32 ArtifactCategoryID = 0;
int32 Honor = 0;
int32 Title = 0;
int32 FactionFlags = 0;
std::array<int32, QUEST_REWARD_DISPLAY_SPELL_COUNT> SpellCompletionDisplayID = { };
int32 SpellCompletionID = 0;
int32 SkillLineID = 0;
int32 NumSkillUps = 0;
std::span<int32 const> TreasurePickerID;
std::array<QuestChoiceItem, QUEST_REWARD_CHOICES_COUNT> ChoiceItems = { };
std::array<QuestRewardItem, QUEST_REWARD_ITEM_COUNT> Items = { };
std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionID = { };
std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionValue = { };
std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionOverride = { };
std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionCapIn = { };
std::array<QuestRewardCurrency, QUEST_REWARD_CURRENCY_COUNT> Currencies = { };
bool IsBoostSpell = false;
};
struct QuestDescEmote
{
QuestDescEmote(int32 type = 0, uint32 delay = 0) : Type(type), Delay(delay) {}
int32 Type;
uint32 Delay;
};
struct QuestGiverOfferReward
{
ObjectGuid QuestGiverGUID;
int32 QuestGiverCreatureID = 0;
int32 QuestID = 0;
bool AutoLaunched = false;
bool ResetByScheduler = false;
int32 SuggestedPartyMembers = 0;
QuestRewards Rewards;
std::vector<QuestDescEmote> Emotes;
std::array<int32, 4> QuestFlags = { };
int32 QuestInfoID = 0;
};
class QuestGiverOfferRewardMessage final : public ServerPacket
{
public:
explicit QuestGiverOfferRewardMessage() : ServerPacket(SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE, 600) { }
WorldPacket const* Write() override;
int32 PortraitTurnIn = 0;
int32 PortraitGiver = 0;
int32 PortraitGiverMount = 0;
int32 PortraitGiverModelSceneID = 0;
int32 QuestGiverCreatureID = 0;
std::string_view QuestTitle;
std::string_view RewardText;
std::string_view PortraitGiverText;
std::string_view PortraitGiverName;
std::string_view PortraitTurnInText;
std::string_view PortraitTurnInName;
std::vector<ConditionalQuestText> ConditionalRewardText;
QuestGiverOfferReward QuestData;
int32 QuestPackageID = 0;
};
class QuestGiverChooseReward final : public ClientPacket
{
public:
explicit QuestGiverChooseReward(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_CHOOSE_REWARD, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID;
int32 QuestID = 0;
QuestChoiceItem Choice;
};
class QuestGiverQuestComplete final : public ServerPacket
{
public:
explicit QuestGiverQuestComplete() : ServerPacket(SMSG_QUEST_GIVER_QUEST_COMPLETE, 40) { }
WorldPacket const* Write() override;
int32 QuestID = 0;
int32 XPReward = 0;
int64 MoneyReward = 0;
int32 SkillLineIDReward = 0;
int32 NumSkillUpsReward = 0;
bool UseQuestReward = false;
bool LaunchGossip = false;
bool LaunchQuest = false;
bool HideChatMessage = false;
WorldPackets::Item::ItemInstance ItemReward;
};
class QuestGiverCompleteQuest final : public ClientPacket
{
public:
explicit QuestGiverCompleteQuest(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_COMPLETE_QUEST, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID; // NPC / GameObject guid for normal quest completion. Player guid for self-completed quests
int32 QuestID = 0;
bool FromScript = false; // 0 - standart complete quest mode with npc, 1 - auto-complete mode
};
class QuestGiverCloseQuest final : public ClientPacket
{
public:
explicit QuestGiverCloseQuest(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_CLOSE_QUEST, std::move(packet)) { }
void Read() override;
int32 QuestID = 0;
};
struct QuestObjectiveSimple
{
int32 ID = 0;
int32 Type = 0;
int32 ObjectID = 0;
int32 Amount = 0;
};
class QuestGiverQuestDetails final : public ServerPacket
{
public:
explicit QuestGiverQuestDetails() : ServerPacket(SMSG_QUEST_GIVER_QUEST_DETAILS, 1000) { }
WorldPacket const* Write() override;
ObjectGuid QuestGiverGUID;
ObjectGuid InformUnit;
int32 QuestID = 0;
int32 QuestPackageID = 0;
std::array<uint32, 4> QuestFlags = { };
int32 SuggestedPartyMembers = 0;
QuestRewards Rewards;
std::vector<QuestObjectiveSimple> Objectives;
std::vector<QuestDescEmote> DescEmotes;
std::vector<int32> LearnSpells;
int32 PortraitTurnIn = 0;
int32 PortraitGiver = 0;
int32 PortraitGiverMount = 0;
int32 PortraitGiverModelSceneID = 0;
int32 QuestStartItemID = 0;
int32 QuestInfoID = 0;
int32 QuestSessionBonus = 0;
int32 QuestGiverCreatureID = 0;
std::string_view PortraitGiverText;
std::string_view PortraitGiverName;
std::string_view PortraitTurnInText;
std::string_view PortraitTurnInName;
std::string_view QuestTitle;
std::string_view LogDescription;
std::string_view DescriptionText;
std::vector<ConditionalQuestText> ConditionalDescriptionText;
bool DisplayPopup = false;
bool StartCheat = false;
bool AutoLaunched = false;
bool FromContentPush = false;
bool ResetByScheduler = false;
};
struct QuestObjectiveCollect
{
QuestObjectiveCollect(int32 objectID = 0, int32 amount = 0, uint32 flags = 0) : ObjectID(objectID), Amount(amount), Flags(flags) { }
int32 ObjectID;
int32 Amount;
uint32 Flags;
};
struct QuestCurrency
{
QuestCurrency(int32 currencyID = 0, int32 amount = 0) : CurrencyID(currencyID), Amount(amount) { }
int32 CurrencyID;
int32 Amount;
};
class QuestGiverRequestItems final : public ServerPacket
{
public:
explicit QuestGiverRequestItems() : ServerPacket(SMSG_QUEST_GIVER_REQUEST_ITEMS, 300) { }
WorldPacket const* Write() override;
ObjectGuid QuestGiverGUID;
int32 QuestGiverCreatureID = 0;
int32 QuestID = 0;
int32 CompEmoteDelay = 0;
int32 CompEmoteType = 0;
bool AutoLaunched = false;
bool ResetByScheduler = false;
int32 SuggestPartyMembers = 0;
int32 MoneyToGet = 0;
std::vector<QuestObjectiveCollect> Collect;
std::vector<QuestCurrency> Currency;
int32 StatusFlags = 0;
int32 QuestInfoID = 0;
std::array<uint32, 4> QuestFlags = { };
std::string_view QuestTitle;
std::string_view CompletionText;
std::vector<ConditionalQuestText> ConditionalCompletionText;
};
class QuestGiverRequestReward final : public ClientPacket
{
public:
explicit QuestGiverRequestReward(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_REQUEST_REWARD, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID;
int32 QuestID = 0;
};
class QuestGiverQueryQuest final : public ClientPacket
{
public:
explicit QuestGiverQueryQuest(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_QUERY_QUEST, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID;
int32 QuestID = 0;
bool RespondToGiver = false;
};
class QuestGiverAcceptQuest final : public ClientPacket
{
public:
explicit QuestGiverAcceptQuest(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_ACCEPT_QUEST, std::move(packet)) { }
void Read() override;
ObjectGuid QuestGiverGUID;
int32 QuestID = 0;
bool StartCheat = false;
};
class QuestLogRemoveQuest final : public ClientPacket
{
public:
explicit QuestLogRemoveQuest(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_LOG_REMOVE_QUEST, std::move(packet)) { }
void Read() override;
uint8 Entry = 0;
};
class QuestGiverQuestListMessage final : public ServerPacket
{
public:
explicit QuestGiverQuestListMessage() : ServerPacket(SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE, 100) { }
WorldPacket const* Write() override;
ObjectGuid QuestGiverGUID;
uint32 GreetEmoteDelay = 0;
uint32 GreetEmoteType = 0;
std::vector<NPC::ClientGossipText> QuestDataText;
std::string_view Greeting;
};
class QuestUpdateComplete final : public ServerPacket
{
public:
explicit QuestUpdateComplete() : ServerPacket(SMSG_QUEST_UPDATE_COMPLETE, 4) { }
WorldPacket const* Write() override;
int32 QuestID = 0;
};
class QuestConfirmAcceptResponse final : public ServerPacket
{
public:
explicit QuestConfirmAcceptResponse() : ServerPacket(SMSG_QUEST_CONFIRM_ACCEPT, 21) { }
WorldPacket const* Write() override;
ObjectGuid InitiatedBy;
int32 QuestID = 0;
std::string QuestTitle;
};
class QuestConfirmAccept final : public ClientPacket
{
public:
explicit QuestConfirmAccept(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_CONFIRM_ACCEPT, std::move(packet)) { }
void Read() override;
int32 QuestID = 0;
};
class QuestPushResultResponse final : public ServerPacket
{
public:
explicit QuestPushResultResponse() : ServerPacket(SMSG_QUEST_PUSH_RESULT, 16 + 1) { }
WorldPacket const* Write() override;
ObjectGuid SenderGUID;
uint32 Result = 0;
std::string_view QuestTitle;
};
class QuestLogFull final : public ServerPacket
{
public:
explicit QuestLogFull() : ServerPacket(SMSG_QUEST_LOG_FULL, 0) { }
WorldPacket const* Write() override { return &_worldPacket; }
};
class QuestPushResult final : public ClientPacket
{
public:
explicit QuestPushResult(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_PUSH_RESULT, std::move(packet)) { }
void Read() override;
ObjectGuid SenderGUID;
uint32 QuestID = 0;
uint32 Result = 0;
};
class QuestGiverInvalidQuest final : public ServerPacket
{
public:
explicit QuestGiverInvalidQuest() : ServerPacket(SMSG_QUEST_GIVER_INVALID_QUEST, 6) { }
WorldPacket const* Write() override;
uint32 Reason = 0;
int32 ContributionRewardID = 0;
bool SendErrorMessage = false;
std::string ReasonText;
};
class QuestUpdateFailedTimer final : public ServerPacket
{
public:
explicit QuestUpdateFailedTimer() : ServerPacket(SMSG_QUEST_UPDATE_FAILED_TIMER, 4) { }
WorldPacket const* Write() override;
uint32 QuestID = 0;
};
class QuestGiverQuestFailed final : public ServerPacket
{
public:
explicit QuestGiverQuestFailed() : ServerPacket(SMSG_QUEST_GIVER_QUEST_FAILED, 8) { }
WorldPacket const* Write() override;
uint32 QuestID = 0;
uint32 Reason = 0;
};
class PushQuestToParty final : public ClientPacket
{
public:
explicit PushQuestToParty(WorldPacket&& packet) : ClientPacket(CMSG_PUSH_QUEST_TO_PARTY, std::move(packet)) { }
void Read() override;
uint32 QuestID = 0;
};
class DailyQuestsReset final : public ServerPacket
{
public:
explicit DailyQuestsReset() : ServerPacket(SMSG_DAILY_QUESTS_RESET, 4) { }
WorldPacket const* Write() override;
int32 Count = 0;
};
class QuestForceRemoved final : public ServerPacket
{
public:
explicit QuestForceRemoved(int32 questId) : ServerPacket(SMSG_QUEST_FORCE_REMOVED, 4), QuestID(questId) { }
WorldPacket const* Write() override;
int32 QuestID = 0;
};
class RequestWorldQuestUpdate final : public ClientPacket
{
public:
explicit RequestWorldQuestUpdate(WorldPacket&& packet) : ClientPacket(CMSG_REQUEST_WORLD_QUEST_UPDATE, std::move(packet)) { }
void Read() override { }
};
struct WorldQuestUpdateInfo
{
WorldQuestUpdateInfo(time_t lastUpdate, uint32 questID, uint32 timer, int32 variableID, int32 value) :
LastUpdate(lastUpdate), QuestID(questID), Timer(timer), VariableID(variableID), Value(value) { }
Timestamp<> LastUpdate;
uint32 QuestID;
uint32 Timer;
// WorldState
int32 VariableID;
int32 Value;
};
class WorldQuestUpdateResponse final : public ServerPacket
{
public:
explicit WorldQuestUpdateResponse() : ServerPacket(SMSG_WORLD_QUEST_UPDATE_RESPONSE, 100) { }
WorldPacket const* Write() override;
std::vector<WorldQuestUpdateInfo> WorldQuestUpdates;
};
struct PlayerChoiceResponseRewardEntry
{
WorldPackets::Item::ItemInstance Item;
int32 Quantity = 0;
};
struct PlayerChoiceResponseReward
{
int32 TitleID = 0;
int32 PackageID = 0;
int32 SkillLineID = 0;
uint32 SkillPointCount = 0;
uint32 ArenaPointCount = 0;
uint32 HonorPointCount = 0;
uint64 Money = 0;
uint32 Xp = 0;
std::vector<PlayerChoiceResponseRewardEntry> Items;
std::vector<PlayerChoiceResponseRewardEntry> Currencies;
std::vector<PlayerChoiceResponseRewardEntry> Factions;
std::vector<PlayerChoiceResponseRewardEntry> ItemChoices;
};
struct PlayerChoiceResponseMawPower
{
int32 Unused901_1 = 0;
int32 TypeArtFileID = 0;
Optional<int32> Rarity;
int32 BorderUiTextureAtlasMemberID = 0;
int32 SpellID = 0;
int32 MaxStacks = 0;
};
struct PlayerChoiceResponse
{
int32 ResponseID = 0;
uint16 ResponseIdentifier = 0;
int32 ChoiceArtFileID = 0;
int32 Flags = 0;
uint32 WidgetSetID = 0;
uint32 UiTextureAtlasElementID = 0;
uint32 SoundKitID = 0;
uint8 GroupID = 0;
int32 UiTextureKitID = 0;
std::string_view Answer;
std::string_view Header;
std::string_view SubHeader;
std::string_view ButtonTooltip;
std::string_view Description;
std::string_view Confirmation;
Optional<PlayerChoiceResponseReward> Reward;
Optional<uint32> RewardQuestID;
Optional<PlayerChoiceResponseMawPower> MawPower;
};
class DisplayPlayerChoice final : public ServerPacket
{
public:
DisplayPlayerChoice() : ServerPacket(SMSG_DISPLAY_PLAYER_CHOICE) { }
WorldPacket const* Write() override;
ObjectGuid SenderGUID;
int32 ChoiceID = 0;
int32 UiTextureKitID = 0;
uint32 SoundKitID = 0;
uint32 CloseUISoundKitID = 0;
uint8 NumRerolls = 0;
WorldPackets::Timestamp<> ExpireTime;
std::string_view Question;
std::string_view PendingChoiceText;
std::vector<PlayerChoiceResponse> Responses;
bool InfiniteRange = false;
bool HideWarboardHeader = false;
bool KeepOpenAfterChoice = false;
bool ShowChoicesAsList = false;
bool ForceDontShowChoicesAsList = false;
};
class ChoiceResponse final : public ClientPacket
{
public:
explicit ChoiceResponse(WorldPacket&& packet) : ClientPacket(CMSG_CHOICE_RESPONSE, std::move(packet)) { }
void Read() override;
int32 ChoiceID = 0;
int32 ResponseIdentifier = 0;
bool IsReroll = false;
};
class UiMapQuestLinesResponse final : public ServerPacket
{
public:
explicit UiMapQuestLinesResponse() : ServerPacket(SMSG_UI_MAP_QUEST_LINES_RESPONSE, 4) { }
WorldPacket const* Write() override;
int32 UiMapID = 0;
std::vector<uint32> QuestLineXQuestIDs;
std::vector<uint32> QuestIDs;
std::vector<uint32> QuestLineIDs;
};
class UiMapQuestLinesRequest final : public ClientPacket
{
public:
explicit UiMapQuestLinesRequest(WorldPacket&& packet) : ClientPacket(CMSG_UI_MAP_QUEST_LINES_REQUEST, std::move(packet)) { }
void Read() override;
int32 UiMapID = 0;
};
struct SpawnTrackingRequestInfo
{
int32 ObjectTypeMask = 0;
int32 ObjectID = 0;
uint32 SpawnTrackingID = 0;
};
class SpawnTrackingUpdate final : public ClientPacket
{
public:
explicit SpawnTrackingUpdate(WorldPacket&& packet) : ClientPacket(CMSG_SPAWN_TRACKING_UPDATE, std::move(packet)) { }
void Read() override;
std::vector<SpawnTrackingRequestInfo> SpawnTrackingRequests;
};
struct SpawnTrackingResponseInfo
{
uint32 SpawnTrackingID = 0;
int32 ObjectID = 0;
int32 PhaseID = 0;
int32 PhaseGroupID = 0;
int32 PhaseUseFlags = 0;
bool Visible = true;
};
class QuestPOIUpdateResponse final : public ServerPacket
{
public:
explicit QuestPOIUpdateResponse() : ServerPacket(SMSG_QUEST_POI_UPDATE_RESPONSE, 21) { }
WorldPacket const* Write() override;
std::vector<SpawnTrackingResponseInfo> SpawnTrackingResponses;
};
class ForceSpawnTrackingUpdate final : public ServerPacket
{
public:
explicit ForceSpawnTrackingUpdate() : ServerPacket(SMSG_FORCE_SPAWN_TRACKING_UPDATE, 4) { }
WorldPacket const* Write() override;
int32 QuestID = 0;
};
}
}
#endif // TRINITYCORE_QUEST_PACKETS_H
|