CommonLibSSE NG
BGSEncounterZone.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FormTypes.h"
4 #include "RE/T/TESForm.h"
5 
6 namespace RE
7 {
8  struct ENCOUNTER_ZONE_DATA // DATA
9  {
10  public:
11  enum class Flag
12  {
13  kNone = 0,
14  kNeverResets = 1 << 0,
16  kDisableCombatBoundary = 1 << 2
17  };
18 
19  // members
22  std::int8_t ownerRank; // 10
23  std::int8_t minLevel; // 11
25  std::int8_t maxLevel; // 13
26  std::uint32_t pad14; // 14
27  };
28  static_assert(sizeof(ENCOUNTER_ZONE_DATA) == 0x18);
29 
31  {
32  public:
33  // members
34  std::uint32_t detachTime; // 00
35  std::uint32_t attachTime; // 04
36  std::uint32_t resetTime; // 08
37  std::uint16_t zoneLevel; // 0C
38  std::uint16_t pad0D; // 0D
39  };
40  static_assert(sizeof(ENCOUNTER_ZONE_GAME_DATA) == 0x10);
41 
42  class BGSEncounterZone : public TESForm
43  {
44  public:
45  inline static constexpr auto RTTI = RTTI_BGSEncounterZone;
46  inline static constexpr auto VTABLE = VTABLE_BGSEncounterZone;
47  inline static constexpr auto FORMTYPE = FormType::EncounterZone;
48 
49  struct ChangeFlags
50  {
51  enum ChangeFlag : std::uint32_t
52  {
53  kZoneFlags = 1 << 1,
54  kGameData = (std::uint32_t)1 << 31
55  };
56  };
57 
58  struct RecordFlags
59  {
60  enum RecordFlag : std::uint32_t
61  {
62  kDeleted = 1 << 5,
63  kIgnored = 1 << 12
64  };
65  };
66 
67  ~BGSEncounterZone() override; // 00
68 
69  // override (TESForm)
70  void InitializeData() override; // 04
71  bool Load(TESFile* a_mod) override; // 06
72  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
73  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
74  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
75  void InitItemImpl() override; // 13
76 
77  // members
78  ENCOUNTER_ZONE_DATA data; // 20 - DATA
80  };
81  static_assert(sizeof(BGSEncounterZone) == 0x48);
82 }
Definition: BGSEncounterZone.h:43
void Revert(BGSLoadFormBuffer *a_buf) override
void InitItemImpl() override
void InitializeData() override
ENCOUNTER_ZONE_GAME_DATA gameData
Definition: BGSEncounterZone.h:79
static constexpr auto FORMTYPE
Definition: BGSEncounterZone.h:47
ENCOUNTER_ZONE_DATA data
Definition: BGSEncounterZone.h:78
void SaveGame(BGSSaveFormBuffer *a_buf) override
bool Load(TESFile *a_mod) override
~BGSEncounterZone() override
static constexpr auto VTABLE
Definition: BGSEncounterZone.h:46
static constexpr auto RTTI
Definition: BGSEncounterZone.h:45
void LoadGame(BGSLoadFormBuffer *a_buf) override
Definition: BGSLoadFormBuffer.h:11
Definition: BGSLocation.h:68
Definition: BGSSaveFormBuffer.h:8
Definition: TESFaction.h:120
Definition: TESFile.h:17
Definition: TESForm.h:36
Definition: AbsorbEffect.h:6
constexpr std::array< REL::VariantID, 1 > VTABLE_BGSEncounterZone
Definition: Offsets_VTABLE.h:563
constexpr REL::VariantID RTTI_BGSEncounterZone(513900, 392438, 0x1ed96e0)
Definition: BGSEncounterZone.h:50
ChangeFlag
Definition: BGSEncounterZone.h:52
@ kGameData
Definition: BGSEncounterZone.h:54
@ kZoneFlags
Definition: BGSEncounterZone.h:53
Definition: BGSEncounterZone.h:59
RecordFlag
Definition: BGSEncounterZone.h:61
@ kDeleted
Definition: BGSEncounterZone.h:62
@ kIgnored
Definition: BGSEncounterZone.h:63
Definition: BGSEncounterZone.h:9
std::uint32_t pad14
Definition: BGSEncounterZone.h:26
stl::enumeration< Flag, std::uint8_t > flags
Definition: BGSEncounterZone.h:24
std::int8_t maxLevel
Definition: BGSEncounterZone.h:25
std::int8_t minLevel
Definition: BGSEncounterZone.h:23
TESFaction * zoneOwner
Definition: BGSEncounterZone.h:20
BGSLocation * location
Definition: BGSEncounterZone.h:21
Flag
Definition: BGSEncounterZone.h:12
std::int8_t ownerRank
Definition: BGSEncounterZone.h:22
Definition: BGSEncounterZone.h:31
std::uint32_t attachTime
Definition: BGSEncounterZone.h:35
std::uint32_t detachTime
Definition: BGSEncounterZone.h:34
std::uint32_t resetTime
Definition: BGSEncounterZone.h:36
std::uint16_t pad0D
Definition: BGSEncounterZone.h:38
std::uint16_t zoneLevel
Definition: BGSEncounterZone.h:37