Browse Source

targeting object checks only count when targeting players

lakebane-ai
FatBoy-DOTC 2 weeks ago
parent
commit
fe399664f3
  1. 34
      src/engine/objects/PlayerCharacter.java
  2. 4
      src/engine/util/KeyCloneAudit.java

34
src/engine/objects/PlayerCharacter.java

@ -5122,23 +5122,23 @@ public class PlayerCharacter extends AbstractCharacter { @@ -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")) {

4
src/engine/util/KeyCloneAudit.java

@ -49,6 +49,10 @@ public enum KeyCloneAudit { @@ -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;

Loading…
Cancel
Save