Skip to content

Commit

Permalink
Merge pull request #9 from FalloutCascadia/master
Browse files Browse the repository at this point in the history
feat: Misc RE'ing. (#5)
  • Loading branch information
shad0wshayd3 authored May 14, 2024
2 parents d4badf1 + d9613a5 commit ae465ba
Show file tree
Hide file tree
Showing 18 changed files with 423 additions and 36 deletions.
1 change: 1 addition & 0 deletions CommonLibF4/cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ set(SOURCES
include/RE/Bethesda/MemoryManager.h
include/RE/Bethesda/MenuControls.h
include/RE/Bethesda/MenuCursor.h
include/RE/Bethesda/MenuTopicManager.h
include/RE/Bethesda/MessageMenuManager.h
include/RE/Bethesda/Movement.h
include/RE/Bethesda/NavMesh.h
Expand Down
16 changes: 8 additions & 8 deletions CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,14 +660,14 @@ namespace RE
[[nodiscard]] bool IsTakingHealthDamageFromActiveEffect()
{
using func_t = decltype(&MagicTarget::IsTakingHealthDamageFromActiveEffect);
REL::Relocation<func_t> func{ REL::ID(999442) };
REL::Relocation<func_t> func{ REL::ID(2226397) };
return func(this);
}

[[nodiscard]] bool IsTakingRadDamageFromActiveEffect()
{
using func_t = decltype(&MagicTarget::IsTakingRadDamageFromActiveEffect);
REL::Relocation<func_t> func{ REL::ID(1079111) };
REL::Relocation<func_t> func{ REL::ID(2226398) };
return func(this);
}

Expand Down Expand Up @@ -967,7 +967,7 @@ namespace RE
void AddPerk(BGSPerk* a_perk, std::uint8_t a_rank = 0)
{
using func_t = decltype(&Actor::AddPerk);
REL::Relocation<func_t> func{ REL::ID(187096) };
REL::Relocation<func_t> func{ REL::ID(2230121) };
return func(this, a_perk, a_rank);
}

Expand Down Expand Up @@ -1114,28 +1114,28 @@ namespace RE
bool IsFollowing()
{
using func_t = decltype(&Actor::IsFollowing);
REL::Relocation<func_t> func{ REL::ID(629579) };
REL::Relocation<func_t> func{ REL::ID(2230013) };
return func(this);
}

[[nodiscard]] bool IsJumping()
{
using func_t = decltype(&Actor::IsJumping);
REL::Relocation<func_t> func{ REL::ID(1041558) };
REL::Relocation<func_t> func{ REL::ID(2229640) };
return func(this);
}

bool IsPathValid()
{
using func_t = decltype(&Actor::IsPathValid);
REL::Relocation<func_t> func{ REL::ID(1522194) };
REL::Relocation<func_t> func{ REL::ID(2230279) };
return func(this);
}

bool IsPathing()
{
using func_t = decltype(&Actor::IsPathing);
REL::Relocation<func_t> func{ REL::ID(989661) };
REL::Relocation<func_t> func{ REL::ID(2234312) };
return func(this);
}

Expand Down Expand Up @@ -1184,7 +1184,7 @@ namespace RE
void RewardExperience(float a_amount, bool a_direct, TESObjectREFR* a_actionTarget, TESObjectREFR* a_killWeapon)
{
using func_t = decltype(&Actor::RewardExperience);
REL::Relocation<func_t> func{ REL::ID(262786) };
REL::Relocation<func_t> func{ REL::ID(2230428) };
return func(this, a_amount, a_direct, a_actionTarget, a_killWeapon);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/Archive2.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ namespace RE::BSResource::Archive2
bool a_block) override // 0B
{
using func_t = decltype(&AsyncReaderStream::DoWait);
REL::Relocation<func_t> func{ REL::ID(244066) };
REL::Relocation<func_t> func{ REL::ID(2269399) };
return func(this, a_transferred, a_block);
}

Expand Down
114 changes: 111 additions & 3 deletions CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "RE/Bethesda/BSFixedString.h"
#include "RE/Bethesda/BSTArray.h"
#include "RE/Bethesda/TESCondition.h"
#include "RE/Bethesda/TESForms.h"

namespace RE
{
Expand All @@ -11,6 +12,24 @@ namespace RE

namespace BGSCharacterTint
{
enum BlendOp : std::uint32_t
{
kDefault = 0,
kMultiply = 1,
kOverlay = 2,
kSoftLight = 3,
kHardLight = 4,
kTotal = 5
};

enum EntryType : std::uint32_t
{
kMask = 0x0,
kPalette = 0x1,
kTexture = 0x2,
kUnknown = 0x3
};

enum class EntrySlot
{
kForeheadMask,
Expand Down Expand Up @@ -49,31 +68,61 @@ namespace RE
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__Entry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__Entry };

enum Flags : std::uint32_t
{
kOnOffOnly = 0x1,
kIsChargenDetaul = 0x2,
kTakesSkinTone = 0x4
};

virtual ~Entry(); // 00

// add
virtual float GetDefaultValue() { return 0.0F; } // 01
virtual void InitItem(TESForm* a_owner); // 02
virtual void CopyData(Entry* a_copy); // 03
virtual void CopyData(BGSCharacterTint::Template::Entry* a_copy); // 03
virtual void LoadImpl(TESFile* a_file) = 0; // 04

// members
BGSLocalizedString name; // 08
TESCondition chargenConditions; // 10
stl::enumeration<EntrySlot, std::int32_t> slot; // 18
stl::enumeration<BGSCharacterTint::EntrySlot, std::int32_t> slot; // 18
const std::uint16_t uniqueID{ 0 }; // 1C
std::int8_t flags; // 1E
};
static_assert(sizeof(Entry) == 0x20);

class __declspec(novtable) Palette :
public BGSCharacterTint::Template::Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__Palette };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__Palette };

