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<std::array<int32, 2>> AllowableRaces = RACEMASK_ALL_v<std::array<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 DisplayPopup = false;
463 bool StartCheat = false;
464 bool AutoLaunched = false;
465 bool FromContentPush = false;
466 bool ResetByScheduler = false;
467 };
468
470 {
471 QuestObjectiveCollect(int32 objectID = 0, int32 amount = 0, uint32 flags = 0) : ObjectID(objectID), Amount(amount), Flags(flags) { }
475 };
476
478 {
479 QuestCurrency(int32 currencyID = 0, int32 amount = 0) : CurrencyID(currencyID), Amount(amount) { }
482 };
483
485 {
486 public:
488
489 WorldPacket const* Write() override;
490
496 bool AutoLaunched = false;
497 bool ResetByScheduler = false;
500 std::vector<QuestObjectiveCollect> Collect;
501 std::vector<QuestCurrency> Currency;
504 std::array<uint32, 4> QuestFlags = { };
505 std::string_view QuestTitle;
506 std::string_view CompletionText;
507 std::vector<ConditionalQuestText> ConditionalCompletionText;
508 };
509
511 {
512 public:
514
515 void Read() override;
516
519 };
520
522 {
523 public:
525
526 void Read() override;
527
530 bool RespondToGiver = false;
531 };
532
534 {
535 public:
537
538 void Read() override;
539
542 bool StartCheat = false;
543 };
544
546 {
547 public:
549
550 void Read() override;
551
553 };
554
556 {
557 public:
559
560 WorldPacket const* Write() override;
561
565 std::vector<NPC::ClientGossipText> QuestDataText;
566 std::string_view Greeting;
567 };
568
570 {
571 public:
573
574 WorldPacket const* Write() override;
575
577 bool HideCreditMessage = false;
578 };
579
581 {
582 public:
584
585 WorldPacket const* Write() override;
586
589 std::string QuestTitle;
590 };
591
592 class QuestConfirmAccept final : public ClientPacket
593 {
594 public:
596
597 void Read() override;
598
600 };
601
603 {
604 public:
606
607 WorldPacket const* Write() override;
608
611 std::string_view QuestTitle;
612 };
613
614 class QuestLogFull final : public ServerPacket
615 {
616 public:
618
619 WorldPacket const* Write() override { return &_worldPacket; }
620 };
621
622 class QuestPushResult final : public ClientPacket
623 {
624 public:
625 explicit QuestPushResult(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_PUSH_RESULT, std::move(packet)) { }
626
627 void Read() override;
628
632 };
633
635 {
636 public:
638
639 WorldPacket const* Write() override;
640
643 bool SendErrorMessage = false;
644 std::string ReasonText;
645 };
646
648 {
649 public:
651
652 WorldPacket const* Write() override;
653
655 };
656
658 {
659 public:
661
662 WorldPacket const* Write() override;
663
666 };
667
668 class PushQuestToParty final : public ClientPacket
669 {
670 public:
672
673 void Read() override;
674
676 };
677
678 class DailyQuestsReset final : public ServerPacket
679 {
680 public:
682
683 WorldPacket const* Write() override;
684
686 };
687
688 class QuestForceRemoved final : public ServerPacket
689 {
690 public:
692
693 WorldPacket const* Write() override;
694
696 };
697
699 {
700 public:
702
703 void Read() override { }
704 };
705
707 {
708 WorldQuestUpdateInfo(time_t lastUpdate, uint32 questID, uint32 timer, int32 variableID, int32 value) :
709 LastUpdate(lastUpdate), QuestID(questID), Timer(timer), VariableID(variableID), Value(value) { }
713 // WorldState
716 };
717
719 {
720 public:
722
723 WorldPacket const* Write() override;
724
725 std::vector<WorldQuestUpdateInfo> WorldQuestUpdates;
726 };
727
733
735 {
744 std::vector<PlayerChoiceResponseRewardEntry> Items;
745 std::vector<PlayerChoiceResponseRewardEntry> Currencies;
746 std::vector<PlayerChoiceResponseRewardEntry> Factions;
747 std::vector<PlayerChoiceResponseRewardEntry> ItemChoices;
748 };
749
759
781
806
807 class ChoiceResponse final : public ClientPacket
808 {
809 public:
810 explicit ChoiceResponse(WorldPacket&& packet) : ClientPacket(CMSG_CHOICE_RESPONSE, std::move(packet)) { }
811
812 void Read() override;
813
816 bool IsReroll = false;
817 };
818
820 {
821 public:
823
824 WorldPacket const* Write() override;
825
827 std::vector<uint32> QuestLineXQuestIDs;
828 std::vector<uint32> QuestIDs;
829 std::vector<uint32> QuestLineIDs;
830 };
831
833 {
834 public:
836
837 void Read() override;
838
840 };
841
848
850 {
851 public:
853
854 void Read() override;
855
856 std::vector<SpawnTrackingRequestInfo> SpawnTrackingRequests;
857 };
858
868
870 {
871 public:
873
874 WorldPacket const* Write() override;
875
876 std::vector<SpawnTrackingResponseInfo> SpawnTrackingResponses;
877 };
878
880 {
881 public:
883
884 WorldPacket const* Write() override;
885
887 };
888 }
889}
890
891#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:1419
@ SMSG_QUEST_UPDATE_ADD_CREDIT
Definition Opcodes.h:2176
@ SMSG_QUEST_GIVER_INVALID_QUEST
Definition Opcodes.h:2157
@ SMSG_QUEST_GIVER_QUEST_COMPLETE
Definition Opcodes.h:2159
@ SMSG_UI_MAP_QUEST_LINES_RESPONSE
Definition Opcodes.h:2404
@ SMSG_QUERY_QUEST_INFO_RESPONSE
Definition Opcodes.h:2149
@ SMSG_QUEST_GIVER_STATUS
Definition Opcodes.h:2164
@ SMSG_QUEST_POI_UPDATE_RESPONSE
Definition Opcodes.h:2170
@ SMSG_FORCE_SPAWN_TRACKING_UPDATE
Definition Opcodes.h:1464
@ SMSG_QUEST_UPDATE_COMPLETE
Definition Opcodes.h:2179
@ SMSG_QUEST_GIVER_REQUEST_ITEMS
Definition Opcodes.h:2163
@ SMSG_QUEST_GIVER_STATUS_MULTIPLE
Definition Opcodes.h:2165
@ SMSG_QUEST_UPDATE_FAILED_TIMER
Definition Opcodes.h:2181
@ SMSG_QUEST_FORCE_REMOVED
Definition Opcodes.h:2156
@ SMSG_QUEST_UPDATE_ADD_CREDIT_SIMPLE
Definition Opcodes.h:2177
@ SMSG_WORLD_QUEST_UPDATE_RESPONSE
Definition Opcodes.h:2467
@ SMSG_DAILY_QUESTS_RESET
Definition Opcodes.h:1403
@ SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE
Definition Opcodes.h:2158
@ SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE
Definition Opcodes.h:2162
@ SMSG_QUEST_GIVER_QUEST_FAILED
Definition Opcodes.h:2161
@ SMSG_QUEST_GIVER_QUEST_DETAILS
Definition Opcodes.h:2160
@ SMSG_QUEST_UPDATE_ADD_PVP_CREDIT
Definition Opcodes.h:2178
@ SMSG_QUEST_CONFIRM_ACCEPT
Definition Opcodes.h:2155
@ SMSG_QUEST_LOG_FULL
Definition Opcodes.h:2167
@ SMSG_QUEST_PUSH_RESULT
Definition Opcodes.h:2171
@ CMSG_QUEST_GIVER_CLOSE_QUEST
Definition Opcodes.h:789
@ CMSG_QUEST_CONFIRM_ACCEPT
Definition Opcodes.h:785
@ CMSG_QUEST_GIVER_QUERY_QUEST
Definition Opcodes.h:792
@ CMSG_QUEST_GIVER_REQUEST_REWARD
Definition Opcodes.h:793
@ CMSG_UI_MAP_QUEST_LINES_REQUEST
Definition Opcodes.h:1009
@ CMSG_QUEST_GIVER_COMPLETE_QUEST
Definition Opcodes.h:790
@ CMSG_PUSH_QUEST_TO_PARTY
Definition Opcodes.h:756
@ CMSG_QUERY_QUEST_INFO
Definition Opcodes.h:777
@ CMSG_QUEST_GIVER_HELLO
Definition Opcodes.h:791
@ CMSG_QUEST_GIVER_CHOOSE_REWARD
Definition Opcodes.h:788
@ CMSG_REQUEST_WORLD_QUEST_UPDATE
Definition Opcodes.h:867
@ CMSG_QUEST_GIVER_ACCEPT_QUEST
Definition Opcodes.h:787
@ CMSG_QUEST_PUSH_RESULT
Definition Opcodes.h:798
@ CMSG_QUEST_GIVER_STATUS_QUERY
Definition Opcodes.h:795
@ CMSG_QUEST_LOG_REMOVE_QUEST
Definition Opcodes.h:796
@ CMSG_QUEST_GIVER_STATUS_MULTIPLE_QUERY
Definition Opcodes.h:794
@ CMSG_SPAWN_TRACKING_UPDATE
Definition Opcodes.h:952
@ CMSG_CHOICE_RESPONSE
Definition Opcodes.h:237
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
#define QUEST_ITEM_DROP_COUNT
Definition QuestDef.h:48
#define QUEST_REWARD_ITEM_COUNT
Definition QuestDef.h:50
#define QUEST_REWARD_REPUTATIONS_COUNT
Definition QuestDef.h:52
QuestGiverStatus
Definition QuestDef.h:158
#define QUEST_REWARD_CURRENCY_COUNT
Definition QuestDef.h:54
#define QUEST_REWARD_CHOICES_COUNT
Definition QuestDef.h:49
QuestFlags
Definition QuestDef.h:216
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
std::span< int32 const > RewardHouseRoomIDs
int32 RewardAmount[QUEST_REWARD_ITEM_COUNT]
int32 ItemDrop[QUEST_ITEM_DROP_COUNT]
Trinity::RaceMask< std::array< int32, 2 > > AllowableRaces
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)