Changed Classic max level logic.

This commit is contained in:
MobiusDev 2015-04-30 22:30:01 +00:00
parent 9dceacb328
commit 7129d00210
6 changed files with 18 additions and 87 deletions

View File

@ -339,6 +339,10 @@ BaseDualclassLevel = 85
# Default: 80
MaxSubclassLevel = 80
# Maximum Classic player level.
# Default: 75
MaxClassicPlayerLevel = 75
# Maximum number of allowed slots for Private Stores Sell.
# Other means all the other races aside from Dwarf.
# Default: 4, 3

View File

@ -20,6 +20,7 @@ package handlers.admincommandhandlers;
import java.util.StringTokenizer;
import com.l2jserver.Config;
import com.l2jserver.gameserver.data.xml.impl.ExperienceData;
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
import com.l2jserver.gameserver.model.L2Object;
@ -64,6 +65,7 @@ public class AdminLevel implements IAdminCommandHandler
}
else if (actualCommand.equalsIgnoreCase("admin_set_level"))
{
final int maxLevel = Config.SERVER_CLASSIC_SUPPORT ? Config.MAX_CLASSIC_PLAYER_LEVEL : ExperienceData.getInstance().getMaxLevel();
try
{
if (!(targetChar instanceof L2PcInstance))
@ -74,7 +76,7 @@ public class AdminLevel implements IAdminCommandHandler
L2PcInstance targetPlayer = (L2PcInstance) targetChar;
byte lvl = Byte.parseByte(val);
if ((lvl >= 1) && (lvl <= ExperienceData.getInstance().getMaxLevel()))
if ((lvl >= 1) && (lvl <= maxLevel))
{
long pXp = targetPlayer.getExp();
long tXp = ExperienceData.getInstance().getExpForLevel(lvl);
@ -90,13 +92,13 @@ public class AdminLevel implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
activeChar.sendMessage("You must specify level between 1 and " + maxLevel + ".");
return false;
}
}
catch (NumberFormatException e)
{
activeChar.sendMessage("You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
activeChar.sendMessage("You must specify level between 1 and " + maxLevel + ".");
return false;
}
}

View File

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<table maxLevel="75" maxPetLevel="76" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/experience.xsd">
<experience level="1" tolevel="0" />
<experience level="2" tolevel="68" />
<experience level="3" tolevel="363" />
<experience level="4" tolevel="1168" />
<experience level="5" tolevel="2884" />
<experience level="6" tolevel="6038" />
<experience level="7" tolevel="11287" />
<experience level="8" tolevel="19423" />
<experience level="9" tolevel="31378" />
<experience level="10" tolevel="48229" />
<experience level="11" tolevel="71202" />
<experience level="12" tolevel="101677" />
<experience level="13" tolevel="141193" />
<experience level="14" tolevel="191454" />
<experience level="15" tolevel="254330" />
<experience level="16" tolevel="331867" />
<experience level="17" tolevel="426288" />
<experience level="18" tolevel="540000" />
<experience level="19" tolevel="675596" />
<experience level="20" tolevel="835862" />
<experience level="21" tolevel="920357" />
<experience level="22" tolevel="1015431" />
<experience level="23" tolevel="1123336" />
<experience level="24" tolevel="1246808" />
<experience level="25" tolevel="1389235" />
<experience level="26" tolevel="1554904" />
<experience level="27" tolevel="1749413" />
<experience level="28" tolevel="1980499" />
<experience level="29" tolevel="2260321" />
<experience level="30" tolevel="2634751" />
<experience level="31" tolevel="2844287" />
<experience level="32" tolevel="3093068" />
<experience level="33" tolevel="3389496" />
<experience level="34" tolevel="3744042" />
<experience level="35" tolevel="4169902" />
<experience level="36" tolevel="4683988" />
<experience level="37" tolevel="5308556" />
<experience level="38" tolevel="6074376" />
<experience level="39" tolevel="7029248" />
<experience level="40" tolevel="8342182" />
<experience level="41" tolevel="8718976" />
<experience level="42" tolevel="12842357" />
<experience level="43" tolevel="14751932" />
<experience level="44" tolevel="17009030" />
<experience level="45" tolevel="19686117" />
<experience level="46" tolevel="22875008" />
<experience level="47" tolevel="26695470" />
<experience level="48" tolevel="31312332" />
<experience level="49" tolevel="36982854" />
<experience level="50" tolevel="44659561" />
<experience level="51" tolevel="48128727" />
<experience level="52" tolevel="52277875" />
<experience level="53" tolevel="57248635" />
<experience level="54" tolevel="63216221" />
<experience level="55" tolevel="70399827" />
<experience level="56" tolevel="79078300" />
<experience level="57" tolevel="89616178" />
<experience level="58" tolevel="102514871" />
<experience level="59" tolevel="118552044" />
<experience level="60" tolevel="140517709" />
<experience level="61" tolevel="153064754" />
<experience level="62" tolevel="168231664" />
<experience level="63" tolevel="186587702" />
<experience level="64" tolevel="208840245" />
<experience level="65" tolevel="235877658" />
<experience level="66" tolevel="268833561" />
<experience level="67" tolevel="309192920" />
<experience level="68" tolevel="358998712" />
<experience level="69" tolevel="421408669" />
<experience level="70" tolevel="493177635" />
<experience level="71" tolevel="555112374" />
<experience level="72" tolevel="630494192" />
<experience level="73" tolevel="722326994" />
<experience level="74" tolevel="834354722" />
<experience level="75" tolevel="971291524" />
<experience level="76" tolevel="1139165674" />
<experience level="77" tolevel="1345884863" />
</table>

View File

@ -176,6 +176,7 @@ public final class Config
public static byte BASE_SUBCLASS_LEVEL;
public static byte BASE_DUALCLASS_LEVEL;
public static byte MAX_SUBCLASS_LEVEL;
public static byte MAX_CLASSIC_PLAYER_LEVEL;
public static int MAX_PVTSTORESELL_SLOTS_DWARF;
public static int MAX_PVTSTORESELL_SLOTS_OTHER;
public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
@ -1542,6 +1543,7 @@ public final class Config
BASE_SUBCLASS_LEVEL = Character.getByte("BaseSubclassLevel", (byte) 40);
BASE_DUALCLASS_LEVEL = Character.getByte("BaseDualclassLevel", (byte) 85);
MAX_SUBCLASS_LEVEL = Character.getByte("MaxSubclassLevel", (byte) 80);
MAX_CLASSIC_PLAYER_LEVEL = Character.getByte("MaxClassicPlayerLevel", (byte) 75);
MAX_PVTSTORESELL_SLOTS_DWARF = Character.getInt("MaxPvtStoreSellSlotsDwarf", 4);
MAX_PVTSTORESELL_SLOTS_OTHER = Character.getInt("MaxPvtStoreSellSlotsOther", 3);
MAX_PVTSTOREBUY_SLOTS_DWARF = Character.getInt("MaxPvtStoreBuySlotsDwarf", 5);

View File

@ -25,7 +25,6 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jserver.Config;
import com.l2jserver.util.data.xml.IXmlReader;
/**
@ -51,7 +50,7 @@ public final class ExperienceData implements IXmlReader
public void load()
{
_expTable.clear();
parseDatapackFile(Config.SERVER_CLASSIC_SUPPORT ? "data/stats/classic_experience.xml" : "data/stats/experience.xml");
parseDatapackFile("data/stats/experience.xml");
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _expTable.size() + " levels.");
LOGGER.info(getClass().getSimpleName() + ": Max Player Level is: " + (MAX_LEVEL - 1));
LOGGER.info(getClass().getSimpleName() + ": Max Pet Level is: " + (MAX_PET_LEVEL - 1));

View File

@ -83,6 +83,10 @@ public class PcStat extends PlayableStat
{
return false;
}
if (Config.SERVER_CLASSIC_SUPPORT && (getActiveChar().getLevel() >= Config.MAX_CLASSIC_PLAYER_LEVEL))
{
return false;
}
if (!super.addExp(value))
{
@ -457,9 +461,9 @@ public class PcStat extends PlayableStat
@Override
public final void setLevel(byte value)
{
if (value > (ExperienceData.getInstance().getMaxLevel() - 1))
if (value > (Config.SERVER_CLASSIC_SUPPORT ? Config.MAX_CLASSIC_PLAYER_LEVEL : ExperienceData.getInstance().getMaxLevel() - 1))
{
value = (byte) (ExperienceData.getInstance().getMaxLevel() - 1);
value = Config.SERVER_CLASSIC_SUPPORT ? Config.MAX_CLASSIC_PLAYER_LEVEL : (byte) (ExperienceData.getInstance().getMaxLevel() - 1);
}
if (getActiveChar().isSubClassActive())