1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYCORE_GAME_OBJECT_PACKETS_H
#define TRINITYCORE_GAME_OBJECT_PACKETS_H
#include "ObjectGuid.h"
#include "Packet.h"
enum class PlayerInteractionType : int32;
namespace WorldPackets
{
namespace GameObject
{
class GameObjUse final : public ClientPacket
{
public:
explicit GameObjUse(WorldPacket&& packet) : ClientPacket(CMSG_GAME_OBJ_USE, std::move(packet)) { }
void Read() override;
ObjectGuid Guid;
};
class GameObjReportUse final : public ClientPacket
{
public:
explicit GameObjReportUse(WorldPacket&& packet) : ClientPacket(CMSG_GAME_OBJ_REPORT_USE, std::move(packet)) { }
void Read() override;
ObjectGuid Guid;
};
class GameObjectDespawn final : public ServerPacket
{
public:
explicit GameObjectDespawn() : ServerPacket(SMSG_GAME_OBJECT_DESPAWN, 16) { }
WorldPacket const* Write() override;
ObjectGuid ObjectGUID;
};
class PageText final : public ServerPacket
{
public:
explicit PageText() : ServerPacket(SMSG_PAGE_TEXT, 16) { }
WorldPacket const* Write() override;
ObjectGuid GameObjectGUID;
};
class GameObjectActivateAnimKit final : public ServerPacket
{
public:
explicit GameObjectActivateAnimKit() : ServerPacket(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, 16 + 4 + 1) { }
WorldPacket const* Write() override;
ObjectGuid ObjectGUID;
int32 AnimKitID = 0;
bool Maintain = false;
};
class DestructibleBuildingDamage final : public ServerPacket
{
public:
explicit DestructibleBuildingDamage() : ServerPacket(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, 16 + 16 + 16 + 4 + 4) { }
WorldPacket const* Write() override;
ObjectGuid Target;
ObjectGuid Caster;
ObjectGuid Owner;
int32 Damage = 0;
int32 SpellID = 0;
};
class FishNotHooked final : public ServerPacket
{
public:
explicit FishNotHooked() : ServerPacket(SMSG_FISH_NOT_HOOKED, 0) { }
WorldPacket const* Write() override { return &_worldPacket; }
};
class FishEscaped final : public ServerPacket
{
public:
explicit FishEscaped() : ServerPacket(SMSG_FISH_ESCAPED, 0) { }
WorldPacket const* Write() override { return &_worldPacket; }
};
class GameObjectCustomAnim final : public ServerPacket
{
public:
explicit GameObjectCustomAnim() : ServerPacket(SMSG_GAME_OBJECT_CUSTOM_ANIM, 16 + 4 + 1) { }
WorldPacket const* Write() override;
ObjectGuid ObjectGUID;
uint32 CustomAnim = 0;
bool PlayAsDespawn = false;
};
class GameObjectPlaySpellVisual final : public ServerPacket
{
public:
explicit GameObjectPlaySpellVisual() : ServerPacket(SMSG_GAME_OBJECT_PLAY_SPELL_VISUAL, 16 + 16 + 4) { }
WorldPacket const* Write() override;
ObjectGuid ObjectGUID;
ObjectGuid ActivatorGUID;
int32 SpellVisualID = 0;
};
class GameObjectSetStateLocal final : public ServerPacket
{
public:
explicit GameObjectSetStateLocal() : ServerPacket(SMSG_GAME_OBJECT_SET_STATE_LOCAL, 16 + 1) { }
WorldPacket const* Write() override;
ObjectGuid ObjectGUID;
uint8 State = 0;
};
class GameObjectInteraction final : public ServerPacket
{
public:
explicit GameObjectInteraction() : ServerPacket(SMSG_GAME_OBJECT_INTERACTION, 16 + 4) { }
WorldPacket const* Write() override;
ObjectGuid ObjectGUID;
PlayerInteractionType InteractionType = {};
};
class GameObjectCloseInteraction final : public ServerPacket
{
public:
explicit GameObjectCloseInteraction() : ServerPacket(SMSG_GAME_OBJECT_CLOSE_INTERACTION, 4) { }
WorldPacket const* Write() override;
PlayerInteractionType InteractionType = {};
};
}
}
#endif // TRINITYCORE_GAME_OBJECT_PACKETS_H
|