Skip to content

Commit

Permalink
feat: EffectSetting, AlchemyItem, EnchantmentItem (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 authored Nov 21, 2023
1 parent 1761d7e commit 797316f
Show file tree
Hide file tree
Showing 8 changed files with 325 additions and 1 deletion.
60 changes: 60 additions & 0 deletions CommonLibSF/include/RE/A/AlchemyItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#pragma once

#include "RE/B/BGSCraftingResourceOwner.h"
#include "RE/B/BGSCraftingUseSound.h"
#include "RE/B/BGSDestructibleObjectForm.h"
#include "RE/B/BGSEquipType.h"
#include "RE/B/BGSModelMaterialSwap.h"
#include "RE/B/BGSPickupPutdownSounds.h"
#include "RE/M/MagicItem.h"
#include "RE/T/TESDescription.h"
#include "RE/T/TESWeightForm.h"

namespace RE
{
class SpellItem;

class AlchemyItem :
public MagicItem, // 000
public BGSModelMaterialSwap, // 188
public TESWeightForm, // 1B0
public BGSEquipType, // 1C0
public BGSDestructibleObjectForm, // 1D0
public BGSPickupPutdownSounds, // 1E0
public BGSCraftingUseSound, // 240
public TESDescription, // 280
public BGSCraftingResourceOwner // 298
{
public:
SF_RTTI_VTABLE(AlchemyItem);
SF_FORMTYPE(ALCH);

enum class AlchemyFlag
{
kNone = 0,
kCostOverride = 1 << 0,
kFoodItem = 1 << 1,
kExtendDuration = 1 << 3,
kMedicine = 1 << 16,
kPoison = 1 << 17
};

class Data :
public MagicItem::Data // 00
{
public:
// members
SpellItem* addictionItem; // 08
float addictionChance; // 10
BGSAudio::WwiseSoundHook consumptionSound; // 18
BGSLocalizedString addictionName; // 48
};
static_assert(sizeof(Data) == 0x50);

~AlchemyItem() override; // 00

// members
Data data; // 2B8
};
static_assert(sizeof(AlchemyItem) == 0x308);
}
66 changes: 66 additions & 0 deletions CommonLibSF/include/RE/E/EffectArchetypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#pragma once

namespace RE
{
struct EffectArchetypes
{
enum class ArchetypeID
{
kNone = static_cast<std::underlying_type_t<ArchetypeID>>(-1),
kValueModifier = 0,
kScript = 1,
kDispel = 2,
kCureDisease = 3,
kAbsorb = 4,
kDualValueModifier = 5,
kCalm = 6,
kDemoralize = 7,
kFrenzy = 8,
kDisarm = 9,
kCommandSummoned = 10,
kInvisibility = 11,
kLight = 12,
kDarkness = 13,
kNightEye = 14,
kLock = 15,
kOpen = 16,
kBoundWeapon = 17,
kSummonCreature = 18,
kDetectLife = 19,
kTelekinesis = 20,
kParalysis = 21,
kReanimate = 22,
kSoulTrap = 23,
kTurnUndead = 24,
kGuide = 25,
kSummonDuplicate = 26,
kCureParalysis = 27,
kCureAddiction = 28,
kCurePoison = 29,
kConcussion = 30,
kStimpak = 31,
kAccumulatingMagnitude = 32,
kStagger = 33,
kPeakValueModifier = 34,
kCloak = 35,
kCommand = 36,
kSlowTime = 37,
kRally = 38,
kEnhanceWeapon = 39,
kSpawnHazard = 40,
kEtherealize = 41,
kBanish = 42,
kSpawnScriptedRef = 43,
kDisguise = 44,
kDamage = 45,
kImmunity = 46,
kPermanentReanimate = 47,
kBoostpack = 48,
kChameleon = 49,
kCapacityValueModifier = 50,
kResetFlora = 51,
kDropResources = 52,
kAntigravity = 53,
};
};
}
4 changes: 3 additions & 1 deletion CommonLibSF/include/RE/E/EffectItem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "RE/T/TESCondition.h"

namespace RE
{
class EffectSetting;
Expand Down Expand Up @@ -27,7 +29,7 @@ namespace RE
std::uint32_t unk30; // 30
std::uint32_t unk34; // 34
float rawCost; // 38
std::uint64_t conditions[2]; // 40 - TESCondition
TESCondition conditions; // 40
};
static_assert(sizeof(EffectItem) == 0x50);
}
119 changes: 119 additions & 0 deletions CommonLibSF/include/RE/E/EffectSetting.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#pragma once

#include "RE/B/BGSKeywordForm.h"
#include "RE/B/BGSLocalizedString.h"
#include "RE/B/BGSMenuDisplayObject.h"
#include "RE/B/BSTArray.h"
#include "RE/E/EffectArchetypes.h"
#include "RE/M/MagicSystem.h"
#include "RE/T/TESCondition.h"
#include "RE/T/TESForm.h"
#include "RE/T/TESFullName.h"

