Bläddra i källkod

Two new config options: StartingLevel and StartingSP, self-explanatory.

_DS_ 15 år sedan
förälder
incheckning
a34bdf5d2e

+ 8 - 0
L2_GameServer/java/config/Character.properties

@@ -479,6 +479,14 @@ AltPartyRange2 = 1400
 # Default: 0
 StartingAdena = 0
 
+# This is the starting level of the new character.
+# Default: 1
+StartingLevel = 1
+
+# This is the amount of SP that a new character starts their character with.
+# Default: 0
+StartingSP = 0
+
 # This option, when set to True, will enable automatically picking up items.
 # If set False it will force the player to pickup dropped items from mobs.
 # This excludes herbs mentioned above and items from Raid/GrandBosses with minions.

+ 6 - 0
L2_GameServer/java/net/sf/l2j/Config.java

@@ -154,6 +154,8 @@ public final class Config
 	public static int ALT_PARTY_RANGE;
 	public static int ALT_PARTY_RANGE2;
 	public static long STARTING_ADENA;
+	public static byte STARTING_LEVEL;
+	public static int STARTING_SP;
 	public static boolean AUTO_LOOT;
 	public static boolean AUTO_LOOT_RAIDS;
 	public static int UNSTUCK_INTERVAL;
@@ -1272,6 +1274,8 @@ public final class Config
 					ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
 					ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
 					STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
+					STARTING_LEVEL = Byte.parseByte(Character.getProperty("StartingLevel", "1"));
+					STARTING_SP = Integer.parseInt(Character.getProperty("StartingSP", "0"));
 					AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
 					AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
 					UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
@@ -2270,6 +2274,8 @@ public final class Config
 		else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);
 
 		else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
+		else if (pName.equalsIgnoreCase("StartingLevel")) STARTING_LEVEL = Byte.parseByte(pValue);
+		else if (pName.equalsIgnoreCase("StartingSP")) STARTING_SP = Integer.parseInt(pValue);
 		else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);
 
 		else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);

+ 9 - 0
L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java

@@ -197,6 +197,15 @@ public final class CharacterCreate extends L2GameClientPacket
 
 		newChar.setVitalityPoints(PcStat.MAX_VITALITY_POINTS, true);
 
+		if (Config.STARTING_LEVEL > 1)
+		{
+			newChar.getStat().addLevel(--Config.STARTING_LEVEL);
+		}
+		if (Config.STARTING_SP > 0)
+		{
+			newChar.getStat().addSp(Config.STARTING_SP);
+		}
+
 		L2ShortCut shortcut;
 		// add attack shortcut
 		shortcut = new L2ShortCut(0, 0, 3, 2, 0, 1);