TrinityCore
Loading...
Searching...
No Matches
DuelPackets.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_DUEL_PACKETS_H
19#define TRINITYCORE_DUEL_PACKETS_H
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23
24namespace WorldPackets
25{
26 namespace Duel
27 {
28 class CanDuel final : public ClientPacket
29 {
30 public:
31 explicit CanDuel(WorldPacket&& packet) : ClientPacket(CMSG_CAN_DUEL, std::move(packet)) { }
32
33 void Read() override;
34
36 bool ToTheDeath = false;
37 };
38
39 class CanDuelResult final : public ServerPacket
40 {
41 public:
43
44 WorldPacket const* Write() override;
45
47 bool Result = false;
48 };
49
50 class DuelComplete final : public ServerPacket
51 {
52 public:
54
55 WorldPacket const* Write() override;
56
57 bool Started = false;
58 };
59
60 class DuelCountdown final : public ServerPacket
61 {
62 public:
63 explicit DuelCountdown(uint32 countdown) : ServerPacket(SMSG_DUEL_COUNTDOWN, 4), Countdown(countdown) { }
64
65 WorldPacket const* Write() override;
66
68 };
69
70 class DuelInBounds final : public ServerPacket
71 {
72 public:
74
75 WorldPacket const* Write() override { return &_worldPacket; }
76 };
77
78 class DuelOutOfBounds final : public ServerPacket
79 {
80 public:
82
83 WorldPacket const* Write() override { return &_worldPacket; }
84 };
85
86 class DuelRequested final : public ServerPacket
87 {
88 public:
89 explicit DuelRequested() : ServerPacket(SMSG_DUEL_REQUESTED, 16 * 3 + 1) { }
90
91 WorldPacket const* Write() override;
92
96 bool ToTheDeath = false;
97 };
98
99 class DuelResponse final : public ClientPacket
100 {
101 public:
102 explicit DuelResponse(WorldPacket&& packet) : ClientPacket(CMSG_DUEL_RESPONSE, std::move(packet)) { }
103
104 void Read() override;
105
107 bool Accepted = false;
108 bool Forfeited = false;
109 };
110
111 class DuelWinner final : public ServerPacket
112 {
113 public:
114 explicit DuelWinner() : ServerPacket(SMSG_DUEL_WINNER, 4 * 4 + 1) { }
115
116 WorldPacket const* Write() override;
117
118 std::string BeatenName;
119 std::string WinnerName;
122 bool Fled = false;
123 };
124 }
125}
126
127#endif // TRINITYCORE_DUEL_PACKETS_H
uint32_t uint32
Definition Define.h:154
@ SMSG_DUEL_OUT_OF_BOUNDS
Definition Opcodes.h:1431
@ SMSG_DUEL_WINNER
Definition Opcodes.h:1433
@ SMSG_CAN_DUEL_RESULT
Definition Opcodes.h:1276
@ SMSG_DUEL_IN_BOUNDS
Definition Opcodes.h:1430
@ SMSG_DUEL_COUNTDOWN
Definition Opcodes.h:1429
@ SMSG_DUEL_COMPLETE
Definition Opcodes.h:1428
@ SMSG_DUEL_REQUESTED
Definition Opcodes.h:1432
@ CMSG_DUEL_RESPONSE
Definition Opcodes.h:337
@ CMSG_CAN_DUEL
Definition Opcodes.h:175
WorldPacket const * Write() override
CanDuel(WorldPacket &&packet)
Definition DuelPackets.h:31
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
Definition DuelPackets.h:75
WorldPacket const * Write() override
Definition DuelPackets.h:83
WorldPacket const * Write() override
DuelResponse(WorldPacket &&packet)
WorldPacket const * Write() override
WorldPacket _worldPacket
Definition Packet.h:43
STL namespace.