From fe399664f348872cf54c0a33a9e9d8450ee5f34a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 11 Feb 2025 07:44:28 -0600 Subject: [PATCH] targeting object checks only count when targeting players --- src/engine/objects/PlayerCharacter.java | 34 ++++++++++++------------- src/engine/util/KeyCloneAudit.java | 4 +++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 40175aab..241e066c 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -5122,23 +5122,23 @@ public class PlayerCharacter extends AbstractCharacter { if (this.updateLock.writeLock().tryLock()) { try { - if (!this.timestamps.contains("STAMHEALTICK")) { - this.timestamps.put("STAMHEALTICK", System.currentTimeMillis()); - } - if (this.containsEffect(441156455)) { - long length = System.currentTimeMillis() - this.timestamps.get("STAMHEALTICK"); - if (length > 10000 ) { - float stamIncrease = 0.65f; - if (this.stamina.get() + stamIncrease > this.staminaMax) - this.stamina.compareAndSet(this.stamina.get(), this.staminaMax); - else - this.stamina.compareAndSet(this.stamina.get(), this.stamina.get() + stamIncrease); - this.timestamps.put("STAMHEALTICK", System.currentTimeMillis()); - ChatManager.chatSystemInfo(this, "Healed 7 Stamina"); - } - } else { - this.timestamps.put("STAMHEALTICK", System.currentTimeMillis()); - } + //if (!this.timestamps.contains("STAMHEALTICK")) { + // this.timestamps.put("STAMHEALTICK", System.currentTimeMillis()); + //} + //if (this.containsEffect(441156455)) { + // long length = System.currentTimeMillis() - this.timestamps.get("STAMHEALTICK").longValue(); + // if (length > 10000 ) { + // float stamIncrease = 6.5f; + // if (this.stamina.get() + stamIncrease > this.staminaMax) + // this.stamina.compareAndSet(this.stamina.get(), this.staminaMax); + // else + // this.stamina.compareAndSet(this.stamina.get(), this.stamina.get() + stamIncrease); + // this.timestamps.put("STAMHEALTICK", System.currentTimeMillis()); + // ChatManager.chatSystemInfo(this, "Healed 7 Stamina"); + // } + //} else { + // this.timestamps.put("STAMHEALTICK", System.currentTimeMillis()); + //} if (!this.isAlive() && this.isEnteredWorld()) { if (!this.timestamps.containsKey("DeathTime")) { diff --git a/src/engine/util/KeyCloneAudit.java b/src/engine/util/KeyCloneAudit.java index 4f1bfb26..999e2bb9 100644 --- a/src/engine/util/KeyCloneAudit.java +++ b/src/engine/util/KeyCloneAudit.java @@ -49,6 +49,10 @@ public enum KeyCloneAudit { PlayerCharacter pc = SessionManager.getSession(origin).getPlayerCharacter(); if (msg.getProtocolMsg().equals(Protocol.SETSELECTEDOBECT)) { + TargetObjectMsg tarMsg = (TargetObjectMsg)msg; + if(tarMsg.getTargetType() != MBServerStatics.MASK_PLAYER) + return; + if (System.currentTimeMillis() > origin.finalStrikeRefresh) { origin.lastStrike = System.currentTimeMillis(); origin.strikes = 0;