poe2-bot/src/Nexus.GameOffsets/Components/ActorSkill.cs
2026-03-06 14:37:05 -05:00

33 lines
1.2 KiB
C#

using System.Runtime.InteropServices;
namespace Nexus.GameOffsets.Components;
/// <summary>
/// An entry in the ActiveSkills vector: shared_ptr pair (0x10 bytes).
/// Follow ActiveSkillPtr (first pointer) for skill details.
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ActorSkillEntry
{
public nint ActiveSkillPtr;
public nint ControlBlockPtr; // shared_ptr control block, not used
}
/// <summary>
/// Details of an active skill. The shared_ptr in the ActiveSkills vector points
/// 0x10 bytes into the object (past vtable + UseStage/CastType), so we read from
/// ActiveSkillPtr - 0x10 and all offsets are relative to the true object base.
/// </summary>
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public struct ActorSkillDetails
{
[FieldOffset(0x00)] public nint Vtable;
[FieldOffset(0x08)] public int UseStage;
[FieldOffset(0x0C)] public int CastType;
[FieldOffset(0x20)] public uint UnknownIdAndEquipmentInfo;
[FieldOffset(0x28)] public nint GrantedEffectsPerLevelDatRow;
[FieldOffset(0x30)] public nint ActiveSkillsDatPtr;
[FieldOffset(0x40)] public nint GrantedEffectStatSetsPerLevelDatRow;
[FieldOffset(0xA8)] public int TotalUses;
[FieldOffset(0xB8)] public int TotalCooldownTimeInMs;
}