Browse Source

xp and range fix

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

2
src/engine/gameManager/CombatManager.java

@ -1278,7 +1278,7 @@ public enum CombatManager { @@ -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();
}
}

21
src/engine/objects/Experience.java

@ -11,6 +11,7 @@ package engine.objects; @@ -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 { @@ -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))
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 {
playerCharacter.grantXP((int) Math.floor(grantedExperience), false);
}
}
} else { // Give EXP to a single character
@ -474,11 +476,12 @@ public class Experience { @@ -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);
}
}
}
}

Loading…
Cancel
Save