namespace RE
{
class ActorValueInfo;
class BGSArtObject;
class BGSDualCastData;
class BGSExplosion;
class BGSImpactDataSet;
class BGSPerk;
class BGSProjectile;
class EffectShader;
class SpellItem;
class TESImageSpaceModifier;
class TESObjectLIGH;

class EffectSetting :
public TESForm, // 000
public TESFullName, // 038
public BGSMenuDisplayObject, // 048
public BGSKeywordForm // 058
{
public:
SF_RTTI_VTABLE(EffectSetting);
SF_FORMTYPE(MGEF);

using FilterValidationFunction_t = bool(EffectSetting*, void*);

struct EffectSettingData
{
public:
enum class Flag
{
kNone = 0,
kHostile = 1 << 0,
kRecover = 1 << 1,
kDetrimental = 1 << 2,
kSnapToNavMesh = 1 << 3,
kNoHitEvent = 1 << 4,
kDispelWithKeywords = 1 << 8,
kNoDuration = 1 << 9,
kNoMagnitude = 1 << 10,
kNoArea = 1 << 11,
kFXPersist = 1 << 12,
kGoryVisuals = 1 << 14,
kHideInUI = 1 << 15,
kNoRecast = 1 << 17,
kPowerAffectsMagnitude = 1 << 21,
kPowerAffectsDuration = 1 << 22,
kPainless = 1 << 26,
kNoHitEffect = 1 << 27,
kNoDeathDispel = 1 << 28
};

// members
TESForm* associatedForm; // 00
ActorValueInfo* associatedSkill; // 08
BGSArtObject* castingArt; // 10
BGSDualCastData* dualCastData; // 18
EffectShader* effectShader; // 20
EffectShader* enchantShader; // 28
BGSArtObject* enchantEffectArt; // 30
SpellItem* equipAbility; // 38
BGSExplosion* explosion; // 40
BGSArtObject* hitEffectArt; // 48
TESImageSpaceModifier* imageSpaceMod; // 50
BGSImpactDataSet* impactDataSet; // 58
TESObjectLIGH* light; // 60
BGSPerk* perk; // 68
ActorValueInfo* primaryAV; // 70
BGSProjectile* projectile; // 78
ActorValueInfo* resistVariable; // 80
ActorValueInfo* secondaryAV; // 88
float baseCost; // 90
float taperWeight; // 94
std::uint32_t spellMakingArea; // 98
float spellMakingChargeTime; // 9C
float taperCurve; // A0
float taperDuration; // A4
float secondaryAVWeight; // A8
float skillUsageMult; // AC
float dualCastScale; // B0
float unkB4; // B4
float unkB8; // B8
std::uint32_t minimumSkill; // BC
stl::enumeration<Flag, std::uint32_t> flags; // C0
stl::enumeration<EffectArchetypes::ArchetypeID, std::uint32_t> archetype; // C4
stl::enumeration<MagicSystem::CastingType, std::uint8_t> castingType; // C8
stl::enumeration<MagicSystem::Delivery, std::uint8_t> deliveryType; // C9
std::uint32_t unkCC; // CC
};
static_assert(sizeof(EffectSettingData) == 0xD0);

~EffectSetting() override; // 00

// members
FilterValidationFunction_t* filterValidationFunction; // 088
void* filterValidationItem; // 090
EffectSettingData data; // 098
BSTArray<TESForm*> unk168; // 168
std::uint8_t unk178[0x48]; // 178 - ESSH
std::uint64_t unk1C0; // 1C0
std::uint64_t unk1C8; // 1C8
BGSLocalizedString magicItemDescription; // 1D0
std::uint64_t unk1D8; // 1D8
TESCondition conditions; // 1E0
};
static_assert(sizeof(EffectSetting) == 0x1F0);
}
34 changes: 34 additions & 0 deletions CommonLibSF/include/RE/E/EnchantmentItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include "RE/M/MagicItem.h"

namespace RE
{
class BGSListForm;

class EnchantmentItem : public MagicItem
{
public:
SF_RTTI_VTABLE(EnchantmentItem);
SF_FORMTYPE(ENCH);

class Data :
public MagicItem::Data // 00
{
public:
// members
stl::enumeration<MagicSystem::CastingType, std::int32_t> castingType; // 00
std::uint32_t chargeOverride; // 0C
stl::enumeration<MagicSystem::Delivery, std::uint8_t> delivery; // 10
stl::enumeration<MagicSystem::SpellType, std::uint8_t> spellType; // 11
float chargeTime; // 14
EnchantmentItem* baseEnchantment; // 18
BGSListForm* wornRestrictions; // 20
};
static_assert(sizeof(Data) == 0x28);

// members
Data data; // 188
};
static_assert(sizeof(EnchantmentItem) == 0x1B0);
}
27 changes: 27 additions & 0 deletions CommonLibSF/include/RE/N/NiPoint4.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

namespace RE
{
class NiPoint4
{
public:
struct NiPoint4Struct
{
public:
// members
float x; // 00
float y; // 04
float z; // 08
float w; // 0C
};
static_assert(sizeof(NiPoint4Struct) == 0x10);

// members
union
{
NiPoint4Struct v;
float pt[4]{ 0.0F };
}; // 00
};
static_assert(sizeof(NiPoint4) == 0x10);
}
1 change: 1 addition & 0 deletions CommonLibSF/include/RE/P/Projectile.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace RE

class bhkNPCollisionObject;
class ActorCause;
class AlchemyItem;
class BGSExplosion;
class BGSMaterialType;
class BGSProjectile;
Expand Down
15 changes: 15 additions & 0 deletions CommonLibSF/include/RE/T/TESCondition.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

namespace RE
{
class TESConditionItem;

class TESCondition
{
public:
// members
std::uint8_t unk0; // 0
TESConditionItem* head; // 8
};
static_assert(sizeof(TESCondition) == 0x10);
}

0 comments on commit 797316f

Please sign in to comment.