Browse Source

PVP experience only after level 75

lakebane-master
FatBoy-DOTC 6 months ago
parent
commit
0d7beb5a5a
  1. 13
      src/engine/objects/Experience.java
  2. 8
      src/engine/objects/PlayerCharacter.java

13
src/engine/objects/Experience.java

@ -444,10 +444,12 @@ public class Experience { @@ -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 { @@ -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);
}
}
}

8
src/engine/objects/PlayerCharacter.java

@ -2916,7 +2916,11 @@ public class PlayerCharacter extends AbstractCharacter { @@ -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 { @@ -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);
}
}

Loading…
Cancel
Save