struct ColorValue
{
BGSColorForm* color; // 00
float value; // 08
BGSCharacterTint::BlendOp blendOp; // 0C
std::uint16_t swatchID; // 01
};
static_assert(sizeof(ColorValue) == 0x18);

// Members
BSFixedString maskTextureName;
std::uint32_t defaultIndex;
BSTArray<BGSCharacterTint::Template::Palette::ColorValue> colorValues;
};
static_assert(sizeof(Palette) == 0x48);

class Group
{
public:
// members
BGSLocalizedString name; // 00
std::uint32_t id; // 08
std::uint32_t chargenIndex; // 0C
BSTArray<Entry*> entries; // 10
BSTArray<BGSCharacterTint::Template::Entry*> entries; // 10
};
static_assert(sizeof(Group) == 0x28);

Expand All @@ -85,5 +134,64 @@ namespace RE
};
static_assert(sizeof(Groups) == 0x18);
}

class __declspec(novtable) Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Entry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Entry };

virtual ~Entry(); // 00

virtual bool GetIsIdentical(const Entry* entry); // 08
virtual bool CopyData(const Entry entry); // 10
virtual bool SetFromTemplateDefault(const BGSCharacterTint::Template::Entry* entry); // 18
virtual bool GetMatchesTemplateDefault(const BGSCharacterTint::Template::Entry* entry); // 20
virtual BGSCharacterTint::EntryType GetType(); // 28

// Members
BGSCharacterTint::Template::Entry* template; // 08
const std::uint16_t idLink; // 10
std::uint8_t tingingValue; // 12
};
static_assert(sizeof(Entry) == 0x18);

class __declspec(novtable) MaskEntry :
public BGSCharacterTint::Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__MaskEntry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__MaskEntry };
};
static_assert(sizeof(MaskEntry) == 0x18);

class __declspec(novtable) PaletteEntry :
public BGSCharacterTint::MaskEntry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__PaletteEntry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__PaletteEntry };

// members
std::uint32_t tintingColor; // 18
std::uint16_t swatchID; // 1C
};
static_assert(sizeof(PaletteEntry) == 0x20);

