TrinityCore
Loading...
Searching...
No Matches
NPCPackets.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_NPC_PACKETS_H
19#define TRINITYCORE_NPC_PACKETS_H
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23#include "Position.h"
24#include <array>
25
27
28namespace WorldPackets
29{
30 namespace NPC
31 {
32 // CMSG_BANKER_ACTIVATE
33 // CMSG_BATTLEMASTER_HELLO
34 // CMSG_BINDER_ACTIVATE
35 // CMSG_GOSSIP_HELLO
36 // CMSG_LIST_INVENTORY
37 // CMSG_TRAINER_LIST
38 class Hello final : public ClientPacket
39 {
40 public:
41 explicit Hello(WorldPacket&& packet) : ClientPacket(std::move(packet)) { }
42
43 void Read() override;
44
46 };
47
49 {
54 std::string_view Text;
55 std::string_view Confirm;
56 };
57
59 {
63 bool Repeatable = false;
64 std::string_view QuestTitle;
66 };
67
69
71 {
72 public:
74
75 WorldPacket const* Write() override;
76
77 std::vector<ClientGossipOptions> GossipOptions;
79 std::vector<ClientGossipText> GossipText;
82 };
83
95
97 {
98 public:
100
101 WorldPacket const* Write() override;
102
104 std::vector<VendorItem> Items;
106 };
107
109 {
113 std::array<int32, 2> PointCost = { }; // compared with PLAYER_CHARACTER_POINTS in Lua
117 std::array<int32, 3> ReqAbility = { };
118 };
119
121 {
122 public:
124
125 WorldPacket const* Write() override;
126
129 std::vector<TrainerListSpell> Spells;
130 std::string Greeting;
131 };
132
134 {
135 public:
136 explicit GossipPOI() : ServerPacket(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 32) { }
137
138 WorldPacket const* Write() override;
139
144 std::string Name;
145 };
146
148 {
149 public:
151
152 void Read() override;
153
156 };
157
159 {
160 public:
162
163 WorldPacket const* Write() override;
164
168 };
169
171 {
172 public:
174
175 WorldPacket const* Write() override;
176
179 };
180 }
181}
182
183#endif // TRINITYCORE_NPC_PACKETS_H
uint8_t uint8
Definition Define.h:135
int8_t int8
Definition Define.h:131
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
GossipOptionIcon
Definition GossipDef.h:60
QuestFlags
Definition QuestDef.h:129
QuestType
Definition Item.h:62
WorldPacket const * Write() override
std::vector< ClientGossipOptions > GossipOptions
Definition NPCPackets.h:77
std::vector< ClientGossipText > GossipText
Definition NPCPackets.h:79
TaggedPosition< Position::XY > Pos
Definition NPCPackets.h:141
WorldPacket const * Write() override
Hello(WorldPacket &&packet)
Definition NPCPackets.h:41
WorldPacket const * Write() override
TrainerBuySpell(WorldPacket &&packet)
Definition NPCPackets.h:150
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< TrainerListSpell > Spells
Definition NPCPackets.h:129
WorldPacket const * Write() override
std::vector< VendorItem > Items
Definition NPCPackets.h:104
@ SMSG_GOSSIP_MESSAGE
Definition Opcodes.h:410
@ SMSG_TRAINER_BUY_SUCCEEDED
Definition Opcodes.h:464
@ SMSG_TRAINER_BUY_FAILED
Definition Opcodes.h:465
@ SMSG_LIST_INVENTORY
Definition Opcodes.h:444
@ SMSG_GOSSIP_POI
Definition Opcodes.h:577
@ CMSG_TRAINER_BUY_SPELL
Definition Opcodes.h:463
@ SMSG_TRAINER_LIST
Definition Opcodes.h:462
ByteBuffer & operator<<(ByteBuffer &data, ClientGossipOptions const &gossipOption)
STL namespace.
std::array< int32, 3 > ReqAbility
Definition NPCPackets.h:117
std::array< int32, 2 > PointCost
Definition NPCPackets.h:113