From 0d7beb5a5a3bb16a506d0acdc07096906cb04f57 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 21 May 2024 20:43:21 -0500 Subject: [PATCH] PVP experience only after level 75 --- src/engine/objects/Experience.java | 13 +++++++++---- src/engine/objects/PlayerCharacter.java | 8 ++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/Experience.java b/src/engine/objects/Experience.java index 677de2ab..31bd4ab0 100644 --- a/src/engine/objects/Experience.java +++ b/src/engine/objects/Experience.java @@ -444,10 +444,12 @@ public class Experience { grantedExperience = 1; // Grant the player the EXP - if(!(playerCharacter.level > 74 && mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))) - return; + if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) + playerCharacter.grantXP((int) Math.floor(grantedExperience), true); + else + playerCharacter.grantXP((int) Math.floor(grantedExperience),false); + - playerCharacter.grantXP((int) Math.floor(grantedExperience)); } } else { // Give EXP to a single character @@ -471,7 +473,10 @@ public class Experience { grantedExperience *= .6; // Grant XP - killer.grantXP((int) Math.floor(grantedExperience)); + if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) + killer.grantXP((int) Math.floor(grantedExperience), true); + else + killer.grantXP((int) Math.floor(grantedExperience),false); } } } diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index ac0eb21f..8271ee7c 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -2916,7 +2916,11 @@ public class PlayerCharacter extends AbstractCharacter { return endSpeed; } - public synchronized void grantXP(int xp) { + public synchronized void grantXP(int xp, boolean fromPVP) { + + if(this.level > 75 && !fromPVP){ + return; + } if(GroupManager.getGroup(this) == null) xp *= 2; @@ -4636,7 +4640,7 @@ public class PlayerCharacter extends AbstractCharacter { tmpLevel = (short) Math.min(tmpLevel, MBServerStatics.LEVELCAP); while (this.level < tmpLevel) { - grantXP(Experience.getBaseExperience(tmpLevel) - this.exp); + grantXP(Experience.getBaseExperience(tmpLevel) - this.exp, false); } }