class __declspec(novtable) TextureSetEntry :
public BGSCharacterTint::Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__TextureSetEntry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__TextureSetEntry };
};
static_assert(sizeof(TextureSetEntry) == 0x18);

class Entries
{
public:
BSTArray<BGSCharacterTint::Entry* > entriesA;
};
static_assert(sizeof(Entries) == 0x18);
}
}
42 changes: 41 additions & 1 deletion CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace RE
{
class BGSBaseAlias;
class BGSQuestInstanceText;
class BGSQuestObjective;
class BGSRegisteredStoryEvent;
class BGSStoryEvent;
Expand Down Expand Up @@ -80,6 +79,39 @@ namespace RE
};
static_assert(sizeof(QUEST_DATA) == 0x8);

class BGSQuestInstanceText
{
public:
void ParseString(BSStringT<char>& inOutText, const TESQuest* quest, std::uint32_t instanceID)
{
using func_t = decltype(&BGSQuestInstanceText::ParseString);
REL::Relocation<func_t> func{ REL::ID(141681) }; // Update
return func(this, inOutText, quest, instanceID);
}

struct StringData
{
std::uint32_t aliasID;
std::uint32_t fullNameFormID;
};
static_assert(sizeof(StringData) == 0x8);

struct GlobabValueData
{
const TESGlobal* globab;
float value;
};
static_assert(sizeof(GlobabValueData) == 0x10);

// Members
std::uint32_t ID; // 00
BSTArray<BGSQuestInstanceText::StringData> StringData; // 08
BSTArray<BGSQuestInstanceText::GlobabValueData> ValueData; // 20
std::uint16_t JournalStage; // 38
std::uint16_t JournalStageItem; // 3A
};
static_assert(sizeof(BGSQuestInstanceText) == 0x40);

class __declspec(novtable) TESQuest :
public BGSStoryManagerTreeForm, // 000
public TESFullName // 028
Expand All @@ -100,6 +132,14 @@ namespace RE
return func(this, stage);
}

BSPointerHandle<TESObjectREFR>* GetAliasedRef(BSPointerHandle<TESObjectREFR>* a_result, std::uint32_t a_aiAliasID)
{
using func_t = decltype(&TESQuest::GetAliasedRef);
REL::Relocation<func_t> func{ REL::ID(2207810) };
return func(this, a_result, a_aiAliasID);
}


// members
BSTArray<BGSQuestInstanceText*> instanceData; // 038
std::uint32_t currentInstanceID; // 050
Expand Down
14 changes: 12 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ namespace RE
static constexpr auto VTABLE{ VTABLE::ExtraHealth };
static constexpr auto TYPE{ EXTRA_DATA_TYPE::kHealth };

ExtraHealth();
ExtraHealth(float health);


// members
float health; // 18
};
Expand Down Expand Up @@ -892,9 +896,15 @@ namespace RE
return func(this, a_form);
}

void SetHealthPercent(float a_healthPerc)
float GetHealthPerc()
{
using func_t = decltype(&ExtraDataList::GetHealthPerc);
REL::Relocation<func_t> func{ REL::ID(2190226) };
}

void SetHealthPerc(float a_healthPerc)
{
using func_t = decltype(&ExtraDataList::SetHealthPercent);
using func_t = decltype(&ExtraDataList::SetHealthPerc);
REL::Relocation<func_t> func{ REL::ID(2190124) };
return func(this, a_healthPerc);
}
Expand Down
7 changes: 7 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BSStringT.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ namespace RE
return *this;
}

bool Set(const char* apString, std::uint64_t auiMaxLen)
{
using func_t = decltype(&BSStringT::Set);
REL::Relocation<func_t> func{ REL::ID(2189084) };
return func(this, apString, auiMaxLen);
}

[[nodiscard]] const_pointer data() const noexcept { return _data; }
[[nodiscard]] pointer data() noexcept { return _data; }

Expand Down
Loading

0 comments on commit ae465ba

Please sign in to comment.