diff --git a/cmake/sourcelist.cmake b/cmake/sourcelist.cmake index 88c09ccb5..f95c17a30 100644 --- a/cmake/sourcelist.cmake +++ b/cmake/sourcelist.cmake @@ -95,6 +95,7 @@ set(SOURCES include/RE/B/BGSEntryPointFunctionData.h include/RE/B/BGSEntryPointFunctionDataActivateChoice.h include/RE/B/BGSEntryPointFunctionDataOneValue.h + include/RE/B/BGSEntryPointFunctionDataSpellItem.h include/RE/B/BGSEntryPointFunctionDataText.h include/RE/B/BGSEntryPointPerkEntry.h include/RE/B/BGSEquipSlot.h @@ -709,6 +710,7 @@ set(SOURCES include/RE/F/FavoritesMenu.h include/RE/F/FightReactions.h include/RE/F/FileID.h + include/RE/F/FindMaxMagnitudeVisitor.h include/RE/F/FirstPersonState.h include/RE/F/FixedStrings.h include/RE/F/FlameProjectile.h @@ -1754,6 +1756,7 @@ set(SOURCES src/RE/E/ExtraSoul.cpp src/RE/E/ExtraTextDisplayData.cpp src/RE/E/ExtraUniqueID.cpp + src/RE/F/FindMaxMagnitudeVisitor.cpp src/RE/F/FormTypes.cpp src/RE/F/FxDelegate.cpp src/RE/F/FxDelegateArgs.cpp diff --git a/include/RE/B/BGSEntryPointFunctionDataSpellItem.h b/include/RE/B/BGSEntryPointFunctionDataSpellItem.h new file mode 100644 index 000000000..1eaf64c16 --- /dev/null +++ b/include/RE/B/BGSEntryPointFunctionDataSpellItem.h @@ -0,0 +1,27 @@ +#pragma once + +#include "RE/B/BGSEntryPointFunctionData.h" + +namespace RE +{ + class SpellItem; + + class BGSEntryPointFunctionDataSpellItem : public BGSEntryPointFunctionData + { + public: + inline static constexpr auto RTTI = RTTI_BGSEntryPointFunctionDataSpellItem; + inline static constexpr auto VTABLE = VTABLE_BGSEntryPointFunctionDataSpellItem; + // Override + virtual ~BGSEntryPointFunctionDataSpellItem() override; // 0 + + // Override (BGSEntryPointFunctionData) + [[nodiscard]] virtual FunctionType GetType() const override; // 1 + virtual bool LoadFunctionData(TESFile* a_mod) override; // 2 + virtual void ResolveForms(TESFile* a_form) override; // 3 + + // Member variables + SpellItem* spell; // 8 + }; + static_assert(offsetof(BGSEntryPointFunctionDataSpellItem, spell) == 0x8); + static_assert(sizeof(BGSEntryPointFunctionDataSpellItem) == 0x10); +} diff --git a/include/RE/F/FindMaxMagnitudeVisitor.h b/include/RE/F/FindMaxMagnitudeVisitor.h new file mode 100644 index 000000000..d4692f2c4 --- /dev/null +++ b/include/RE/F/FindMaxMagnitudeVisitor.h @@ -0,0 +1,28 @@ +#pragma once + +#include "RE/M/MagicTarget.h" + +namespace RE +{ + class ActiveEffect; + + class FindMaxMagnitudeVisitor : + public MagicTarget::ForEachActiveEffectVisitor + { + public: + inline static constexpr auto RTTI = RTTI_FindMaxMagnitudeVisitor; + inline static constexpr auto VTABLE = VTABLE_FindMaxMagnitudeVisitor; + + virtual ~FindMaxMagnitudeVisitor(){}; // 00 + + // add + virtual BSContainer::ForEachResult Accept(ActiveEffect* a_effect) override; // 01 + + // Member variables + ActiveEffect* activeEffect{ nullptr }; // 8 + float maxMagnitude{ -1.0F }; // 10 + }; + static_assert(sizeof(FindMaxMagnitudeVisitor) == 0x18); + + +} // namespace RE diff --git a/include/RE/M/MiddleHighProcessData.h b/include/RE/M/MiddleHighProcessData.h index ffcf6316b..dd1be6302 100644 --- a/include/RE/M/MiddleHighProcessData.h +++ b/include/RE/M/MiddleHighProcessData.h @@ -199,7 +199,7 @@ namespace RE float unk2B0; // 2B0 float bleedoutRate; // 2B4 float unk2B8; // 2B8 - float unk2BC; // 2BC + float maximumWardPower; // 2BC float unk2C0; // 2C0 float torchEvaluationTimer; // 2C4 float alphaMult; // 2C8 diff --git a/include/RE/Skyrim.h b/include/RE/Skyrim.h index 6e0bddf22..2f57d7c90 100644 --- a/include/RE/Skyrim.h +++ b/include/RE/Skyrim.h @@ -98,6 +98,7 @@ #include "RE/B/BGSEntryPointFunctionData.h" #include "RE/B/BGSEntryPointFunctionDataActivateChoice.h" #include "RE/B/BGSEntryPointFunctionDataOneValue.h" +#include "RE/B/BGSEntryPointFunctionDataSpellItem.h" #include "RE/B/BGSEntryPointFunctionDataText.h" #include "RE/B/BGSEntryPointPerkEntry.h" #include "RE/B/BGSEquipSlot.h" @@ -711,6 +712,7 @@ #include "RE/F/FavoritesMenu.h" #include "RE/F/FightReactions.h" #include "RE/F/FileID.h" +#include "RE/F/FindMaxMagnitudeVisitor.h" #include "RE/F/FirstPersonState.h" #include "RE/F/FixedStrings.h" #include "RE/F/FlameProjectile.h" diff --git a/src/RE/F/FindMaxMagnitudeVisitor.cpp b/src/RE/F/FindMaxMagnitudeVisitor.cpp new file mode 100644 index 000000000..a54740349 --- /dev/null +++ b/src/RE/F/FindMaxMagnitudeVisitor.cpp @@ -0,0 +1,13 @@ +#pragma once + +#include "RE/F/FindMaxMagnitudeVisitor.h" + +namespace RE +{ + BSContainer::ForEachResult FindMaxMagnitudeVisitor::Accept(ActiveEffect* a_effect) + { + using func_t = decltype(&FindMaxMagnitudeVisitor::Accept); + REL::Relocation func{ reinterpret_cast(RELOCATION_ID(257550, 205805).address())[0x1] }; // AE address/ID untested + return func(this, a_effect); + } +} // namespace RE