feat: add NameId to actor struct and Npc in object model

This commit is contained in:
goat 2020-04-20 20:45:58 +02:00
parent 49f450958b
commit eb16ffde49
3 changed files with 8 additions and 2 deletions

View file

@ -14,5 +14,10 @@ namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer {
/// The data ID of the NPC linking to their respective game data.
/// </summary>
public int DataId => this.actorStruct.DataId;
/// <summary>
/// The name ID of the NPC linking to their respective game data.
/// </summary>
public int NameId => this.actorStruct.NameId;
}
}

View file

@ -24,7 +24,8 @@ namespace Dalamud.Game.ClientState.Structs
// This field can't be correctly aligned, so we have to cut it manually.
[FieldOffset(0x17d0)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] public byte[] CompanyTag;
[FieldOffset(0x1868)] public int NameId;
[FieldOffset(0x1884)] public byte CurrentWorld;
[FieldOffset(0x1886)] public byte HomeWorld;
[FieldOffset(6328)] public int CurrentHp;

View file

@ -90,7 +90,7 @@ namespace Dalamud.Interface
$" -> {i} - {actor.Name} - {actor.Position.X} {actor.Position.Y} {actor.Position.Z}\n";
if (actor is Npc npc)
stateString += $" DataId: {npc.DataId}\n";
stateString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n";
if (actor is Chara chara)
stateString +=