Browse Source

xp and range fix

lakebane-master
FatBoy-DOTC 6 months ago
parent
commit
1d703b08a2
  1. 2
      src/engine/gameManager/CombatManager.java
  2. 23
      src/engine/objects/Experience.java

2
src/engine/gameManager/CombatManager.java

@ -1278,7 +1278,7 @@ public enum CombatManager {
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){ if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
range += ((PlayerCharacter)ac).getCharacterHeight() * 0.5f; range += ((PlayerCharacter)ac).getCharacterHeight() * 0.5f;
if(ac.isMoving()){ if(ac.isMoving()){
range += ac.getSpeed(); range += ((PlayerCharacter) ac).getCharacterHeight();
} }
} }

23
src/engine/objects/Experience.java

@ -11,6 +11,7 @@ package engine.objects;
import engine.Enum; import engine.Enum;
import engine.Enum.TargetColor; import engine.Enum.TargetColor;
import engine.gameManager.LootManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -443,13 +444,14 @@ public class Experience {
if (grantedExperience == 0) if (grantedExperience == 0)
grantedExperience = 1; grantedExperience = 1;
grantedExperience *= LootManager.NORMAL_EXP_RATE;
// Grant the player the EXP // Grant the player the EXP
if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
playerCharacter.grantXP((int) Math.floor(grantedExperience), true); if (((PlayerCharacter) mob).pvpDeaths.contains(killer.getObjectUUID()) == false)
else playerCharacter.grantXP((int) Math.floor(grantedExperience), true);
playerCharacter.grantXP((int) Math.floor(grantedExperience),false); }else {
playerCharacter.grantXP((int) Math.floor(grantedExperience), false);
}
} }
} else { // Give EXP to a single character } else { // Give EXP to a single character
@ -474,11 +476,12 @@ public class Experience {
grantedExperience *= .6; grantedExperience *= .6;
// Grant XP // Grant XP
if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) if(mob.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
if(((PlayerCharacter)mob).pvpDeaths.contains(killer.getObjectUUID()) == false) if (((PlayerCharacter) mob).pvpDeaths.contains(killer.getObjectUUID()) == false)
killer.grantXP((int) Math.floor(grantedExperience), true); killer.grantXP((int) Math.floor(grantedExperience), true);
else }else {
killer.grantXP((int) Math.floor(grantedExperience),false); killer.grantXP((int) Math.floor(grantedExperience), false);
}
} }
} }
} }

Loading…
Cancel
Save