Add TargetActorID

This commit is contained in:
Caraxi 2020-05-28 08:28:26 +09:30
parent 4bbcd526e9
commit e8b244feba
4 changed files with 19 additions and 1 deletions

View file

@ -65,5 +65,10 @@ namespace Dalamud.Game.ClientState.Actors.Types {
/// The Y distance from the local player in yalms.
/// </summary>
public byte YalmDistanceY => this.actorStruct.YalmDistanceFromPlayerY;
/// <summary>
/// The target of the actor
/// </summary>
public virtual int TargetActorID => 0;
}
}

View file

@ -22,5 +22,11 @@ namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer {
/// The ID of this BattleNpc's owner.
/// </summary>
public int OwnerId => this.actorStruct.OwnerId;
/// <summary>
/// Target of the Battle NPC
/// </summary>
public override int TargetActorID => this.actorStruct.BattleNpcTargetActorId;
}
}

View file

@ -29,5 +29,11 @@ namespace Dalamud.Game.ClientState.Actors.Types {
/// The Free Company tag of this player.
/// </summary>
public string CompanyTag => Encoding.UTF8.GetString(this.actorStruct.CompanyTag).Substring(2).Replace("\0", "");
/// <summary>
/// Target of the PlayerCharacter
/// </summary>
public override int TargetActorID => this.actorStruct.PlayerCharacterTargetActorId;
}
}

View file

@ -30,7 +30,8 @@ namespace Dalamud.Game.ClientState.Structs
[FieldOffset(0x17B8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] public byte[] Customize;
[FieldOffset(0x17F8)] public int TargetActorId;
[FieldOffset(0x1F0)] public int PlayerCharacterTargetActorId;
[FieldOffset(0x17F8)] public int BattleNpcTargetActorId;
// This field can't be correctly aligned, so we have to cut it manually.
[FieldOffset(0x17d0)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]