TrinityCore
GarrisonPackets.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 GarrisonPackets_h__
19#define GarrisonPackets_h__
20
21#include "Packet.h"
22#include "ItemPacketsCommon.h"
23#include "ObjectGuid.h"
24#include "Optional.h"
25#include "Position.h"
26#include "PacketUtilities.h"
27#include <list>
28#include <unordered_set>
29#include <vector>
30
31struct GarrAbilityEntry;
32
33namespace WorldPackets
34{
35 namespace Garrison
36 {
38 {
39 public:
41
42 WorldPacket const* Write() override;
43
46 };
47
49 {
50 public:
52
53 WorldPacket const* Write() override;
54
57 };
58
59 class GetGarrisonInfo final : public ClientPacket
60 {
61 public:
63
64 void Read() override { }
65 };
66
68 {
72 };
73
75 {
80 Timestamp<> TimeSpecCooldown = time_t(2288912640); // 06/07/1906 18:35:44 - another in the series of magic blizz dates
81 bool Active = false;
82 };
83
85 {
96 std::list<GarrAbilityEntry const*> AbilityID;
102 std::string CustomName;
103 };
104
106 {
108 std::vector<int32> Mechanics;
114 };
115
117 {
126 };
127
129 {
134 Timestamp<> StartTime = time_t(2288912640);
140 float MissionScalar = 1.0f;
142 std::vector<GarrisonEncounter> Encounters;
143 std::vector<GarrisonMissionReward> Rewards;
144 std::vector<GarrisonMissionReward> OvermaxRewards;
145 };
146
148 {
151 };
152
154 {
157 };
158
160 {
166 };
167
169 {
172 };
173
175 {
177 std::vector<GarrisonCollectionEntry> Entries;
178 };
179
181 {
184 };
185
187 {
189 std::vector<GarrisonEventEntry> Events;
190 };
191
193 {
196 };
197
199 {
204 uint32 NumMissionsStartedToday = 0; // might mean something else, but sending 0 here enables follower abilities "Increase success chance of the first mission of the day by %."
206 std::vector<GarrisonPlotInfo*> Plots;
207 std::vector<GarrisonBuildingInfo const*> Buildings;
208 std::vector<GarrisonFollower const*> Followers;
209 std::vector<GarrisonFollower const*> AutoTroops;
210 std::vector<GarrisonMission const*> Missions;
211 std::vector<std::vector<GarrisonMissionReward>> MissionRewards;
212 std::vector<std::vector<GarrisonMissionReward>> MissionOvermaxRewards;
213 std::vector<GarrisonMissionBonusAbility const*> MissionAreaBonuses;
214 std::vector<GarrisonTalent> Talents;
215 std::vector<GarrisonCollection> Collections;
216 std::vector<GarrisonEventList> EventLists;
217 std::vector<GarrisonSpecGroup> SpecGroups;
218 std::vector<bool> CanStartMission;
219 std::vector<int32> ArchivedMissions;
220 };
221
223 {
226 };
227
229 {
230 public:
232
233 WorldPacket const* Write() override;
234
236 std::vector<GarrisonInfo> Garrisons;
237 std::vector<FollowerSoftCapInfo> FollowerSoftCaps;
238 };
239
241 {
243 GarrisonRemoteBuildingInfo(uint32 plotInstanceId, uint32 buildingId) : GarrPlotInstanceID(plotInstanceId), GarrBuildingID(buildingId) { }
244
247 };
248
250 {
252 std::vector<GarrisonRemoteBuildingInfo> Buildings;
253 };
254
255 class GarrisonRemoteInfo final : public ServerPacket
256 {
257 public:
259
260 WorldPacket const* Write() override;
261
262 std::vector<GarrisonRemoteSiteInfo> Sites;
263 };
264
266 {
267 public:
269
270 void Read() override;
271
275 };
276
278 {
279 public:
281
282 WorldPacket const* Write() override;
283
288 };
289
291 {
292 public:
294
295 void Read() override;
296
299 };
300
302 {
303 public:
305
306 WorldPacket const* Write() override;
307
312 };
313
315 {
316 public:
318
319 WorldPacket const* Write() override;
320
324 };
325
327 {
328 public:
330
331 WorldPacket const* Write() override;
332
336 };
337
339 {
340 public:
342
343 void Read() override { }
344 };
345
347 {
348 public:
350
351 WorldPacket const* Write() override;
352
354 std::unordered_set<uint32> const* SpecializationsKnown = nullptr;
355 std::unordered_set<uint32> const* BlueprintsKnown = nullptr;
356 };
357
358 class GarrisonGetMapData final : public ClientPacket
359 {
360 public:
362
363 void Read() override { }
364 };
365
367 {
369 GarrisonBuildingMapData(uint32 buildingPlotInstId, Position const& pos) : GarrBuildingPlotInstID(buildingPlotInstId), Pos(pos) { }
370
373 };
374
376 {
377 public:
379
380 WorldPacket const* Write() override;
381
382 std::vector<GarrisonBuildingMapData> Buildings;
383 };
384
385 class GarrisonPlotPlaced final : public ServerPacket
386 {
387 public:
389
390 WorldPacket const* Write() override;
391
394 };
395
397 {
398 public:
400
401 WorldPacket const* Write() override;
402
404 };
405
407 {
408 public:
409 GarrisonAddFollowerResult() : ServerPacket(SMSG_GARRISON_ADD_FOLLOWER_RESULT, 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 5 * 4 + 4) { }
410
411 WorldPacket const* Write() override;
412
416 };
417
419 {
420 public:
422
423 WorldPacket const* Write() override;
424
429 };
430
432 {
433 public:
435
436 WorldPacket const* Write() override;
437
439 };
440 }
441}
442
443#endif // GarrisonPackets_h__
int64_t int64
Definition: Define.h:137
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
std::vector< GarrisonBuildingMapData > Buildings
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< GarrisonRemoteSiteInfo > Sites
std::vector< FollowerSoftCapInfo > FollowerSoftCaps
@ CMSG_GARRISON_CANCEL_CONSTRUCTION
Definition: Opcodes.h:347
@ CMSG_GARRISON_GET_MAP_DATA
Definition: Opcodes.h:353
@ CMSG_GARRISON_PURCHASE_BUILDING
Definition: Opcodes.h:357
@ CMSG_GET_GARRISON_INFO
Definition: Opcodes.h:375
@ CMSG_GARRISON_REQUEST_BLUEPRINT_AND_SPECIALIZATION_DATA
Definition: Opcodes.h:362
@ SMSG_GARRISON_UNLEARN_BLUEPRINT_RESULT
Definition: Opcodes.h:1332
@ SMSG_GARRISON_REQUEST_BLUEPRINT_AND_SPECIALIZATION_DATA_RESULT
Definition: Opcodes.h:1320
@ SMSG_GARRISON_BUILDING_ACTIVATED
Definition: Opcodes.h:1276
@ SMSG_GARRISON_MAP_DATA_RESPONSE
Definition: Opcodes.h:1304
@ SMSG_GARRISON_PLOT_REMOVED
Definition: Opcodes.h:1312
@ SMSG_GARRISON_DELETE_RESULT
Definition: Opcodes.h:1289
@ SMSG_GARRISON_PLOT_PLACED
Definition: Opcodes.h:1311
@ SMSG_GARRISON_REMOVE_FOLLOWER_RESULT
Definition: Opcodes.h:1318
@ SMSG_GET_GARRISON_INFO_RESULT
Definition: Opcodes.h:1341
@ SMSG_GARRISON_BUILDING_REMOVED
Definition: Opcodes.h:1277
@ SMSG_GARRISON_LEARN_BLUEPRINT_RESULT
Definition: Opcodes.h:1300
@ SMSG_GARRISON_ADD_FOLLOWER_RESULT
Definition: Opcodes.h:1270
@ SMSG_GARRISON_PLACE_BUILDING_RESULT
Definition: Opcodes.h:1310
@ SMSG_GARRISON_REMOTE_INFO
Definition: Opcodes.h:1314
@ SMSG_GARRISON_CREATE_RESULT
Definition: Opcodes.h:1287
STL namespace.
GarrisonBuildingMapData(uint32 buildingPlotInstId, Position const &pos)
std::vector< GarrisonCollectionEntry > Entries
std::vector< GarrisonEventEntry > Events
std::list< GarrAbilityEntry const * > AbilityID
std::vector< GarrisonTalent > Talents
std::vector< GarrisonEventList > EventLists
std::vector< GarrisonPlotInfo * > Plots
std::vector< GarrisonMissionBonusAbility const * > MissionAreaBonuses
std::vector< GarrisonFollower const * > AutoTroops
std::vector< GarrisonFollower const * > Followers
std::vector< GarrisonMission const * > Missions
std::vector< std::vector< GarrisonMissionReward > > MissionRewards
std::vector< GarrisonCollection > Collections
std::vector< std::vector< GarrisonMissionReward > > MissionOvermaxRewards
std::vector< GarrisonBuildingInfo const * > Buildings
std::vector< GarrisonSpecGroup > SpecGroups
Optional< Item::ItemInstance > ItemInstance
std::vector< GarrisonEncounter > Encounters
std::vector< GarrisonMissionReward > Rewards
std::vector< GarrisonMissionReward > OvermaxRewards
TaggedPosition< Position::XYZO > PlotPos
GarrisonRemoteBuildingInfo(uint32 plotInstanceId, uint32 buildingId)
std::vector< GarrisonRemoteBuildingInfo > Buildings
Optional< GarrisonTalentSocketData > Socket