TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NPCPackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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 NPCPackets_h__
19 #define NPCPackets_h__
20 
21 #include "Packet.h"
22 #include "ItemPackets.h"
23 #include "Creature.h"
24 
25 #include "G3D/Vector2.h"
26 
27 namespace WorldPackets
28 {
29  namespace NPC
30  {
31  // CMSG_BANKER_ACTIVATE
32  // CMSG_BINDER_ACTIVATE
33  // CMSG_BINDER_CONFIRM
34  // CMSG_GOSSIP_HELLO
35  // CMSG_LIST_INVENTORY
36  // CMSG_TRAINER_LIST
37  // CMSG_BATTLEMASTER_HELLO
38  class Hello final : public ClientPacket
39  {
40  public:
41  Hello(WorldPacket&& packet) : ClientPacket(std::move(packet)) { }
42 
43  void Read() override;
44 
46  };
47 
49  {
54  std::string Text;
55  std::string Confirm;
56  };
57 
59  {
63  bool Repeatable = false;
64  std::string QuestTitle;
65  int32 QuestFlags[2] = { };
66  };
67 
68  class GossipMessage final : public ServerPacket
69  {
70  public:
72 
73  WorldPacket const* Write() override;
74 
75  std::vector<ClientGossipOptions> GossipOptions;
78  std::vector<ClientGossipText> GossipText;
81  };
82 
83  class GossipSelectOption final : public ClientPacket
84  {
85  public:
87 
88  void Read() override;
89 
93  std::string PromotionCode;
94  };
95 
96  class GossipComplete final : public ServerPacket
97  {
98  public:
100 
101  WorldPacket const* Write() override { return &_worldPacket; }
102  };
103 
104  struct VendorItem
105  {
106  int32 MuID = 0;
107  int32 Type = 0;
115  bool DoNotFilterOnVendor = false;
116  };
117 
118  class VendorInventory final : public ServerPacket
119  {
120  public:
122 
123  WorldPacket const* Write() override;
124 
126  std::vector<VendorItem> Items;
128  };
129 
131  {
139  };
140 
141  class TrainerList final : public ServerPacket
142  {
143  public:
145 
146  WorldPacket const* Write() override;
147 
148  std::string Greeting;
152  std::vector<TrainerListSpell> Spells;
153  };
154 
155  class ShowBank final : public ServerPacket
156  {
157  public:
159 
160  WorldPacket const* Write() override;
161 
163  };
164 
166  {
167  public:
169 
170  WorldPacket const* Write() override;
171 
173  };
174 
175  class SuppressNPCGreetings final : public ServerPacket
176  {
177  public:
179 
180  WorldPacket const* Write() override;
181 
183  bool SuppressNPCGreeting = false;
184  };
185 
186  class GossipPOI final : public ServerPacket
187  {
188  public:
189  GossipPOI() : ServerPacket(SMSG_GOSSIP_POI, 2 + 2 * 4 + 4 + 4 + 1) { }
190 
191  WorldPacket const* Write() override;
192 
195  int32 Icon = 0;
197  std::string Name;
198  };
199 
200  class SpiritHealerActivate final : public ClientPacket
201  {
202  public:
204 
205  void Read() override;
206 
208  };
209 
211  {
212  public:
214 
215  WorldPacket const* Write() override;
216 
218  };
219 
220  class TrainerBuySpell final : public ClientPacket
221  {
222  public:
224 
225  void Read() override;
226 
230  };
231 
232  class TrainerBuyFailed final : public ServerPacket
233  {
234  public:
236 
237  WorldPacket const* Write() override;
238 
242  };
243 
244  class RequestStabledPets final : public ClientPacket
245  {
246  public:
248 
249  void Read() override;
250 
252  };
253  }
254 }
255 
256 #endif // NPCPackets_h__
WorldPacket const * Write() override
Definition: NPCPackets.cpp:154
Definition: Opcodes.h:1056
Definition: Vector2.h:40
uint8 OptionFlags
Definition: NPCPackets.h:52
int32 Durability
Definition: NPCPackets.h:111
QuestType
Definition: SharedDefines.h:3769
int32 ExtendedCostID
Definition: NPCPackets.h:113
int32 GossipID
Definition: NPCPackets.h:92
TrainerType
Definition: SharedDefines.h:3541
ObjectGuid TrainerGUID
Definition: NPCPackets.h:150
SpiritHealerConfirm()
Definition: NPCPackets.h:213
Definition: Opcodes.h:1582
Definition: NPCPackets.h:244
int32 SpellID
Definition: NPCPackets.h:240
void Read() override
Definition: NPCPackets.cpp:195
Definition: Opcodes.h:301
ObjectGuid Unit
Definition: NPCPackets.h:217
Definition: NPCPackets.h:200
Definition: NPCPackets.h:130
PlayerTabardVendorActivate()
Definition: NPCPackets.h:168
Definition: Opcodes.h:1519
G3D::Vector2 Pos
Definition: NPCPackets.h:194
std::vector< VendorItem > Items
Definition: NPCPackets.h:126
std::string PromotionCode
Definition: NPCPackets.h:93
std::string Name
Definition: NPCPackets.h:197
Definition: Opcodes.h:1057
int32 StackCount
Definition: NPCPackets.h:112
ObjectGuid Vendor
Definition: NPCPackets.h:127
GossipMessage()
Definition: NPCPackets.h:71
Definition: Opcodes.h:1610
RequestStabledPets(WorldPacket &&packet)
Definition: NPCPackets.h:247
Definition: Opcodes.h:1564
STL namespace.
WorldPacket const * Write() override
Definition: NPCPackets.h:101
int32 SpellID
Definition: NPCPackets.h:229
SpiritHealerActivate(WorldPacket &&packet)
Definition: NPCPackets.h:203
int32 TrainerID
Definition: NPCPackets.h:151
Definition: NPCPackets.h:96
#define MAX_TRAINERSPELL_ABILITY_REQS
Definition: Creature.h:422
Definition: NPCPackets.h:232
bool Repeatable
Definition: NPCPackets.h:63
void Read() override
Definition: NPCPackets.cpp:167
uint32 Flags
Definition: NPCPackets.h:193
void Read() override
Definition: NPCPackets.cpp:128
Definition: NPCPackets.h:175
ObjectGuid StableMaster
Definition: NPCPackets.h:251
uint8 ReqLevel
Definition: NPCPackets.h:138
WorldPacket _worldPacket
Definition: Packet.h:43
ObjectGuid Vendor
Definition: NPCPackets.h:172
int32 OptionCost
Definition: NPCPackets.h:53
bool SuppressNPCGreeting
Definition: NPCPackets.h:183
Hello(WorldPacket &&packet)
Definition: NPCPackets.h:41
int32 FriendshipFactionID
Definition: NPCPackets.h:76
Definition: NPCPackets.h:118
SuppressNPCGreetings()
Definition: NPCPackets.h:178
Definition: Opcodes.h:577
Definition: NPCPackets.h:104
WorldPacket const * Write() override
Definition: NPCPackets.cpp:68
int32 ClientOption
Definition: NPCPackets.h:50
WorldPacket const * Write() override
Definition: NPCPackets.cpp:186
int32 PlayerConditionFailed
Definition: NPCPackets.h:114
Definition: Packet.h:59
WorldPacket const * Write() override
Definition: NPCPackets.cpp:93
TrainerList()
Definition: NPCPackets.h:144
std::vector< ClientGossipOptions > GossipOptions
Definition: NPCPackets.h:75
TrainerBuySpell(WorldPacket &&packet)
Definition: NPCPackets.h:223
Definition: NPCPackets.h:58
std::vector< TrainerListSpell > Spells
Definition: NPCPackets.h:152
GossipSelectOption(WorldPacket &&packet)
Definition: NPCPackets.h:86
Definition: Opcodes.h:1058
Definition: Opcodes.h:1549
GossipComplete()
Definition: NPCPackets.h:99
Definition: Packet.h:46
Definition: NPCPackets.h:48
Definition: NPCPackets.h:83
ObjectGuid UnitGUID
Definition: NPCPackets.h:182
WorldPacket const * Write() override
Definition: NPCPackets.cpp:138
std::vector< ClientGossipText > GossipText
Definition: NPCPackets.h:78
ObjectGuid GossipGUID
Definition: NPCPackets.h:77
int32_t int32
Definition: Define.h:146
ObjectGuid Guid
Definition: NPCPackets.h:162
uint32_t uint32
Definition: Define.h:150
Definition: NPCPackets.h:210
TrainerBuyFailed()
Definition: NPCPackets.h:235
WorldPacket const * Write() override
Definition: NPCPackets.cpp:145
std::string Greeting
Definition: NPCPackets.h:148
int32 GossipIndex
Definition: NPCPackets.h:91
int32 TextID
Definition: NPCPackets.h:79
ObjectGuid Healer
Definition: NPCPackets.h:207
Definition: NPCPackets.h:220
Definition: BattlegroundMgr.h:57
int32 ReqAbility[MAX_TRAINERSPELL_ABILITY_REQS]
Definition: NPCPackets.h:136
Definition: Opcodes.h:683
int32 TrainerFailedReason
Definition: NPCPackets.h:241
Definition: Opcodes.h:1581
uint8 Reason
Definition: NPCPackets.h:125
int32 Quantity
Definition: NPCPackets.h:109
int32 GossipID
Definition: NPCPackets.h:80
bool DoNotFilterOnVendor
Definition: NPCPackets.h:115
int32 TrainerID
Definition: NPCPackets.h:228
ShowBank()
Definition: NPCPackets.h:158
int32 MuID
Definition: NPCPackets.h:106
Definition: NPCPackets.h:141
VendorInventory()
Definition: NPCPackets.h:121
#define TC_GAME_API
Definition: Define.h:134
int32 ReqSkillLine
Definition: NPCPackets.h:134
uint8 OptionNPC
Definition: NPCPackets.h:51
int32 Price
Definition: NPCPackets.h:110
WorldPackets::Item::ItemInstance Item
Definition: NPCPackets.h:108
std::string Text
Definition: NPCPackets.h:54
uint8_t uint8
Definition: Define.h:152
int32 MoneyCost
Definition: NPCPackets.h:133
ObjectGuid TrainerGUID
Definition: NPCPackets.h:239
GossipPOI()
Definition: NPCPackets.h:189
Definition: NPCPackets.h:155
WorldPacket const * Write() override
Definition: NPCPackets.cpp:25
uint8 Usable
Definition: NPCPackets.h:137
Definition: ItemPackets.h:40
NPC
Definition: boss_razorscale.cpp:78
int32 Icon
Definition: NPCPackets.h:195
std::string Confirm
Definition: NPCPackets.h:55
Definition: ObjectGuid.h:189
int32 SpellID
Definition: NPCPackets.h:132
ObjectGuid TrainerGUID
Definition: NPCPackets.h:227
Definition: Opcodes.h:1370
WorldPacket const * Write() override
Definition: NPCPackets.cpp:121
int32 ReqSkillRank
Definition: NPCPackets.h:135
Type
Type of JSON value.
Definition: rapidjson.h:642
std::string QuestTitle
Definition: NPCPackets.h:64
void Read() override
Definition: NPCPackets.cpp:20
Definition: NPCPackets.h:38
int32 Importance
Definition: NPCPackets.h:196
int32 QuestID
Definition: NPCPackets.h:60
Definition: Opcodes.h:654
QuestFlags
Definition: QuestDef.h:139
Definition: WorldPacket.h:26
int32 QuestLevel
Definition: NPCPackets.h:62
ObjectGuid GossipUnit
Definition: NPCPackets.h:90
Definition: NPCPackets.h:68
Definition: NPCPackets.h:186
ObjectGuid Unit
Definition: NPCPackets.h:45
void Read() override
Definition: NPCPackets.cpp:179