From 1d703b08a285f45d967a5e955cf4578222e78a90 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 22 May 2024 06:43:51 -0500 Subject: [PATCH] xp and range fix --- src/engine/gameManager/CombatManager.java | 2 +- src/engine/objects/Experience.java | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 709ff575..c1f7b3a3 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -1278,7 +1278,7 @@ public enum CombatManager { if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){ range += ((PlayerCharacter)ac).getCharacterHeight() * 0.5f; if(ac.isMoving()){ - range += ac.getSpeed(); + range += ((PlayerCharacter) ac).getCharacterHeight(); } } diff --git a/src/engine/objects/Experience.java b/src/engine/objects/Experience.java index 2d6915dd..07c9e709 100644 --- a/src/engine/objects/Experience.java +++ b/src/engine/objects/Experience.java @@ -11,6 +11,7 @@ package engine.objects; import engine.Enum; import engine.Enum.TargetColor; +import engine.gameManager.LootManager; import engine.gameManager.ZoneManager; import engine.math.Vector3fImmutable; import engine.server.MBServerStatics; @@ -443,13 +444,14 @@ public class Experience { if (grantedExperience == 0) grantedExperience = 1; + grantedExperience *= LootManager.NORMAL_EXP_RATE; // Grant the player the EXP - if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) - playerCharacter.grantXP((int) Math.floor(grantedExperience), true); - else - playerCharacter.grantXP((int) Math.floor(grantedExperience),false); - - + if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { + if (((PlayerCharacter) mob).pvpDeaths.contains(killer.getObjectUUID()) == false) + playerCharacter.grantXP((int) Math.floor(grantedExperience), true); + }else { + playerCharacter.grantXP((int) Math.floor(grantedExperience), false); + } } } else { // Give EXP to a single character @@ -474,11 +476,12 @@ public class Experience { grantedExperience *= .6; // Grant XP - if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) - if(((PlayerCharacter)mob).pvpDeaths.contains(killer.getObjectUUID()) == false) + if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { + if (((PlayerCharacter) mob).pvpDeaths.contains(killer.getObjectUUID()) == false) killer.grantXP((int) Math.floor(grantedExperience), true); - else - killer.grantXP((int) Math.floor(grantedExperience),false); + }else { + killer.grantXP((int) Math.floor(grantedExperience), false); + } } } }