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 * 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 NPCPackets_h__
19#define NPCPackets_h__
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23#include "Position.h"
24#include <array>
25
26namespace WorldPackets
27{
28 namespace NPC
29 {
30 // CMSG_BANKER_ACTIVATE
31 // CMSG_BATTLEMASTER_HELLO
32 // CMSG_BINDER_ACTIVATE
33 // CMSG_GOSSIP_HELLO
34 // CMSG_LIST_INVENTORY
35 // CMSG_TRAINER_LIST
36 class Hello final : public ClientPacket
37 {
38 public:
39 Hello(WorldPacket&& packet) : ClientPacket(std::move(packet)) { }
40
41 void Read() override;
42
44 };
45
47 {
51 std::array<int32, 2> PointCost = { }; // compared with PLAYER_CHARACTER_POINTS in Lua
55 std::array<int32, 3> ReqAbility = { };
56 };
57
58 class TrainerList final : public ServerPacket
59 {
60 public:
62
63 WorldPacket const* Write() override;
64
67 std::vector<TrainerListSpell> Spells;
68 std::string Greeting;
69 };
70
71 class GossipPOI final : public ServerPacket
72 {
73 public:
74 GossipPOI() : ServerPacket(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 32) { }
75
76 WorldPacket const* Write() override;
77
82 std::string Name;
83 };
84
85 class TrainerBuySpell final : public ClientPacket
86 {
87 public:
89
90 void Read() override;
91
94 };
95
96 class TrainerBuyFailed final : public ServerPacket
97 {
98 public:
100
101 WorldPacket const* Write() override;
102
106 };
107
109 {
110 public:
112
113 WorldPacket const* Write() override;
114
117 };
118 }
119}
120
121#endif // NPCPackets_h__
uint8_t uint8
Definition: Define.h:135
int32_t int32
Definition: Define.h:129
uint32_t uint32
Definition: Define.h:133
TaggedPosition< Position::XY > Pos
Definition: NPCPackets.h:79
WorldPacket const * Write() override
Definition: NPCPackets.cpp:48
void Read() override
Definition: NPCPackets.cpp:20
Hello(WorldPacket &&packet)
Definition: NPCPackets.h:39
WorldPacket const * Write() override
Definition: NPCPackets.cpp:65
TrainerBuySpell(WorldPacket &&packet)
Definition: NPCPackets.h:88
WorldPacket const * Write() override
Definition: NPCPackets.cpp:74
WorldPacket const * Write() override
Definition: NPCPackets.cpp:25
std::vector< TrainerListSpell > Spells
Definition: NPCPackets.h:67
@ SMSG_TRAINER_BUY_SUCCEEDED
Definition: Opcodes.h:464
@ SMSG_TRAINER_BUY_FAILED
Definition: Opcodes.h:465
@ SMSG_GOSSIP_POI
Definition: Opcodes.h:577
@ CMSG_TRAINER_BUY_SPELL
Definition: Opcodes.h:463
@ SMSG_TRAINER_LIST
Definition: Opcodes.h:462
STL namespace.
std::array< int32, 3 > ReqAbility
Definition: NPCPackets.h:55
std::array< int32, 2 > PointCost
Definition: NPCPackets.h:51