CommonLibVR
EnchantmentItem.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FormTypes.h"
4 #include "RE/M/MagicItem.h"
5 #include "RE/M/MagicSystem.h"
6 
7 namespace RE
8 {
9  class EnchantmentItem : public MagicItem
10  {
11  public:
12  inline static constexpr auto RTTI = RTTI_EnchantmentItem;
13  inline static constexpr auto VTABLE = VTABLE_EnchantmentItem;
14  inline static constexpr auto FORMTYPE = FormType::Enchantment;
15 
16  enum class EnchantmentFlag
17  {
18  kNone = 0,
19  kCostOverride = 1 << 0,
20  kFoodItem = 1 << 1,
21  kExtendDuration = 1 << 3
22  };
23 
24  struct RecordFlags
25  {
26  enum RecordFlag : std::uint32_t
27  {
28  kDeleted = 1 << 5,
29  kIgnored = 1 << 12
30  };
31  };
32 
33  class Data // ENIT
34  {
35  public:
36  // members
37  std::int32_t costOverride; // 00
40  std::int32_t chargeOverride; // 0C
43  float chargeTime; // 18
44  std::uint32_t pad1C; // 1C
47  };
48  static_assert(sizeof(Data) == 0x30);
49 
50  virtual ~EnchantmentItem(); // 00
51 
52  // override (MagicItem)
53  virtual void InitializeData() override; // 04
54  virtual void ClearData() override; // 05
55  virtual void InitItemImpl() override; // 13
56  virtual MagicSystem::SpellType GetSpellType() const override; // 53 - { return data.spellType; }
57  virtual void SetCastingType(MagicSystem::CastingType a_type) override; // 54 - { data.castingType = a_type; }
58  virtual MagicSystem::CastingType GetCastingType() const override; // 55 - { return data.castingType; }
59  virtual void SetDelivery(MagicSystem::Delivery a_type) override; // 56 - { if (Unk_58()) { data.delivery = a_type; } }
60  virtual MagicSystem::Delivery GetDelivery() const override; // 57 - { return data.delivery; }
61  virtual float GetChargeTime() const override; // 64
62  virtual ActorValue GetAssociatedSkill() const override; // 66 - { return ActorValue::kEnchanting; }
63  virtual std::uint32_t GetChunkID() override; // 68 - { return 'ENIT'; }
64  virtual void CopyMagicItemData(MagicItem* a_src) override; // 69
65  virtual const MagicItem::Data* GetData1() const override; // 6C - { return &data; }
66  virtual MagicItem::Data* GetData2() override; // 6D - { return &data; }
67  virtual std::uint32_t GetDataSize() const override; // 6E - { return 0x30; }
68  virtual void InitFromChunk(TESFile* a_mod) override; // 6F
69  virtual void InitChunk() override; // 70
70 
71  // members
72  Data data; // 90 - ENIT
73  private:
74  KEEP_FOR_RE()
75  };
76  static_assert(sizeof(EnchantmentItem) == 0xC0);
77 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BGSListForm.h:11
Definition: EnchantmentItem.h:34
MagicSystem::SpellType spellType
Definition: EnchantmentItem.h:42
std::uint32_t pad1C
Definition: EnchantmentItem.h:44
std::int32_t costOverride
Definition: EnchantmentItem.h:37
EnchantmentItem * baseEnchantment
Definition: EnchantmentItem.h:45
MagicSystem::Delivery delivery
Definition: EnchantmentItem.h:41
std::int32_t chargeOverride
Definition: EnchantmentItem.h:40
BGSListForm * wornRestrictions
Definition: EnchantmentItem.h:46
MagicSystem::CastingType castingType
Definition: EnchantmentItem.h:39
stl::enumeration< EnchantmentFlag, std::uint32_t > flags
Definition: EnchantmentItem.h:38
float chargeTime
Definition: EnchantmentItem.h:43
Definition: EnchantmentItem.h:10
virtual MagicSystem::SpellType GetSpellType() const override
virtual void InitializeData() override
EnchantmentFlag
Definition: EnchantmentItem.h:17
virtual void SetCastingType(MagicSystem::CastingType a_type) override
virtual void CopyMagicItemData(MagicItem *a_src) override
virtual const MagicItem::Data * GetData1() const override
virtual void InitChunk() override
virtual MagicSystem::CastingType GetCastingType() const override
static constexpr auto RTTI
Definition: EnchantmentItem.h:12
virtual float GetChargeTime() const override
static constexpr auto VTABLE
Definition: EnchantmentItem.h:13
virtual ~EnchantmentItem()
virtual std::uint32_t GetChunkID() override
virtual MagicItem::Data * GetData2() override
Data data
Definition: EnchantmentItem.h:72
virtual void SetDelivery(MagicSystem::Delivery a_type) override
virtual void ClearData() override
virtual std::uint32_t GetDataSize() const override
virtual ActorValue GetAssociatedSkill() const override
virtual MagicSystem::Delivery GetDelivery() const override
virtual void InitItemImpl() override
virtual void InitFromChunk(TESFile *a_mod) override
static constexpr auto FORMTYPE
Definition: EnchantmentItem.h:14
Definition: MagicItem.h:59
Definition: MagicItem.h:30
Definition: TESFile.h:17
SpellType
Definition: MagicSystem.h:64
CastingType
Definition: MagicSystem.h:35
Delivery
Definition: MagicSystem.h:43
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_EnchantmentItem(static_cast< std::uint64_t >(513878))
ActorValue
Definition: ActorValues.h:6
constexpr std::array< REL::ID, 3 > VTABLE_EnchantmentItem
Definition: Offsets_VTABLE.h:11467
Definition: EnchantmentItem.h:25
RecordFlag
Definition: EnchantmentItem.h:27
@ kIgnored
Definition: EnchantmentItem.h:29
@ kDeleted
Definition: EnchantmentItem.h:28