TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 "ObjectGuid.h"
22#include "Packet.h"
23#include "QuestDef.h"
24
25namespace WorldPackets
26{
27 namespace Quest
28 {
29 class QueryQuestInfo final : public ClientPacket
30 {
31 public:
33
34 void Read() override;
35
37 };
38
40 {
43 };
44
45 struct QuestInfo
46 {
48 uint32 QuestMethod = 0; // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
49 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)
51 int32 QuestSortID = 0; // zone or sort to display in quest log
55
56 uint32 RequiredFactionId[PVP_TEAMS_COUNT] = { }; // shown in quest log as part of quest objective (same/opposite faction)
57 int32 RequiredFactionValue[PVP_TEAMS_COUNT] = { }; // shown in quest log as part of quest objective (same/opposite faction)
58
59 uint32 RewardNextQuest = 0; // client will request this quest from NPC, if not 0
60 uint32 RewardXPDifficulty = 0; // used for calculating rewarded experience
61 int32 RewardMoney = 0; // reward money (below max lvl)
62 uint32 RewardBonusMoney = 0; // used in XP calculation at client
63 uint32 RewardDisplaySpell = 0; // reward spell, this spell will be displayed (icon) (cast if RewSpellCast == 0)
66 float RewardKillHonor = 0.0f;
69 uint32 RewardTitleId = 0; // new 2.4.0, player gets this title (id from CharTitles)
74
81
83 float POIx = 0.0f;
84 float POIy = 0.0f;
86 std::string Title;
87 std::string Objectives;
88 std::string Details;
89 std::string AreaDescription;
90 std::string CompletedText; // display in quest objectives window once all objectives are completed
91
92 int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT] = { }; // >0 Creature <0 Gameobject
94
96 // uint32 ItemDropQuantity[QUEST_SOURCE_ITEM_IDS_COUNT] = { };
97
100
102 };
103
105 {
106 public:
108
109 WorldPacket const* Write() override;
110
112 };
113
115 {
116 QuestChoiceItem(uint32 itemID, uint32 quantity, uint32 displayID) : ItemID(itemID), Quantity(quantity),
117 DisplayID(displayID) { }
121 };
122
124 {
125 std::vector<QuestChoiceItem> UnfilteredChoiceItems;
126 std::vector<QuestChoiceItem> RewardItems;
130 float RewardKillHonor = 0.f;
137 std::array<uint32, QUEST_REPUTATIONS_COUNT> RewardFactionID = { };
138 std::array<int32, QUEST_REPUTATIONS_COUNT> RewardFactionValue = { };
139 std::array<int32, QUEST_REPUTATIONS_COUNT> RewardFactionValueOverride = { };
140 };
141
143 {
144 QuestDescEmote(int32 type, uint32 delay) : Type(type), Delay(delay) { }
147 };
148
150 {
151 public:
153
154 WorldPacket const* Write() override;
155
159 std::string Title;
160 std::string Details;
161 std::string Objectives;
162 bool AutoLaunched = false;
165 bool StartCheat = false;
167 std::vector<QuestDescEmote> DescEmotes;
168 };
169
171 {
172 public:
174
175 WorldPacket const* Write() override;
176
179 std::string Title;
180 std::string RewardText;
181 bool AutoLaunched = false;
184 std::vector<QuestDescEmote> Emotes;
186 };
187 }
188}
189
190#endif // QuestPackets_h__
int32_t int32
Definition: Define.h:129
uint32_t uint32
Definition: Define.h:133
#define QUEST_REWARDS_COUNT
Definition: QuestDef.h:42
#define QUEST_ITEM_OBJECTIVES_COUNT
Definition: QuestDef.h:39
#define QUEST_OBJECTIVES_COUNT
Definition: QuestDef.h:38
#define QUEST_REPUTATIONS_COUNT
Definition: QuestDef.h:44
#define QUEST_SOURCE_ITEM_IDS_COUNT
Definition: QuestDef.h:40
#define QUEST_REWARD_CHOICES_COUNT
Definition: QuestDef.h:41
uint8 constexpr PVP_TEAMS_COUNT
WorldPacket const * Write() override
QueryQuestInfo(WorldPacket &&packet)
Definition: QuestPackets.h:32
std::vector< QuestDescEmote > DescEmotes
Definition: QuestPackets.h:167
WorldPacket const * Write() override
@ CMSG_QUEST_QUERY
Definition: Opcodes.h:121
@ SMSG_QUEST_GIVER_OFFER_REWARD_MESSAGE
Definition: Opcodes.h:426
@ SMSG_QUEST_GIVER_QUEST_DETAILS
Definition: Opcodes.h:421
@ SMSG_QUEST_QUERY_RESPONSE
Definition: Opcodes.h:122
STL namespace.
QuestChoiceItem(uint32 itemID, uint32 quantity, uint32 displayID)
Definition: QuestPackets.h:116
QuestDescEmote(int32 type, uint32 delay)
Definition: QuestPackets.h:144
int32 RewardFactionValueOverride[QUEST_REPUTATIONS_COUNT]
Definition: QuestPackets.h:80
uint32 RewardAmount[QUEST_REWARDS_COUNT]
Definition: QuestPackets.h:76
uint32 ItemDrop[QUEST_SOURCE_ITEM_IDS_COUNT]
Definition: QuestPackets.h:95
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT]
Definition: QuestPackets.h:93
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]
Definition: QuestPackets.h:101
uint32 RewardFactionID[QUEST_REPUTATIONS_COUNT]
Definition: QuestPackets.h:78
uint32 RewardItems[QUEST_REWARDS_COUNT]
Definition: QuestPackets.h:75
uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]
Definition: QuestPackets.h:99
int32 RequiredFactionValue[PVP_TEAMS_COUNT]
Definition: QuestPackets.h:57
QuestInfoChoiceItem UnfilteredChoiceItems[QUEST_REWARD_CHOICES_COUNT]
Definition: QuestPackets.h:77
int32 RewardFactionValue[QUEST_REPUTATIONS_COUNT]
Definition: QuestPackets.h:79
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]
Definition: QuestPackets.h:98
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]
Definition: QuestPackets.h:92
uint32 RequiredFactionId[PVP_TEAMS_COUNT]
Definition: QuestPackets.h:56
std::array< int32, QUEST_REPUTATIONS_COUNT > RewardFactionValueOverride
Definition: QuestPackets.h:139
std::vector< QuestChoiceItem > RewardItems
Definition: QuestPackets.h:126
std::array< uint32, QUEST_REPUTATIONS_COUNT > RewardFactionID
Definition: QuestPackets.h:137
std::vector< QuestChoiceItem > UnfilteredChoiceItems
Definition: QuestPackets.h:125
std::array< int32, QUEST_REPUTATIONS_COUNT > RewardFactionValue
Definition: QuestPackets.h:138