aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Player/EquipmentSet.h
blob: 00ec331e30d44fc54dc031d9ba2834df1bfcb2da (plain)
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
/*
 * 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_EQUIPMENT_SET_H
#define TRINITYCORE_EQUIPMENT_SET_H

#include "Define.h"
#include "ObjectGuid.h"
#include "Optional.h"
#include <array>
#include <map>

enum EquipmentSetUpdateState
{
    EQUIPMENT_SET_UNCHANGED = 0,
    EQUIPMENT_SET_CHANGED   = 1,
    EQUIPMENT_SET_NEW       = 2,
    EQUIPMENT_SET_DELETED   = 3
};

#define EQUIPMENT_SET_SLOTS 19

struct EquipmentSetInfo
{
    enum EquipmentSetType : int32
    {
        EQUIPMENT   = 0,
        TRANSMOG    = 1
    };

    /// Data sent in EquipmentSet related packets
    struct EquipmentSetData
    {
        EquipmentSetType Type = EQUIPMENT;
        uint64 Guid = 0;                                        ///< Set Identifier
        uint32 SetID = 0;                                       ///< Index
        uint32 IgnoreMask = 0;                                  ///< Mask of EquipmentSlot
        Optional<int32> AssignedSpecIndex;                      ///< Index of character specialization that this set is automatically equipped for
        std::string SetName;
        std::string SetIcon;
        std::array<ObjectGuid, EQUIPMENT_SET_SLOTS> Pieces = {};
        std::array<int32, EQUIPMENT_SET_SLOTS> Appearances = {};///< ItemModifiedAppearanceID
        std::array<int32, 2> Enchants = {};                     ///< SpellItemEnchantmentID
        int32 SecondaryShoulderApparanceID = 0;                 ///< Secondary shoulder appearance
        int32 SecondaryShoulderSlot = 0;                        ///< Always 2 if secondary shoulder apperance is used
        int32 SecondaryWeaponAppearanceID = 0;                  ///< For legion artifacts: linked child item appearance
        int32 SecondaryWeaponSlot = 0;                          ///< For legion artifacts: which slot is used by child item
    } Data;

    /// Server-side data
    EquipmentSetUpdateState State = EQUIPMENT_SET_NEW;
};

#define MAX_EQUIPMENT_SET_INDEX 20                          // client limit

typedef std::map<uint64, EquipmentSetInfo> EquipmentSetContainer;

#endif // TRINITYCORE_EQUIPMENT_SET_H