Implemented de-level minimum level config.

This commit is contained in:
MobiusDev
2015-11-14 18:52:22 +00:00
parent e38353e409
commit 97286edf6c
6 changed files with 26 additions and 18 deletions

View File

@ -5839,7 +5839,7 @@ public final class L2PcInstance extends L2Playable
setExpBeforeDeath(getExp());
getStat().addExp(-lostExp);
getStat().removeExp(lostExp);
}
public boolean isPartyWaiting()

View File

@ -76,7 +76,7 @@ public class PcStat extends PlayableStat
@Override
public boolean addExp(long value)
{
L2PcInstance activeChar = getActiveChar();
final L2PcInstance activeChar = getActiveChar();
// Allowed to gain exp?
if (!getActiveChar().getAccessLevel().canGainExp())
@ -92,7 +92,7 @@ public class PcStat extends PlayableStat
// Set new karma
if (!activeChar.isCursedWeaponEquipped() && (activeChar.getReputation() < 0) && (activeChar.isGM() || !activeChar.isInsideZone(ZoneId.PVP)))
{
int karmaLost = Formulas.calculateKarmaLost(activeChar, value);
final int karmaLost = Formulas.calculateKarmaLost(activeChar, value);
if (karmaLost > 0)
{
activeChar.setReputation(activeChar.getReputation() + karmaLost);
@ -219,7 +219,7 @@ public class PcStat extends PlayableStat
public boolean removeExpAndSp(long addToExp, long addToSp, boolean sendMessage)
{
int level = getLevel();
final int level = getLevel();
if (!super.removeExpAndSp(addToExp, addToSp))
{
return false;

View File

@ -103,6 +103,11 @@ public class PlayableStat extends CharStat
public boolean removeExp(long value)
{
if (((getExp() - value) < getExpForLevel(getLevel())) && (!Config.PLAYER_DELEVEL || (Config.PLAYER_DELEVEL && (getLevel() <= Config.DELEVEL_MINIMUM))))
{
value = getExp() - getExpForLevel(getLevel());
}
if ((getExp() - value) < 0)
{
value = getExp() - 1;