fix: update offsets for 5.3

This commit is contained in:
Anna 2020-08-11 08:13:19 -04:00
parent dec09c696c
commit d6aac4678c
2 changed files with 10 additions and 10 deletions

View File

@ -311,14 +311,14 @@ namespace PeepingTom {
if (this.plugin.Interface.ClientState.LocalPlayer != null) {
PlayerCharacter player = this.plugin.Interface.ClientState.LocalPlayer;
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(player.Address, 0x1901);
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(player.Address, 0x1906);
byte status = Marshal.ReadByte(statusPtr);
ImGui.Text($"Status: {status}");
}
PlayerCharacter currentTarget = this.GetCurrentTarget();
if (currentTarget != null) {
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(currentTarget.Address, 0x1901);
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(currentTarget.Address, 0x1906);
byte status = Marshal.ReadByte(statusPtr);
ImGui.Text($"Target status: {status}");
}

View File

@ -146,24 +146,24 @@ namespace PeepingTom {
return actors
.Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter)
.Where(actor => this.plugin.Config.LogParty || !this.InParty(actor))
.Where(actor => this.plugin.Config.LogAlliance || !this.InAlliance(actor))
.Where(actor => this.plugin.Config.LogInCombat || !this.InCombat(actor))
.Where(actor => this.plugin.Config.LogParty || !InParty(actor))
.Where(actor => this.plugin.Config.LogAlliance || !InAlliance(actor))
.Where(actor => this.plugin.Config.LogInCombat || !InCombat(actor))
.Where(actor => this.plugin.Config.LogSelf || actor.ActorId != player.ActorId)
.Select(actor => new Targeter(actor))
.ToArray();
}
private byte GetStatus(Actor actor) {
IntPtr statusPtr = this.plugin.Interface.TargetModuleScanner.ResolveRelativeAddress(actor.Address, 0x1901);
private static byte GetStatus(Actor actor) {
IntPtr statusPtr = actor.Address + 0x1906; // updated 5.3
return Marshal.ReadByte(statusPtr);
}
private bool InCombat(Actor actor) => (this.GetStatus(actor) & 2) > 0;
private static bool InCombat(Actor actor) => (GetStatus(actor) & 2) > 0;
private bool InParty(Actor actor) => (this.GetStatus(actor) & 16) > 0;
private static bool InParty(Actor actor) => (GetStatus(actor) & 16) > 0;
private bool InAlliance(Actor actor) => (this.GetStatus(actor) & 32) > 0;
private static bool InAlliance(Actor actor) => (GetStatus(actor) & 32) > 0;
private bool CanPlaySound() {
if (!this.plugin.Config.PlaySoundOnTarget) {