TrinityCore
Loading...
Searching...
No Matches
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 TRINITYCORE_QUEST_PACKETS_H
19#define TRINITYCORE_QUEST_PACKETS_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 "RaceMask.h"
28#include <array>
29
30namespace WorldPackets
31{
32 namespace Quest
33 {
35 {
36 public:
38
39 void Read() override;
40
42 };
43
44 // Empty packet, server replies with quest giver status of visible creatures
46 {
47 public:
49
50 void Read() override { }
51 };
52
62
63 class QuestGiverStatus final : public ServerPacket
64 {
65 public:
67
68 WorldPacket const* Write() override;
69
71 };
72
74 {
75 public:
77
78 WorldPacket const* Write() override;
79
80 std::vector<QuestGiverInfo> QuestGiver;
81 };
82
83 class QuestGiverHello final : public ClientPacket
84 {
85 public:
86 explicit QuestGiverHello(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_GIVER_HELLO, std::move(packet)) { }
87
88 void Read() override;
89
91 };
92
93 class QueryQuestInfo final : public ClientPacket
94 {
95 public:
96 explicit QueryQuestInfo(WorldPacket&& packet) : ClientPacket(CMSG_QUERY_QUEST_INFO, std::move(packet)) { }
97
98 void Read() override;
99
102 };
103
110
117
135
142
144 {
146 int32 QuestType = 0; // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
149 int32 QuestSortID = 0; // zone or sort to display in quest log
152 int32 RewardNextQuest = 0; // client will request this quest from NPC, if not 0
153 int32 RewardXPDifficulty = 0; // used for calculating rewarded experience
154 float RewardXPMultiplier = 1.0f;
155 int32 RewardMoney = 0; // reward money (below max lvl)
159 std::vector<QuestCompleteDisplaySpell> RewardDisplaySpell; // reward spell, this spell will be displayed (icon)
162 float RewardKillHonor = 0.0f;
173 float POIx = 0.0f;
174 float POIy = 0.0f;
176 Trinity::RaceMask<int32, 2> AllowableRaces = RACEMASK_ALL_v<int32, 2>;
177 std::string LogTitle;
178 std::string LogDescription;
179 std::string QuestDescription;
180 std::string AreaDescription;
181 int32 RewardTitle = 0; // new 2.4.0, player gets this title (id from CharTitles)
183 int32 RewardSkillLineID = 0; // reward skill id
184 int32 RewardNumSkillUps = 0; // reward skill points
185 int32 PortraitGiver = 0; // quest giver entry ?
188 int32 PortraitTurnIn = 0; // quest turn in entry ?
189 std::string PortraitGiverText;
190 std::string PortraitGiverName;
194 int32 RewardFactionFlags = 0; // rep mask (unsure on what it does)
199 std::span<int32 const> TreasurePickerID;
200 std::span<int32 const> NonDisplayableTreasurePickerIDs;
204 int32 QuestGiverCreatureID = 0; // used to select ConditionalQuestText
205 std::vector<QuestInfoObjective> Objectives;
206 std::vector<ConditionalQuestText> ConditionalQuestDescription;
207 std::vector<ConditionalQuestText> ConditionalQuestCompletionLog;
208 std::span<int32 const> RewardHouseRoomIDs;
209 std::span<int32 const> RewardHouseDecorIDs;
222 bool ResetByScheduler = false;
223 };
224
226 {
227 public:
229
230 WorldPacket const* Write() override;
231
232 bool Allow = false;
235 };
236
238 {
239 public:
240 explicit QuestUpdateAddCredit() : ServerPacket(SMSG_QUEST_UPDATE_ADD_CREDIT, 16 + 4 + 4 + 2 + 2 + 1) { }
241
242 WorldPacket const* Write() override;
243
250 };
251
253 {
254 public:
256
257 WorldPacket const* Write() override;
258
262 };
263
265 {
266 public:
268
269 WorldPacket const* Write() override;
270
273 };
274
281
289
297
299 {
309 std::array<int32, QUEST_REWARD_DISPLAY_SPELL_COUNT> SpellCompletionDisplayID = { };
313 std::span<int32 const> TreasurePickerID;
314 std::array<QuestChoiceItem, QUEST_REWARD_CHOICES_COUNT> ChoiceItems = { };
315 std::array<QuestRewardItem, QUEST_REWARD_ITEM_COUNT> Items = { };
316 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionID = { };
317 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionValue = { };
318 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionOverride = { };
319 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionCapIn = { };
320 std::array<QuestRewardCurrency, QUEST_REWARD_CURRENCY_COUNT> Currencies = { };
321 bool IsBoostSpell = false;
322 };
323
325 {
326 QuestDescEmote(int32 type = 0, uint32 delay = 0) : Type(type), Delay(delay) {}
329 };
330
344
367
369 {
370 public:
372
373 void Read() override;
374
378 };
379
398
400 {
401 public:
403
404 void Read() override;
405
406 ObjectGuid QuestGiverGUID; // NPC / GameObject guid for normal quest completion. Player guid for self-completed quests
408 bool FromScript = false; // 0 - standart complete quest mode with npc, 1 - auto-complete mode
409 };
410
412 {
413 public:
415
416 void Read() override;
417
419 };
420
428
430 {
431 public:
433
434 WorldPacket const* Write() override;
435
440 std::array<uint32, 4> QuestFlags = { };
443 std::vector<QuestObjectiveSimple> Objectives;
444 std::vector<QuestDescEmote> DescEmotes;
445 std::vector<int32> LearnSpells;
454 std::string_view PortraitGiverText;
455 std::string_view PortraitGiverName;
456 std::string_view PortraitTurnInText;
457 std::string_view PortraitTurnInName;
458 std::string_view QuestTitle;
459 std::string_view LogDescription;
460 std::string_view DescriptionText;
461 std::vector<ConditionalQuestText> ConditionalDescriptionText;
462 bool AutoLaunched = false;
463 bool FromContentPush = false;
464 bool ReplayQuest = false;
465 bool ResetByScheduler = false;
466 bool StartCheat = false;
467 bool DisplayPopup = false;
468 };
469
471 {
472 QuestObjectiveCollect(int32 objectID = 0, int32 amount = 0, uint32 flags = 0) : ObjectID(objectID), Amount(amount), Flags(flags) { }
476 };
477
479 {
480 QuestCurrency(int32 currencyID = 0, int32 amount = 0) : CurrencyID(currencyID), Amount(amount) { }
483 };
484
486 {
487 public:
489
490 WorldPacket const* Write() override;
491
497 bool AutoLaunched = false;
498 bool ResetByScheduler = false;
501 std::vector<QuestObjectiveCollect> Collect;
502 std::vector<QuestCurrency> Currency;
505 std::array<uint32, 4> QuestFlags = { };
506 std::string_view QuestTitle;
507 std::string_view CompletionText;
508 std::vector<ConditionalQuestText> ConditionalCompletionText;
509 };
510
512 {
513 public:
515
516 void Read() override;
517
520 };
521
523 {
524 public:
526
527 void Read() override;
528
531 bool RespondToGiver = false;
532 };
533
535 {
536 public:
538
539 void Read() override;
540
543 bool StartCheat = false;
544 };
545
547 {
548 public:
550
551 void Read() override;
552
554 };
555
557 {
558 public:
560
561 WorldPacket const* Write() override;
562
566 std::vector<NPC::ClientGossipText> QuestDataText;
567 std::string_view Greeting;
568 };
569
571 {
572 public:
574
575 WorldPacket const* Write() override;
576
578 bool HideCreditMessage = false;
579 };
580
582 {
583 public:
585
586 WorldPacket const* Write() override;
587
590 std::string QuestTitle;
591 };
592
593 class QuestConfirmAccept final : public ClientPacket
594 {
595 public:
597
598 void Read() override;
599
601 };
602
604 {
605 public:
607
608 WorldPacket const* Write() override;
609
612 std::string_view QuestTitle;
613 };
614
615 class QuestLogFull final : public ServerPacket
616 {
617 public:
619
620 WorldPacket const* Write() override { return &_worldPacket; }
621 };
622
623 class QuestPushResult final : public ClientPacket
624 {
625 public:
626 explicit QuestPushResult(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_PUSH_RESULT, std::move(packet)) { }
627
628 void Read() override;
629
633 };
634
636 {
637 public:
639
640 WorldPacket const* Write() override;
641
644 bool SendErrorMessage = false;
645 std::string ReasonText;
646 };
647
649 {
650 public:
652
653 WorldPacket const* Write() override;
654
656 };
657
659 {
660 public:
662
663 WorldPacket const* Write() override;
664
667 };
668
669 class PushQuestToParty final : public ClientPacket
670 {
671 public:
673
674 void Read() override;
675
677 };
678
679 class DailyQuestsReset final : public ServerPacket
680 {
681 public:
683
684 WorldPacket const* Write() override;
685
687 };
688
689 class QuestForceRemoved final : public ServerPacket
690 {
691 public:
693
694 WorldPacket const* Write() override;
695
697 };
698
700 {
701 public:
703
704 void Read() override { }
705 };
706
708 {
709 WorldQuestUpdateInfo(time_t lastUpdate, uint32 questID, uint32 timer, int32 variableID, int32 value) :
710 LastUpdate(lastUpdate), QuestID(questID), Timer(timer), VariableID(variableID), Value(value) { }
714 // WorldState
717 };
718
720 {
721 public:
723
724 WorldPacket const* Write() override;
725
726 std::vector<WorldQuestUpdateInfo> WorldQuestUpdates;
727 };
728
734
736 {
745 std::vector<PlayerChoiceResponseRewardEntry> Items;
746 std::vector<PlayerChoiceResponseRewardEntry> Currencies;
747 std::vector<PlayerChoiceResponseRewardEntry> Factions;
748 std::vector<PlayerChoiceResponseRewardEntry> ItemChoices;
749 };
750
760
782
784 {
785 public:
787
788 WorldPacket const* Write() override;
789
797 std::string_view Question;
798 std::string_view PendingChoiceText;
799 std::vector<PlayerChoiceResponse> Responses;
800 bool InfiniteRange = false;
801 bool HideWarboardHeader = false;
803 bool ShowChoicesAsList = false;
804 bool HasPowerChoice = false;
805 bool RequiresSelection = false;
806 bool ShowChoicesAsGrid = false;
807 bool HideAnswerArt = false;
809 };
810
811 class ChoiceResponse final : public ClientPacket
812 {
813 public:
814 explicit ChoiceResponse(WorldPacket&& packet) : ClientPacket(CMSG_CHOICE_RESPONSE, std::move(packet)) { }
815
816 void Read() override;
817
820 bool IsReroll = false;
821 };
822
824 {
825 public:
827
828 WorldPacket const* Write() override;
829
831 std::vector<uint32> QuestLineXQuestIDs;
832 std::vector<uint32> QuestIDs;
833 std::vector<uint32> QuestLineIDs;
834 };
835
837 {
838 public:
840
841 void Read() override;
842
844 };
845
852
854 {
855 public:
857
858 void Read() override;
859
860 std::vector<SpawnTrackingRequestInfo> SpawnTrackingRequests;
861 };
862
872
874 {
875 public:
877
878 WorldPacket const* Write() override;
879
880 std::vector<SpawnTrackingResponseInfo> SpawnTrackingResponses;
881 };
882
884 {
885 public:
887
888 WorldPacket const* Write() override;
889
891 };
892 }
893}
894
895#endif // TRINITYCORE_QUEST_PACKETS_H
uint8_t uint8
Definition Define.h:156
int64_t int64
Definition Define.h:149
int8_t int8
Definition Define.h:152
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
uint16 flags
LootItemType
@ SMSG_DISPLAY_PLAYER_CHOICE
Definition Opcodes.h:1441
@ SMSG_QUEST_UPDATE_ADD_CREDIT
Definition Opcodes.h:2208
@ SMSG_QUEST_GIVER_INVALID_QUEST
Definition Opcodes.h:2189
@ SMSG_QUEST_GIVER_QUEST_COMPLETE
Definition Opcodes.h:2191
@ SMSG_UI_MAP_QUEST_LINES_RESPONSE
Definition Opcodes.h:2438
@ SMSG_QUERY_QUEST_INFO_RESPONSE
Definition Opcodes.h:2181
@ SMSG_QUEST_GIVER_STATUS
Definition Opcodes.h:2196
@ SMSG_QUEST_POI_UPDATE_RESPONSE
Definition Opcodes.h:2202
@ SMSG_FORCE_SPAWN_TRACKING_UPDATE
Definition Opcodes.h:1487
@ SMSG_QUEST_UPDATE_COMPLETE
Definition Opcodes.h:2211
@ SMSG_QUEST_GIVER_REQUEST_ITEMS
Definition Opcodes.h:2195
@ SMSG_QUEST_GIVER_STATUS_MULTIPLE
Definition Opcodes.h:2197
@ SMSG_QUEST_UPDATE_FAILED_TIMER
Definition Opcodes.h:2213
@ SMSG_QUEST_FORCE_REMOVED
Definition Opcodes.h:2188
@ SMSG_QUEST_UPDATE_ADD_CREDIT_SIMPLE
Definition Opcodes.h:2209
@ SMSG_WORLD_QUEST_UPDATE_RESPONSE
Definition Opcodes.h:2501
@ SMSG_DAILY_QUESTS_RESET
Definition Opcodes.h:1425
@ SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE
Definition Opcodes.h:2190
@ SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE
Definition Opcodes.h:2194
@ SMSG_QUEST_GIVER_QUEST_FAILED
Definition Opcodes.h:2193
@ SMSG_QUEST_GIVER_QUEST_DETAILS
Definition Opcodes.h:2192
@ SMSG_QUEST_UPDATE_ADD_PVP_CREDIT
Definition Opcodes.h:2210
@ SMSG_QUEST_CONFIRM_ACCEPT
Definition Opcodes.h:2187
@ SMSG_QUEST_LOG_FULL
Definition Opcodes.h:2199
@ SMSG_QUEST_PUSH_RESULT
Definition Opcodes.h:2203
@ CMSG_QUEST_GIVER_CLOSE_QUEST
Definition Opcodes.h:806
@ CMSG_QUEST_CONFIRM_ACCEPT
Definition Opcodes.h:802
@ CMSG_QUEST_GIVER_QUERY_QUEST
Definition Opcodes.h:809
@ CMSG_QUEST_GIVER_REQUEST_REWARD
Definition Opcodes.h:810
@ CMSG_UI_MAP_QUEST_LINES_REQUEST
Definition Opcodes.h:1028
@ CMSG_QUEST_GIVER_COMPLETE_QUEST
Definition Opcodes.h:807
@ CMSG_PUSH_QUEST_TO_PARTY
Definition Opcodes.h:773
@ CMSG_QUERY_QUEST_INFO
Definition Opcodes.h:794
@ CMSG_QUEST_GIVER_HELLO
Definition Opcodes.h:808
@ CMSG_QUEST_GIVER_CHOOSE_REWARD
Definition Opcodes.h:805
@ CMSG_REQUEST_WORLD_QUEST_UPDATE
Definition Opcodes.h:885
@ CMSG_QUEST_GIVER_ACCEPT_QUEST
Definition Opcodes.h:804
@ CMSG_QUEST_PUSH_RESULT
Definition Opcodes.h:815
@ CMSG_QUEST_GIVER_STATUS_QUERY
Definition Opcodes.h:812
@ CMSG_QUEST_LOG_REMOVE_QUEST
Definition Opcodes.h:813
@ CMSG_QUEST_GIVER_STATUS_MULTIPLE_QUERY
Definition Opcodes.h:811
@ CMSG_SPAWN_TRACKING_UPDATE
Definition Opcodes.h:971
@ CMSG_CHOICE_RESPONSE
Definition Opcodes.h:238
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
#define QUEST_ITEM_DROP_COUNT
Definition QuestDef.h:45
#define QUEST_REWARD_ITEM_COUNT
Definition QuestDef.h:47
#define QUEST_REWARD_REPUTATIONS_COUNT
Definition QuestDef.h:48
QuestGiverStatus
Definition QuestDef.h:154
#define QUEST_REWARD_CURRENCY_COUNT
Definition QuestDef.h:50
#define QUEST_REWARD_CHOICES_COUNT
Definition QuestDef.h:46
QuestFlags
Definition QuestDef.h:212
QuestType
WorldPacket _worldPacket
Definition Packet.h:43
ChoiceResponse(WorldPacket &&packet)
WorldPacket const * Write() override
std::vector< PlayerChoiceResponse > Responses
WorldPacket const * Write() override
PushQuestToParty(WorldPacket &&packet)
WorldPacket const * Write() override
QueryQuestInfo(WorldPacket &&packet)
WorldPacket const * Write() override
QuestGiverHello(WorldPacket &&packet)
WorldPacket const * Write() override
std::vector< ConditionalQuestText > ConditionalRewardText
WorldPackets::Item::ItemInstance ItemReward
std::vector< ConditionalQuestText > ConditionalDescriptionText
std::vector< QuestDescEmote > DescEmotes
std::vector< QuestObjectiveSimple > Objectives
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< NPC::ClientGossipText > QuestDataText
std::vector< QuestCurrency > Currency
std::vector< ConditionalQuestText > ConditionalCompletionText
WorldPacket const * Write() override
std::vector< QuestObjectiveCollect > Collect
std::vector< QuestGiverInfo > QuestGiver
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< SpawnTrackingResponseInfo > SpawnTrackingResponses
QuestPushResult(WorldPacket &&packet)
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< SpawnTrackingRequestInfo > SpawnTrackingRequests
std::vector< WorldQuestUpdateInfo > WorldQuestUpdates
STL namespace.
std::vector< PlayerChoiceResponseRewardEntry > Factions
std::vector< PlayerChoiceResponseRewardEntry > ItemChoices
std::vector< PlayerChoiceResponseRewardEntry > Currencies
std::vector< PlayerChoiceResponseRewardEntry > Items
Optional< PlayerChoiceResponseReward > Reward
Optional< PlayerChoiceResponseMawPower > MawPower
Optional< QuestRewardContextFlags > ContextFlags
QuestCurrency(int32 currencyID=0, int32 amount=0)
QuestDescEmote(int32 type=0, uint32 delay=0)
QuestGiverInfo(ObjectGuid const &guid, ::QuestGiverStatus status)
std::vector< QuestDescEmote > Emotes
std::span< int32 const > VisualEffects
std::vector< QuestCompleteDisplaySpell > RewardDisplaySpell
std::span< int32 const > NonDisplayableTreasurePickerIDs
std::span< int32 const > TreasurePickerID
Trinity::RaceMask< int32, 2 > AllowableRaces
std::span< int32 const > RewardHouseRoomIDs
int32 RewardAmount[QUEST_REWARD_ITEM_COUNT]
int32 ItemDrop[QUEST_ITEM_DROP_COUNT]
std::span< int32 const > RewardHouseDecorIDs
int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT]
int32 RewardItems[QUEST_REWARD_ITEM_COUNT]
int32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT]
QuestInfoChoiceItem UnfilteredChoiceItems[QUEST_REWARD_CHOICES_COUNT]
std::vector< ConditionalQuestText > ConditionalQuestDescription
std::vector< ConditionalQuestText > ConditionalQuestCompletionLog
std::vector< QuestInfoObjective > Objectives
int32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT]
int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT]
int32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT]
int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT]
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT]
QuestObjectiveCollect(int32 objectID=0, int32 amount=0, uint32 flags=0)
Optional< QuestRewardContextFlags > ContextFlags
Optional< QuestRewardContextFlags > ContextFlags
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionOverride
std::array< QuestChoiceItem, QUEST_REWARD_CHOICES_COUNT > ChoiceItems
std::array< int32, QUEST_REWARD_DISPLAY_SPELL_COUNT > SpellCompletionDisplayID
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionValue
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionCapIn
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > FactionID
std::array< QuestRewardCurrency, QUEST_REWARD_CURRENCY_COUNT > Currencies
std::span< int32 const > TreasurePickerID
WorldQuestUpdateInfo(time_t lastUpdate, uint32 questID, uint32 timer, int32 variableID, int32 value)