TrinityCore
QuestPackets.h
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#ifndef QuestPackets_h__
19#define QuestPackets_h__
20
21#include "Packet.h"
22#include "ItemPacketsCommon.h"
23#include "LootItemType.h"
24#include "NPCPackets.h"
25#include "ObjectGuid.h"
26#include "QuestDef.h"
27#include <array>
28
29namespace WorldPackets
30{
31 namespace Quest
32 {
34 {
35 public:
37
38 void Read() override;
39
41 };
42
43 // Empty packet, server replies with quest giver status of visible creatures
45 {
46 public:
48
49 void Read() override { }
50 };
51
53 {
54 public:
56
57 void Read() override;
58
60 };
61
63 {
66 : Guid(guid), Status(status) { }
67
70 };
71
72 class QuestGiverStatus final : public ServerPacket
73 {
74 public:
76
77 WorldPacket const* Write() override;
78
80 };
81
83 {
84 public:
86
87 WorldPacket const* Write() override;
88
89 std::vector<QuestGiverInfo> QuestGiver;
90 };
91
92 class QuestGiverHello final : public ClientPacket
93 {
94 public:
96
97 void Read() override;
98
100 };
101
102 class QueryQuestInfo final : public ClientPacket
103 {
104 public:
106
107 void Read() override;
108
111 };
112
114 {
118 };
119
121 {
125 };
126
128 {
131 std::string_view Text;
132 };
133
135 {
137 int32 QuestType = 0; // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
140 int32 QuestSortID = 0; // zone or sort to display in quest log
143 int32 RewardNextQuest = 0; // client will request this quest from NPC, if not 0
144 int32 RewardXPDifficulty = 0; // used for calculating rewarded experience
145 float RewardXPMultiplier = 1.0f;
146 int32 RewardMoney = 0; // reward money (below max lvl)
150 std::vector<QuestCompleteDisplaySpell> RewardDisplaySpell; // reward spell, this spell will be displayed (icon)
153 float RewardKillHonor = 0.0f;
162 float POIx = 0.0f;
163 float POIy = 0.0f;
166 std::string LogTitle;
167 std::string LogDescription;
168 std::string QuestDescription;
169 std::string AreaDescription;
170 int32 RewardTitle = 0; // new 2.4.0, player gets this title (id from CharTitles)
172 int32 RewardSkillLineID = 0; // reward skill id
173 int32 RewardNumSkillUps = 0; // reward skill points
174 int32 PortraitGiver = 0; // quest giver entry ?
177 int32 PortraitTurnIn = 0; // quest turn in entry ?
178 std::string PortraitGiverText;
179 std::string PortraitGiverName;
183 int32 RewardFactionFlags = 0; // rep mask (unsure on what it does)
192 int32 QuestGiverCreatureID = 0; // used to select ConditionalQuestText
193 std::vector<QuestObjective> Objectives;
194 std::vector<ConditionalQuestText> ConditionalQuestDescription;
195 std::vector<ConditionalQuestText> ConditionalQuestCompletionLog;
208 };
209
211 {
212 public:
214
215 WorldPacket const* Write() override;
216
217 bool Allow = false;
220 };
221
223 {
224 public:
226
227 WorldPacket const* Write() override;
228
235 };
236
238 {
239 public:
241
242 WorldPacket const* Write() override;
243
247 };
248
250 {
251 public:
253
254 WorldPacket const* Write() override;
255
258 };
259
261 {
265 };
266
268 {
278 std::array<int32, QUEST_REWARD_DISPLAY_SPELL_COUNT> SpellCompletionDisplayID = { };
283 std::array<QuestChoiceItem, QUEST_REWARD_CHOICES_COUNT> ChoiceItems;
284 std::array<int32, QUEST_REWARD_ITEM_COUNT> ItemID = { };
285 std::array<int32, QUEST_REWARD_ITEM_COUNT> ItemQty = { };
286 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionID = { };
287 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionValue = { };
288 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionOverride = { };
289 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionCapIn = { };
290 std::array<int32, QUEST_REWARD_CURRENCY_COUNT> CurrencyID = { };
291 std::array<int32, QUEST_REWARD_CURRENCY_COUNT> CurrencyQty = { };
292 bool IsBoostSpell = false;
293 };
294
296 {
297 QuestDescEmote(int32 type = 0, uint32 delay = 0) : Type(type), Delay(delay) {}
300 };
301
303 {
307 bool AutoLaunched = false;
310 std::vector<QuestDescEmote> Emotes;
311 int32 QuestFlags[3] = { }; // Flags and FlagsEx
312 };
313
315 {
316 public:
318
319 WorldPacket const* Write() override;
320
326 std::string QuestTitle;
327 std::string RewardText;
328 std::string PortraitGiverText;
329 std::string PortraitGiverName;
332 std::vector<ConditionalQuestText> ConditionalRewardText;
335 };
336
338 {
339 public:
341
342 void Read() override;
343
347 };
348
350 {
351 public:
353
354 WorldPacket const* Write() override;
355
361 bool UseQuestReward = false;
362 bool LaunchGossip = false;
363 bool LaunchQuest = false;
364 bool HideChatMessage = false;
366 };
367
369 {
370 public:
372
373 void Read() override;
374
375 ObjectGuid QuestGiverGUID; // NPC / GameObject guid for normal quest completion. Player guid for self-completed quests
377 bool FromScript = false; // 0 - standart complete quest mode with npc, 1 - auto-complete mode
378 };
379
381 {
382 public:
384
385 void Read() override;
386
388 };
389
391 {
396 };
397
399 {
400 public:
402
403 WorldPacket const* Write() override;
404
412 std::vector<QuestObjectiveSimple> Objectives;
413 std::vector<QuestDescEmote> DescEmotes;
414 std::vector<int32> LearnSpells;
422 std::string PortraitGiverText;
423 std::string PortraitGiverName;
426 std::string QuestTitle;
427 std::string LogDescription;
428 std::string DescriptionText;
429 std::vector<ConditionalQuestText> ConditionalDescriptionText;
430 bool DisplayPopup = false;
431 bool StartCheat = false;
432 bool AutoLaunched = false;
433 };
434
436 {
437 QuestObjectiveCollect(int32 objectID = 0, int32 amount = 0, uint32 flags = 0) : ObjectID(objectID), Amount(amount), Flags(flags) { }
441 };
442
444 {
445 QuestCurrency(int32 currencyID = 0, int32 amount = 0) : CurrencyID(currencyID), Amount(amount) { }
448 };
449
451 {
452 public:
454
455 WorldPacket const* Write() override;
456
462 bool AutoLaunched = false;
465 std::vector<QuestObjectiveCollect> Collect;
466 std::vector<QuestCurrency> Currency;
469 std::string QuestTitle;
470 std::string CompletionText;
471 std::vector<ConditionalQuestText> ConditionalCompletionText;
472 };
473
475 {
476 public:
478
479 void Read() override;
480
483 };
484
486 {
487 public:
489
490 void Read() override;
491
494 bool RespondToGiver = false;
495 };
496
498 {
499 public:
501
502 void Read() override;
503
506 bool StartCheat = false;
507 };
508
510 {
511 public:
513
514 void Read() override;
515
517 };
518
520 {
521 public:
523
524 WorldPacket const* Write() override;
525
529 std::vector<NPC::ClientGossipText> QuestDataText;
530 std::string Greeting;
531 };
532
534 {
535 public:
537
538 WorldPacket const* Write() override;
539
541 };
542
544 {
545 public:
547
548 WorldPacket const* Write() override;
549
552 std::string QuestTitle;
553 };
554
555 class QuestConfirmAccept final : public ClientPacket
556 {
557 public:
559
560 void Read() override;
561
563 };
564
566 {
567 public:
569
570 WorldPacket const* Write() override;
571
574 std::string QuestTitle;
575 };
576
577 class QuestLogFull final : public ServerPacket
578 {
579 public:
581
582 WorldPacket const* Write() override { return &_worldPacket; }
583 };
584
585 class QuestPushResult final : public ClientPacket
586 {
587 public:
589
590 void Read() override;
591
595 };
596
598 {
599 public:
601
602 WorldPacket const* Write() override;
603
606 bool SendErrorMessage = false;
607 std::string ReasonText;
608 };
609
611 {
612 public:
614
615 WorldPacket const* Write() override;
616
618 };
619
621 {
622 public:
624
625 WorldPacket const* Write() override;
626
629 };
630
631 class PushQuestToParty final : public ClientPacket
632 {
633 public:
635
636 void Read() override;
637
639 };
640
641 class DailyQuestsReset final : public ServerPacket
642 {
643 public:
645
646 WorldPacket const* Write() override;
647
649 };
650
651 class QuestForceRemoved final : public ServerPacket
652 {
653 public:
655
656 WorldPacket const* Write() override;
657
659 };
660
662 {
663 public:
665
666 void Read() override { }
667 };
668
670 {
671 WorldQuestUpdateInfo(time_t lastUpdate, uint32 questID, uint32 timer, int32 variableID, int32 value) :
672 LastUpdate(lastUpdate), QuestID(questID), Timer(timer), VariableID(variableID), Value(value) { }
676 // WorldState
679 };
680
682 {
683 public:
685
686 WorldPacket const* Write() override;
687
688 std::vector<WorldQuestUpdateInfo> WorldQuestUpdates;
689 };
690
692 {
695 };
696
698 {
707 std::vector<PlayerChoiceResponseRewardEntry> Items;
708 std::vector<PlayerChoiceResponseRewardEntry> Currencies;
709 std::vector<PlayerChoiceResponseRewardEntry> Factions;
710 std::vector<PlayerChoiceResponseRewardEntry> ItemChoices;
711 };
712
714 {
722 };
723
725 {
735 std::string_view Answer;
736 std::string_view Header;
737 std::string_view SubHeader;
738 std::string_view ButtonTooltip;
739 std::string_view Description;
740 std::string_view Confirmation;
744 };
745
747 {
748 public:
750
751 WorldPacket const* Write() override;
752
760 std::string_view Question;
761 std::string_view PendingChoiceText;
762 std::vector<PlayerChoiceResponse> Responses;
763 bool CloseChoiceFrame = false;
764 bool HideWarboardHeader = false;
766 };
767
768 class ChoiceResponse final : public ClientPacket
769 {
770 public:
772
773 void Read() override;
774
777 bool IsReroll = false;
778 };
779 }
780}
781
782#endif // QuestPackets_h__
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
#define UI64LIT(N)
Definition: Define.h:127
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
uint16 flags
Definition: DisableMgr.cpp:49
LootItemType
Definition: LootItemType.h:24
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition: ObjectGuid.h:396
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
#define QUEST_ITEM_DROP_COUNT
Definition: QuestDef.h:46
#define QUEST_REWARD_ITEM_COUNT
Definition: QuestDef.h:48
#define QUEST_REWARD_REPUTATIONS_COUNT
Definition: QuestDef.h:50
QuestGiverStatus
Definition: QuestDef.h:153
#define QUEST_REWARD_CURRENCY_COUNT
Definition: QuestDef.h:52
#define QUEST_REWARD_CHOICES_COUNT
Definition: QuestDef.h:47
QuestFlags
Definition: QuestDef.h:192
QuestType
WorldPacket _worldPacket
Definition: Packet.h:43
ChoiceResponse(WorldPacket &&packet)
Definition: QuestPackets.h:771
WorldPacket const * Write() override
WorldPackets::Duration< Seconds > Duration
Definition: QuestPackets.h:759
std::vector< PlayerChoiceResponse > Responses
Definition: QuestPackets.h:762
WorldPacket const * Write() override
PushQuestToParty(WorldPacket &&packet)
Definition: QuestPackets.h:634
WorldPacket const * Write() override
QueryQuestInfo(WorldPacket &&packet)
Definition: QuestPackets.h:105
QuestConfirmAccept(WorldPacket &&packet)
Definition: QuestPackets.h:558
WorldPacket const * Write() override
QuestGiverCloseQuest(WorldPacket &&packet)
Definition: QuestPackets.h:383
QuestGiverHello(WorldPacket &&packet)
Definition: QuestPackets.h:95
WorldPacket const * Write() override
std::vector< ConditionalQuestText > ConditionalRewardText
Definition: QuestPackets.h:332
QuestGiverQueryQuest(WorldPacket &&packet)
Definition: QuestPackets.h:488
WorldPackets::Item::ItemInstance ItemReward
Definition: QuestPackets.h:365
WorldPacket const * Write() override
std::vector< ConditionalQuestText > ConditionalDescriptionText
Definition: QuestPackets.h:429
std::vector< QuestDescEmote > DescEmotes
Definition: QuestPackets.h:413
std::vector< QuestObjectiveSimple > Objectives
Definition: QuestPackets.h:412
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< NPC::ClientGossipText > QuestDataText
Definition: QuestPackets.h:529
std::vector< QuestCurrency > Currency
Definition: QuestPackets.h:466
std::vector< ConditionalQuestText > ConditionalCompletionText
Definition: QuestPackets.h:471
WorldPacket const * Write() override
std::vector< QuestObjectiveCollect > Collect
Definition: QuestPackets.h:465
std::vector< QuestGiverInfo > QuestGiver
Definition: QuestPackets.h:89
WorldPacket const * Write() override
QuestGiverStatusQuery(WorldPacket &&packet)
Definition: QuestPackets.h:36
WorldPacket const * Write() override
WorldPacket const * Write() override
Definition: QuestPackets.h:582
QuestLogRemoveQuest(WorldPacket &&packet)
Definition: QuestPackets.h:512
WorldPacket const * Write() override
QuestPushResult(WorldPacket &&packet)
Definition: QuestPackets.h:588
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< WorldQuestUpdateInfo > WorldQuestUpdates
Definition: QuestPackets.h:688
@ CMSG_QUEST_GIVER_CLOSE_QUEST
Definition: Opcodes.h:665
@ CMSG_QUEST_CONFIRM_ACCEPT
Definition: Opcodes.h:662
@ CMSG_QUEST_GIVER_STATUS_TRACKED_QUERY
Definition: Opcodes.h:672
@ CMSG_QUEST_GIVER_QUERY_QUEST
Definition: Opcodes.h:668
@ CMSG_QUEST_GIVER_REQUEST_REWARD
Definition: Opcodes.h:669
@ CMSG_QUEST_GIVER_COMPLETE_QUEST
Definition: Opcodes.h:666
@ CMSG_PUSH_QUEST_TO_PARTY
Definition: Opcodes.h:635
@ CMSG_QUERY_QUEST_INFO
Definition: Opcodes.h:655
@ CMSG_QUEST_GIVER_HELLO
Definition: Opcodes.h:667
@ CMSG_QUEST_GIVER_CHOOSE_REWARD
Definition: Opcodes.h:664
@ CMSG_REQUEST_WORLD_QUEST_UPDATE
Definition: Opcodes.h:737
@ CMSG_QUEST_GIVER_ACCEPT_QUEST
Definition: Opcodes.h:663
@ CMSG_QUEST_PUSH_RESULT
Definition: Opcodes.h:675
@ CMSG_QUEST_GIVER_STATUS_QUERY
Definition: Opcodes.h:671
@ CMSG_QUEST_LOG_REMOVE_QUEST
Definition: Opcodes.h:673
@ CMSG_QUEST_GIVER_STATUS_MULTIPLE_QUERY
Definition: Opcodes.h:670
@ CMSG_CHOICE_RESPONSE
Definition: Opcodes.h:236
@ SMSG_DISPLAY_PLAYER_CHOICE
Definition: Opcodes.h:1206
@ SMSG_QUEST_UPDATE_ADD_CREDIT
Definition: Opcodes.h:1812
@ SMSG_QUEST_GIVER_INVALID_QUEST
Definition: Opcodes.h:1793
@ SMSG_QUEST_GIVER_QUEST_COMPLETE
Definition: Opcodes.h:1795
@ SMSG_QUERY_QUEST_INFO_RESPONSE
Definition: Opcodes.h:1787
@ SMSG_QUEST_GIVER_STATUS
Definition: Opcodes.h:1800
@ SMSG_QUEST_UPDATE_COMPLETE
Definition: Opcodes.h:1815
@ SMSG_QUEST_GIVER_REQUEST_ITEMS
Definition: Opcodes.h:1799
@ SMSG_QUEST_GIVER_STATUS_MULTIPLE
Definition: Opcodes.h:1801
@ SMSG_QUEST_UPDATE_FAILED_TIMER
Definition: Opcodes.h:1817
@ SMSG_QUEST_FORCE_REMOVED
Definition: Opcodes.h:1792
@ SMSG_QUEST_UPDATE_ADD_CREDIT_SIMPLE
Definition: Opcodes.h:1813
@ SMSG_WORLD_QUEST_UPDATE_RESPONSE
Definition: Opcodes.h:2076
@ SMSG_DAILY_QUESTS_RESET
Definition: Opcodes.h:1191
@ SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE
Definition: Opcodes.h:1794
@ SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE
Definition: Opcodes.h:1798
@ SMSG_QUEST_GIVER_QUEST_FAILED
Definition: Opcodes.h:1797
@ SMSG_QUEST_GIVER_QUEST_DETAILS
Definition: Opcodes.h:1796
@ SMSG_QUEST_UPDATE_ADD_PVP_CREDIT
Definition: Opcodes.h:1814
@ SMSG_QUEST_CONFIRM_ACCEPT
Definition: Opcodes.h:1791
@ SMSG_QUEST_LOG_FULL
Definition: Opcodes.h:1803
@ SMSG_QUEST_PUSH_RESULT
Definition: Opcodes.h:1807
STL namespace.
std::vector< PlayerChoiceResponseRewardEntry > Factions
Definition: QuestPackets.h:709
std::vector< PlayerChoiceResponseRewardEntry > ItemChoices
Definition: QuestPackets.h:710
std::vector< PlayerChoiceResponseRewardEntry > Currencies
Definition: QuestPackets.h:708
std::vector< PlayerChoiceResponseRewardEntry > Items
Definition: QuestPackets.h:707
Optional< PlayerChoiceResponseReward > Reward
Definition: QuestPackets.h:741
Optional< PlayerChoiceResponseMawPower > MawPower
Definition: QuestPackets.h:743
QuestCurrency(int32 currencyID=0, int32 amount=0)
Definition: QuestPackets.h:445
QuestDescEmote(int32 type=0, uint32 delay=0)
Definition: QuestPackets.h:297
QuestGiverInfo(ObjectGuid const &guid, ::QuestGiverStatus status)
Definition: QuestPackets.h:65
std::vector< QuestDescEmote > Emotes
Definition: QuestPackets.h:310
std::vector< QuestCompleteDisplaySpell > RewardDisplaySpell
Definition: QuestPackets.h:150
std::vector< QuestObjective > Objectives
Definition: QuestPackets.h:193
int32 RewardAmount[QUEST_REWARD_ITEM_COUNT]
Definition: QuestPackets.h:197
int32 ItemDrop[QUEST_ITEM_DROP_COUNT]
Definition: QuestPackets.h:198
int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT]
Definition: QuestPackets.h:203
int32 RewardItems[QUEST_REWARD_ITEM_COUNT]
Definition: QuestPackets.h:196
int32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT]
Definition: QuestPackets.h:204
QuestInfoChoiceItem UnfilteredChoiceItems[QUEST_REWARD_CHOICES_COUNT]
Definition: QuestPackets.h:200
Trinity::RaceMask< uint64 > AllowableRaces
Definition: QuestPackets.h:165
std::vector< ConditionalQuestText > ConditionalQuestDescription
Definition: QuestPackets.h:194
std::vector< ConditionalQuestText > ConditionalQuestCompletionLog
Definition: QuestPackets.h:195
int32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT]
Definition: QuestPackets.h:201
int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT]
Definition: QuestPackets.h:205
int32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT]
Definition: QuestPackets.h:199
int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT]
Definition: QuestPackets.h:206
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT]
Definition: QuestPackets.h:202
QuestObjectiveCollect(int32 objectID=0, int32 amount=0, uint32 flags=0)
Definition: QuestPackets.h:437
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionOverride
Definition: QuestPackets.h:288
std::array< QuestChoiceItem, QUEST_REWARD_CHOICES_COUNT > ChoiceItems
Definition: QuestPackets.h:283
std::array< int32, QUEST_REWARD_DISPLAY_SPELL_COUNT > SpellCompletionDisplayID
Definition: QuestPackets.h:278
std::array< int32, QUEST_REWARD_CURRENCY_COUNT > CurrencyQty
Definition: QuestPackets.h:291
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionValue
Definition: QuestPackets.h:287
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionCapIn
Definition: QuestPackets.h:289
std::array< int32, QUEST_REWARD_ITEM_COUNT > ItemQty
Definition: QuestPackets.h:285
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionID
Definition: QuestPackets.h:286
std::array< int32, QUEST_REWARD_CURRENCY_COUNT > CurrencyID
Definition: QuestPackets.h:290
std::array< int32, QUEST_REWARD_ITEM_COUNT > ItemID
Definition: QuestPackets.h:284
WorldQuestUpdateInfo(time_t lastUpdate, uint32 questID, uint32 timer, int32 variableID, int32 value)
Definition: QuestPackets.h:671