Skip to content

Commit

Permalink
feat: IDs and misc. function declaration. (#23)
Browse files Browse the repository at this point in the history
* chore: Update 2 IDs.

* chore: Another ID update.

* chore: Two IDs updated.

* feat: Add `UnequipItem` function.

* feat: Addition function in 'GameplayFormulas'.

* feat: Declared 'LIMB_ENUM' & 'CAUSE_OF_DEATH' enums in
'BGSBodyPartDefs.h'.
feat: Update ID in events.

* fix: Missing 'None' entry.

* feat: Declared `TESHarvestEvent` proper.

* feat: `LevelIncrease` event source declared, .163 ID.

* feat: ID update.

* feat: Declared ´SetFavorite´ function in 'ExtraDataList'.
  • Loading branch information
FlenarnTemp authored Nov 2, 2024
1 parent f5f8562 commit 74769a8
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,13 @@ namespace RE
return func(this, a_force);
}

BGSBodyPartData* GetBodyPartData()
{
using func_t = decltype(&Actor::GetBodyPartData);
static REL::Relocation<func_t> func{ REL::ID(2229571) };
return func(this);
}

// members
NiTFlags<std::uint32_t, Actor> niFlags; // 2D0
float updateTargetTimer; // 2D4
Expand Down
43 changes: 43 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BGSBodyPartDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@

namespace RE::BGSBodyPartDefs
{
enum class LIMB_ENUM : std::uint32_t
{
kNone = 0xFFFFFFFF,
kTorso = 0x0,
kHead1 = 0x1,
kEye1 = 0x2,
kLookAt1 = 0x3,
kFlyGrab = 0x4,
kHead2 = 0x5,
kLeftArm1 = 0x6,
kLeftArm2 = 0x7,
kRightArm1 = 0x8,
kRightArm2 = 0x9,
kLeftLeg1 = 0xA,
kLeftLeg2 = 0xB,
kLeftLeg3 = 0xC,
kRightLeg1 = 0xD,
kRightLeg2 = 0xE,
kRightLeg3 = 0xF,
kBrain = 0x10,
kWeapon = 0x11,
kRoot = 0x12,
kCom = 0x13,
kPelvis = 0x14,
kCamera = 0x15,
kOffsetRoot = 0x16,
kLeftFoot = 0x17,
kRightFoot = 0x18,
kFaceTargetSource = 0x19
};

enum class CAUSE_OF_DEATH : std::uint32_t
{
kCauseOfDeathNone = 0xFFFFFFFF,
kCauseOfDeathExplosion = 0x0,
kCauseOfDeathGun = 0x1,
kCauseOfDeathBluntWeapon = 0x2,
kCauseOfDeathHandToHand = 0x3,
kCauseOfDeathObjectImpact = 0x4,
kCauseOfDeathPoison = 0x5,
kCauseOfDeathDecapitation = 0x6
};

struct HitReactionData
{
public:
Expand Down
7 changes: 7 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,13 @@ namespace RE
return func(this, a_compare, a_qualifier);
}

void SetFavorite(char a_quickkeyIndex)
{
using func_t = decltype(&ExtraDataList::SetFavorite);
static REL::Relocation<func_t> func{ REL::ID(2190188) };
return func(this, a_quickkeyIndex);
}

// members
BaseExtraList extraData; // 08
mutable BSReadWriteLock extraRWLock; // 20
Expand Down
29 changes: 28 additions & 1 deletion CommonLibF4/include/RE/Bethesda/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,19 @@ namespace RE
{
struct Event
{
[[nodiscard]] static BSTEventSource<Event>* GetEventSource()
{
using func_t = decltype(&Event::GetEventSource);
static REL::Relocation<func_t> func{ REL::ID(349120) }; // .163
return func();
}

std::uint32_t newLevel; // 00
};
static_assert(sizeof(Event) == 0x4);
}


namespace LoadingStatusChanged
{
struct Event
Expand Down Expand Up @@ -959,7 +967,7 @@ namespace RE
[[nodiscard]] static BSTEventSource<TESHitEvent>* GetEventSource()
{
using func_t = decltype(&TESHitEvent::GetEventSource);
static REL::Relocation<func_t> func{ REL::ID(1411899) };
static REL::Relocation<func_t> func{ REL::ID(2201886) };
return func();
}

Expand Down Expand Up @@ -1021,6 +1029,25 @@ namespace RE
};
static_assert(sizeof(TESSwitchRaceCompleteEvent) == 0x8);

namespace TESHarvestEvent
{
struct ItemHarvested
{
[[nodiscard]] static BSTEventSource<ItemHarvested>* GetEventSource()
{
using func_t = decltype(&ItemHarvested::GetEventSource);
static REL::Relocation<func_t> func{ REL::ID(2193351) };
return func();
}

// members
const TESBoundObject* itemHarvested; // 00
TESObjectREFR* referenceHarvested; // 08
const Actor* harvestedBy; // 10
};
static_assert(sizeof(ItemHarvested) == 0x18);
};

class TutorialEvent
{
public:
Expand Down
5 changes: 0 additions & 5 deletions CommonLibF4/include/RE/Bethesda/Projectiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ namespace RE
enum class COL_LAYER;
enum class ImpactResult;

namespace BGSBodyPartDefs
{
enum class LIMB_ENUM;
}

namespace MagicSystem
{
enum class CastingSource;
Expand Down
5 changes: 0 additions & 5 deletions CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ namespace RE
enum class CastingSource;
}

namespace BGSBodyPartDefs
{
enum class LIMB_ENUM;
}

class ActorCause;
class BGSAnimationSequencer;
class BGSDecalGroup;
Expand Down

0 comments on commit 74769a8

Please sign in to comment.