Skip to content

Commit ffe2979

Browse files
committed
feat: TESHitEvent
1 parent 41162e3 commit ffe2979

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

include/RE/E/Events.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
namespace RE
88
{
99
class Actor;
10+
class BGSAttackData;
1011
class BGSLocation;
12+
class bhkNPCollisionObject;
1113
class HUDModeType;
1214
class TESBoundObject;
1315
class TESObjectBOOK;
@@ -3756,6 +3758,54 @@ namespace RE
37563758
};
37573759
static_assert(sizeof(TESHarvestEvent::ItemHarvested) == 0x18);
37583760
};
3761+
3762+
struct DamageImpactData
3763+
{
3764+
// members
3765+
NiPoint3A location; // 00
3766+
NiPoint3A normal; // 10
3767+
NiPoint3A velocity; // 20
3768+
NiPointer<bhkNPCollisionObject> colObj; // 30
3769+
};
3770+
static_assert(sizeof(DamageImpactData) == 0x40);
3771+
3772+
class HitData
3773+
{
3774+
public:
3775+
// members
3776+
DamageImpactData impactData; // 00
3777+
std::uint32_t aggressor; // 40 - ActorHandle
3778+
std::uint32_t target; // 44 - ActorHandle
3779+
std::uint32_t sourceRef; // 48 - ObjectRefHandle
3780+
std::uint64_t attackData; // 50 - NiPointer<BGSAttackData>
3781+
BGSObjectInstanceT<TESObjectWEAP> weapon; // 58
3782+
SpellItem* criticalEffect; // 68
3783+
SpellItem* hitEffect; // 70
3784+
std::uint64_t unk78; // 78
3785+
const TESAmmo* ammo; // 80
3786+
std::byte pad88[0x68]; // 88
3787+
};
3788+
static_assert(sizeof(HitData) == 0xF0);
3789+
3790+
struct TESHitEvent
3791+
{
3792+
[[nodiscard]] static BSTEventSource<TESHitEvent>* GetEventSource()
3793+
{
3794+
using func_t = decltype(&TESHitEvent::GetEventSource);
3795+
static REL::Relocation<func_t> func{ REL::ID(34450) };
3796+
return func();
3797+
}
3798+
3799+
// members
3800+
HitData hitData; // 000
3801+
NiPointer<TESObjectREFR> target; // 0F0
3802+
NiPointer<TESObjectREFR> cause; // 0F8
3803+
BSFixedString material; // 100
3804+
TESFormID sourceFormID; // 108
3805+
TESFormID projectileFormID; // 10C
3806+
bool usesHitData; // 110
3807+
};
3808+
static_assert(sizeof(TESHitEvent) == 0x120);
37593809

37603810
struct TESLoadGameEvent
37613811
{

0 commit comments

Comments
 (0)