Prechádzať zdrojové kódy

Config option to set offline traders invulnerable.

Nik 13 rokov pred
rodič
commit
c4e2e5495e

+ 4 - 0
L2J_Server_BETA/dist/game/config/l2jmods.properties

@@ -256,6 +256,10 @@ OfflineCraftEnable = False
 # Default: False
 OfflineModeInPaceZone = False
 
+# If set to True, players in off-line shop mode will be invulnerable.
+# Default: False
+OfflineModeSetInvulnerable = False
+
 # If set to True, name color will be changed then entering offline mode
 OfflineSetNameColor = False
 

+ 2 - 0
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -706,6 +706,7 @@ public final class Config
 	public static boolean OFFLINE_TRADE_ENABLE;
 	public static boolean OFFLINE_CRAFT_ENABLE;
 	public static boolean OFFLINE_MODE_IN_PEACE_ZONE;
+	public static boolean OFFLINE_MODE_SET_INVULNERABLE;
 	public static boolean RESTORE_OFFLINERS;
 	public static int OFFLINE_MAX_DAYS;
 	public static boolean OFFLINE_DISCONNECT_FINISHED;
@@ -2493,6 +2494,7 @@ public final class Config
 					OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
 					OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
 					OFFLINE_MODE_IN_PEACE_ZONE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineModeInPaceZone", "False"));
+					OFFLINE_MODE_SET_INVULNERABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineModeSetInvulnerable", "False"));
 					OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
 					OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
 					OFFLINE_FAME = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineFame", "true"));

+ 2 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java

@@ -222,6 +222,8 @@ public class OfflineTradersTable
 					stm_items.close();
 					
 					player.sitDown();
+					if (Config.OFFLINE_MODE_SET_INVULNERABLE)
+						player.setIsInvul(true);
 					if (Config.OFFLINE_SET_NAME_COLOR)
 						player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
 					player.setPrivateStoreType(type);

+ 3 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/network/L2GameClient.java

@@ -765,6 +765,9 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 							}
 						}
 						
+						if (Config.OFFLINE_MODE_SET_INVULNERABLE)
+							getActiveChar().setIsInvul(true);
+						
 						if (Config.OFFLINE_SET_NAME_COLOR)
 						{
 							getActiveChar().getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);