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 "ObjectGuid.h"
22#include "Packet.h"
23#include "QuestDef.h"
24
25namespace WorldPackets
26{
27 namespace Quest
28 {
38
39 // Empty packet, server replies with quest giver status of visible creatures
47
57
59 {
60 public:
62
63 WorldPacket const* Write() override;
64
66 };
67
69 {
70 public:
72
73 WorldPacket const* Write() override;
74
75 std::vector<QuestGiverInfo> QuestGiver;
76 };
77
79 {
80 public:
82
83 void Read() override;
84
86 };
87
93
94 struct QuestInfo
95 {
97 uint32 QuestType = 0; // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
98 int32 QuestLevel = 0; // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevel (0 is not known, but assuming this is no longer valid for quest intended for client)
100 int32 QuestSortID = 0; // zone or sort to display in quest log
104
105 uint32 RequiredFactionId[PVP_TEAMS_COUNT] = { }; // shown in quest log as part of quest objective (same/opposite faction)
106 int32 RequiredFactionValue[PVP_TEAMS_COUNT] = { }; // shown in quest log as part of quest objective (same/opposite faction)
107
108 uint32 RewardNextQuest = 0; // client will request this quest from NPC, if not 0
109 uint32 RewardXPDifficulty = 0; // used for calculating rewarded experience
110 int32 RewardMoney = 0; // reward money (below max lvl)
111 uint32 RewardBonusMoney = 0; // used in XP calculation at client
112 uint32 RewardDisplaySpell = 0; // reward spell, this spell will be displayed (icon) (cast if RewSpellCast == 0)
115 float RewardKillHonor = 0.0f;
118 uint32 RewardTitle = 0; // new 2.4.0, player gets this title (id from CharTitles)
123
130
132 float POIx = 0.0f;
133 float POIy = 0.0f;
135 std::string LogTitle;
136 std::string LogDescription;
137 std::string QuestDescription;
138 std::string AreaDescription;
140
141 int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT] = { }; // >0 Creature <0 Gameobject
143
146
149
151 };
152
154 {
155 public:
157
158 WorldPacket const* Write() override;
159
161 };
162
171
173 {
174 std::vector<QuestChoiceItem> UnfilteredChoiceItems;
175 std::vector<QuestChoiceItem> RewardItems;
179 float RewardKillHonor = 0.f;
186 std::array<uint32, QUEST_REWARD_REPUTATIONS_COUNT> RewardFactionID = { };
187 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> RewardFactionValue = { };
188 std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> RewardFactionOverride = { };
189 };
190
192 {
193 QuestDescEmote(int32 type, uint32 delay) : Type(type), Delay(delay) { }
196 };
197
218
225
249
260
262 {
263 public:
265
266 void Read() override;
267
270 bool RespondToGiver = false;
271 };
272
290
292 {
293 public:
295
296 void Read() override { }
297 };
298
300 {
301 public:
303
304 WorldPacket const* Write() override;
305
306 std::set<uint32> const* QuestsCompleted = nullptr;
307 };
308 }
309}
310
311#endif // TRINITYCORE_QUEST_PACKETS_H
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define QUEST_ITEM_DROP_COUNT
Definition QuestDef.h:40
#define QUEST_REWARD_ITEM_COUNT
Definition QuestDef.h:42
#define QUEST_ITEM_OBJECTIVES_COUNT
Definition QuestDef.h:39
#define QUEST_REWARD_REPUTATIONS_COUNT
Definition QuestDef.h:43
#define QUEST_OBJECTIVES_COUNT
Definition QuestDef.h:38
QuestFlags
Definition QuestDef.h:129
QuestGiverStatus
Definition QuestDef.h:114
@ DIALOG_STATUS_NONE
Definition QuestDef.h:115
#define QUEST_REWARD_CHOICES_COUNT
Definition QuestDef.h:41
QuestType
uint8 constexpr PVP_TEAMS_COUNT
WorldPacket const * Write() override
QueryQuestInfo(WorldPacket &&packet)
std::vector< QuestDescEmote > DescEmotes
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< QuestObjectiveCollect > Collect
std::vector< QuestGiverInfo > QuestGiver
WorldPacket const * Write() override
@ CMSG_QUESTGIVER_QUERY_QUEST
Definition Opcodes.h:419
@ CMSG_QUEST_QUERY
Definition Opcodes.h:121
@ CMSG_QUESTGIVER_STATUS_QUERY
Definition Opcodes.h:415
@ SMSG_QUESTGIVER_STATUS
Definition Opcodes.h:416
@ SMSG_QUESTGIVER_STATUS_MULTIPLE
Definition Opcodes.h:1077
@ SMSG_QUERY_QUESTS_COMPLETED_RESPONSE
Definition Opcodes.h:1310
@ SMSG_QUESTGIVER_REQUEST_ITEMS
Definition Opcodes.h:424
@ CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY
Definition Opcodes.h:1076
@ SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE
Definition Opcodes.h:426
@ CMSG_QUESTGIVER_REQUEST_REWARD
Definition Opcodes.h:425
@ SMSG_QUEST_GIVER_QUEST_DETAILS
Definition Opcodes.h:421
@ SMSG_QUEST_QUERY_RESPONSE
Definition Opcodes.h:122
@ CMSG_QUERY_QUESTS_COMPLETED
Definition Opcodes.h:1309
STL namespace.
QuestChoiceItem(uint32 itemID, uint32 quantity, uint32 displayID)
QuestDescEmote(int32 type, uint32 delay)
QuestGiverInfo(ObjectGuid const &guid, ::QuestGiverStatus status)
uint32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT]
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT]
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]
uint32 RewardItems[QUEST_REWARD_ITEM_COUNT]
int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT]
uint32 RewardAmount[QUEST_REWARD_ITEM_COUNT]
uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]
int32 RequiredFactionValue[PVP_TEAMS_COUNT]
uint32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT]
QuestInfoChoiceItem UnfilteredChoiceItems[QUEST_REWARD_CHOICES_COUNT]
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]
uint32 RequiredFactionId[PVP_TEAMS_COUNT]
uint32 ItemDrop[QUEST_ITEM_DROP_COUNT]
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT]
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > RewardFactionOverride
std::vector< QuestChoiceItem > RewardItems
std::array< uint32, QUEST_REWARD_REPUTATIONS_COUNT > RewardFactionID
std::vector< QuestChoiceItem > UnfilteredChoiceItems
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > RewardFactionValue