diff --git a/include/RE/B/BGSStoryManagerTreeForm.h b/include/RE/B/BGSStoryManagerTreeForm.h new file mode 100644 index 00000000..bd10ee74 --- /dev/null +++ b/include/RE/B/BGSStoryManagerTreeForm.h @@ -0,0 +1,13 @@ +#pragma once + +#include "RE/T/TESForm.h" + +namespace RE +{ + class __declspec(novtable) BGSStoryManagerTreeForm : + public TESForm + { + public: + SF_RTTI_VTABLE(BGSStoryManagerTreeForm); + }; +} diff --git a/include/RE/B/BGSStoryTeller.h b/include/RE/B/BGSStoryTeller.h new file mode 100644 index 00000000..5dc06a84 --- /dev/null +++ b/include/RE/B/BGSStoryTeller.h @@ -0,0 +1,34 @@ +#pragma once + +#include "RE/B/BSTArray.h" + +namespace RE +{ + class TESQuest; + + class __declspec(novtable) BGSStoryTeller + { + public: + SF_RTTI_VTABLE(BGSStoryTeller); + + [[nodiscard]] static BGSStoryTeller* GetSingleton() + { + static REL::Relocation singleton{ REL::ID(878850) }; + return *singleton; + } + + // members + std::byte pad00[0x38]; + BSTArray queuedStartQuests; + BSTArray runningQuests; + BSTArray queuedStopQuests; + std::byte pad70[0x10]; + BSTArray unk78; + BSTArray unk88; + }; + static_assert(offsetof(BGSStoryTeller, queuedStartQuests) == 0x38); + static_assert(offsetof(BGSStoryTeller, runningQuests) == 0x48); + static_assert(offsetof(BGSStoryTeller, queuedStopQuests) == 0x58); + static_assert(offsetof(BGSStoryTeller, unk78) == 0x78); + static_assert(offsetof(BGSStoryTeller, unk88) == 0x88); +} diff --git a/include/RE/E/Events.h b/include/RE/E/Events.h index 8a1960ba..2f44e9c5 100644 --- a/include/RE/E/Events.h +++ b/include/RE/E/Events.h @@ -9,10 +9,7 @@ namespace RE class Actor; class TESObjectCELL; class TESObjectREFR; -} -namespace RE::Events -{ struct TESLoadGameEvent { [[nodiscard]] static BSTEventSource* GetEventSource() @@ -105,7 +102,7 @@ namespace RE::Events // members NiPointer actor; TESFormID baseObject; - std::uint32_t origRef; + TESFormID origRef; std::uint16_t uniqueID; bool equipped; }; @@ -122,6 +119,7 @@ namespace RE::Events return func(); } + // members NiPointer ref; }; @@ -134,6 +132,7 @@ namespace RE::Events return func(); } + // members NiPointer ref; }; }; @@ -180,6 +179,7 @@ namespace RE::Events return func(); } + // members NiPointer source; NiPointer target; std::uint32_t state; @@ -333,7 +333,7 @@ namespace RE::Events } }; - struct BGSPlanet + namespace BGSPlanet { struct PlayerKnowledgeFlagSetEvent { @@ -2880,7 +2880,7 @@ namespace RE::Events } }; - struct ModelReferenceEffectEvents + namespace ModelReferenceEffectEvents { struct ReferenceEffectFinished { @@ -3132,7 +3132,7 @@ namespace RE::Events } }; - struct Spaceship + namespace Spaceship { struct TakeOffEvent { @@ -3567,7 +3567,7 @@ namespace RE::Events [[nodiscard]] static BSTEventSource* GetEventSource() { using func_t = decltype(&TESCellFullyLoadedEvent::GetEventSource); - static REL::Relocation func{ REL::ID(107143) }; + static REL::Relocation func{ ID::TESCellFullyLoadedEvent::GetEventSource }; return func(); } @@ -3580,17 +3580,37 @@ namespace RE::Events [[nodiscard]] static BSTEventSource* GetEventSource() { using func_t = decltype(&TESContainerChangedEvent::GetEventSource); - static REL::Relocation func{ REL::ID(107155) }; + static REL::Relocation func{ ID::TESContainerChangedEvent::GetEventSource }; + return func(); + } + + // members + TESFormID source; // 00 + TESFormID target; // 04 + TESFormID baseObject; // 08 + std::uint32_t itemCount; // 0C + TESFormID itemRef; // 10 + std::uint16_t uniqueID; // 14 + std::uint64_t unk18; // 18 + std::uint32_t unk20; // 20 + }; + static_assert(sizeof(TESContainerChangedEvent) == 0x28); + + struct TESDeathEvent + { + [[nodiscard]] static BSTEventSource* GetEventSource() + { + using func_t = decltype(&TESDeathEvent::GetEventSource); + static REL::Relocation func{ ID::TESDeathEvent::GetEventSource }; return func(); } // members - TESFormID source; // 00 - TESFormID target; // 04 - TESFormID item; // 08 - std::uint32_t itemCount; // 0C - std::uint32_t itemRef; // 10 + NiPointer actorDying; // 00 + NiPointer actorKiller; // 08 + bool dead; // 10 }; + static_assert(sizeof(TESDeathEvent) == 0x18); struct TESFormDeleteEvent { @@ -3615,8 +3635,8 @@ namespace RE::Events } // members - std::uint32_t oldFormID; - std::uint32_t newFormID; + TESFormID oldFormID; + TESFormID newFormID; }; struct TESFurnitureEvent @@ -3654,14 +3674,17 @@ namespace RE::Events [[nodiscard]] static BSTEventSource* GetEventSource() { using func_t = decltype(&TESObjectLoadedEvent::GetEventSource); - static REL::Relocation func{ REL::ID(107177) }; + static REL::Relocation func{ ID::TESObjectLoadedEvent::GetEventSource }; return func(); } // members - TESFormID formID; - bool loaded; + TESFormID formID; // 00 + bool loaded; // 04 + std::uint8_t pad05; // 05 + std::uint16_t pad06; // 06 }; + static_assert(sizeof(TESObjectLoadedEvent) == 0x8); struct TESPickNewIdleEvent { diff --git a/include/RE/M/Main.h b/include/RE/M/Main.h index c1ff67c4..854a7649 100644 --- a/include/RE/M/Main.h +++ b/include/RE/M/Main.h @@ -1,28 +1,47 @@ #pragma once +#include "RE/B/BSTEvent.h" + namespace RE { class NiAVObject; class NiCamera; - class Main + struct PositionPlayerEvent; + + class Main : + public BSTEventSink { public: + SF_RTTI_VTABLE(Main); + struct SceneGraphRoot { - std::byte unk[120]; - NiAVObject* worldCameraRoot; //NiNode - NiCamera* worldCamera; + // members + std::byte pad00[0x78]; // 00 + NiAVObject* worldCameraRoot; // 78 - NiNode + NiCamera* worldCamera; // 80 }; // static_assert(offsetof(SceneGraphRoot, SceneGraphRoot::worldCamera) == 0x80); // FIXME: clang-cl chokes on this assertion - static SceneGraphRoot* WorldRoot() + virtual ~Main(); // 00 + + // override + virtual BSEventNotifyControl ProcessEvent(const PositionPlayerEvent& a_event, BSTEventSource* a_source) override; // 01 + + [[nodiscard]] static Main* GetSingleton() { - static REL::Relocation singleton{ REL::ID(887308) }; + static REL::Relocation singleton{ REL::ID(881027) }; return *singleton; } - static NiCamera* WorldCamera() + [[nodiscard]] static SceneGraphRoot* WorldRoot() + { + static REL::Relocation worldRoot{ REL::ID(887308) }; + return *worldRoot; + } + + [[nodiscard]] static NiCamera* WorldRootCamera() { return WorldRoot()->worldCamera; } diff --git a/include/RE/P/ProcessLists.h b/include/RE/P/ProcessLists.h new file mode 100644 index 00000000..77fe46fa --- /dev/null +++ b/include/RE/P/ProcessLists.h @@ -0,0 +1,43 @@ +#pragma once + +#include "RE/B/BSTArray.h" +#include "RE/B/BSTEvent.h" +#include "RE/B/BSTSingleton.h" + +namespace RE +{ + struct PositionPlayerEvent; + + class __declspec(novtable) ProcessLists : + public BSTEventSink, // 000 + public BSTSingletonSDM // 008 + { + public: + SF_RTTI_VTABLE(ProcessLists); + + virtual ~ProcessLists(); // 00 + + // override + virtual BSEventNotifyControl ProcessEvent(const PositionPlayerEvent&, BSTEventSource*) override; // 01 + + [[nodiscard]] static ProcessLists* GetSingleton() + { + static REL::Relocation singleton{ REL::ID(878338) }; + return *singleton; + } + + // members + std::byte pad10[0x3B]; // 010 + bool runDetection; // 044 + std::byte pad45[0x13]; // 045 + BSTArray highActorHandles; // 058 + BSTArray lowActorHandles; // 068 + BSTArray middleHighActorHandles; // 078 + BSTArray middleLowActorHandles; // 088 + }; + static_assert(offsetof(ProcessLists, runDetection) == 0x44); + static_assert(offsetof(ProcessLists, highActorHandles) == 0x58); + static_assert(offsetof(ProcessLists, lowActorHandles) == 0x68); + static_assert(offsetof(ProcessLists, middleHighActorHandles) == 0x78); + static_assert(offsetof(ProcessLists, middleLowActorHandles) == 0x88); +} diff --git a/include/RE/Starfield.h b/include/RE/Starfield.h index 4ca18526..60a6b327 100644 --- a/include/RE/Starfield.h +++ b/include/RE/Starfield.h @@ -156,6 +156,8 @@ #include "RE/B/BGSSpeechChallengeObject.h" #include "RE/B/BGSStar.h" #include "RE/B/BGSStaticCollection.h" +#include "RE/B/BGSStoryManagerTreeForm.h" +#include "RE/B/BGSStoryTeller.h" #include "RE/B/BGSSunPresetForm.h" #include "RE/B/BGSSurfaceBlock.h" #include "RE/B/BGSSurfacePattern.h" @@ -319,6 +321,7 @@ #include "RE/P/PlasmaProjectile.h" #include "RE/P/PlayerCamera.h" #include "RE/P/PlayerCharacter.h" +#include "RE/P/ProcessLists.h" #include "RE/P/Profiler.h" #include "RE/P/Projectile.h" #include "RE/P/PropertyGroupInfo.h" @@ -366,15 +369,12 @@ #include "RE/T/TESBoundAnimObject.h" #include "RE/T/TESBoundObject.h" #include "RE/T/TESCamera.h" -#include "RE/T/TESCellFullyLoadedEvent.h" #include "RE/T/TESClass.h" #include "RE/T/TESClimate.h" #include "RE/T/TESCombatStyle.h" #include "RE/T/TESCondition.h" #include "RE/T/TESContainer.h" -#include "RE/T/TESContainerChangedEvent.h" #include "RE/T/TESDataHandler.h" -#include "RE/T/TESDeathEvent.h" #include "RE/T/TESDescription.h" #include "RE/T/TESEffectShader.h" #include "RE/T/TESEnchantableForm.h" @@ -383,7 +383,6 @@ #include "RE/T/TESFile.h" #include "RE/T/TESFlora.h" #include "RE/T/TESForm.h" -#include "RE/T/TESFormIDRemapEvent.h" #include "RE/T/TESFormRefCount.h" #include "RE/T/TESFullName.h" #include "RE/T/TESFurniture.h" @@ -414,7 +413,6 @@ #include "RE/T/TESObjectCONT.h" #include "RE/T/TESObjectDOOR.h" #include "RE/T/TESObjectLIGH.h" -#include "RE/T/TESObjectLoadedEvent.h" #include "RE/T/TESObjectMISC.h" #include "RE/T/TESObjectREFR.h" #include "RE/T/TESObjectSTAT.h" diff --git a/include/RE/T/TESCellFullyLoadedEvent.h b/include/RE/T/TESCellFullyLoadedEvent.h deleted file mode 100644 index d71b5dd4..00000000 --- a/include/RE/T/TESCellFullyLoadedEvent.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "RE/B/BSTEvent.h" - -namespace RE -{ - class TESObjectCELL; - - struct TESCellFullyLoadedEvent - { - public: - [[nodiscard]] static BSTEventSource* GetEventSource() - { - using func_t = decltype(&TESCellFullyLoadedEvent::GetEventSource); - static REL::Relocation func{ ID::TESCellFullyLoadedEvent::GetEventSource }; - return func(); - } - - // members - TESObjectCELL* cell; - }; - static_assert(sizeof(TESCellFullyLoadedEvent) == 0x8); -} diff --git a/include/RE/T/TESContainerChangedEvent.h b/include/RE/T/TESContainerChangedEvent.h deleted file mode 100644 index c6d00e4b..00000000 --- a/include/RE/T/TESContainerChangedEvent.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "RE/B/BSCoreTypes.h" -#include "RE/B/BSTEvent.h" - -namespace RE -{ - struct TESContainerChangedEvent - { - public: - [[nodiscard]] static BSTEventSource* GetEventSource() - { - using func_t = decltype(&TESContainerChangedEvent::GetEventSource); - static REL::Relocation func{ ID::TESContainerChangedEvent::GetEventSource }; - return func(); - } - - // members - TESFormID oldContainerFormID; // 00 - TESFormID newContainerFormID; // 04 - TESFormID baseObjectFormID; // 08 - std::int32_t itemCount; // 0C - TESFormID referenceFormID; // 10 - std::uint16_t uniqueID; // 14 - std::uint64_t unk18; // 18 - std::uint32_t unk20; // 20 - }; - static_assert(sizeof(TESContainerChangedEvent) == 0x28); -} diff --git a/include/RE/T/TESDeathEvent.h b/include/RE/T/TESDeathEvent.h deleted file mode 100644 index 9e98bbeb..00000000 --- a/include/RE/T/TESDeathEvent.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "RE/B/BSTEvent.h" -#include "RE/N/NiSmartPointer.h" - -namespace RE -{ - class TESObjectREFR; - - struct TESDeathEvent - { - public: - [[nodiscard]] static BSTEventSource* GetEventSource() - { - using func_t = decltype(&TESDeathEvent::GetEventSource); - static REL::Relocation func{ ID::TESDeathEvent::GetEventSource }; - return func(); - } - - // members - NiPointer actorDying; // 00 - NiPointer actorKiller; // 08 - bool dead; // 10 - }; - static_assert(sizeof(TESDeathEvent) == 0x18); -} diff --git a/include/RE/T/TESFormIDRemapEvent.h b/include/RE/T/TESFormIDRemapEvent.h deleted file mode 100644 index 4641b60f..00000000 --- a/include/RE/T/TESFormIDRemapEvent.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "RE/B/BSCoreTypes.h" -#include "RE/B/BSTEvent.h" - -namespace RE -{ - class TESObjectCELL; - - struct TESFormIDRemapEvent - { - [[nodiscard]] static BSTEventSource* GetEventSource() - { - using func_t = decltype(&TESFormIDRemapEvent::GetEventSource); - static REL::Relocation func{ REL::ID(107167) }; - return func(); - } - - // members - TESFormID oldId; - TESFormID newId; - }; - static_assert(sizeof(TESFormIDRemapEvent) == 0x8); -} diff --git a/include/RE/T/TESObjectLoadedEvent.h b/include/RE/T/TESObjectLoadedEvent.h deleted file mode 100644 index 48e9f0d8..00000000 --- a/include/RE/T/TESObjectLoadedEvent.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "RE/B/BSCoreTypes.h" -#include "RE/B/BSTEvent.h" - -namespace RE -{ - struct TESObjectLoadedEvent - { - [[nodiscard]] static BSTEventSource* GetEventSource() - { - using func_t = decltype(&TESObjectLoadedEvent::GetEventSource); - static REL::Relocation func{ ID::TESObjectLoadedEvent::GetEventSource }; - return func(); - } - - // members - TESFormID formID; // 0 - bool loaded; // 4 - std::uint8_t pad5; // 5 - std::uint16_t pad6; // 6 - }; - static_assert(sizeof(TESObjectLoadedEvent) == 0x8); -} diff --git a/include/RE/T/TESQuest.h b/include/RE/T/TESQuest.h index 932861b4..4622fffc 100644 --- a/include/RE/T/TESQuest.h +++ b/include/RE/T/TESQuest.h @@ -1,13 +1,31 @@ #pragma once -#include "RE/T/TESForm.h" +#include "RE/B/BGSStoryManagerTreeForm.h" namespace RE { - class TESQuest : public TESForm + class __declspec(novtable) TESQuest : + public BGSStoryManagerTreeForm { public: SF_RTTI_VTABLE(TESQuest); SF_FORMTYPE(QUST); + + // DNAM + struct QUEST_DATA + { + // members + float questDelayTime; // 0 + std::uint16_t flags; // 4 + std::int8_t priority; // 6 + std::uint8_t questType; // 7 + }; + static_assert(sizeof(QUEST_DATA) == 0x8); + + ~TESQuest() override; // 00 + + // members + std::byte pad38[0xD6]; // 038 + QUEST_DATA data; // 108 }; }