Jump to content

[Share][L2J] Low Level Protection


Recommended Posts

Hello here is a simple protection for low level Characters , ( Avoid Pking, PvPing, ETC )

 

Here is the diff file ( is a well known protection, if is already shared on Mod, please lock it )

 

Index: C:/Program Files/WorkSpace/Eclipse/java/config/altsettings.properties
===================================================================
--- C:/Program Files/WorkSpace/Eclipse/java/config/altsettings.properties
+++ C:/Program Files/WorkSpace/Eclipse/java/config/altsettings.properties
@@ -70,9 +70,21 @@
AltKarmaPlayerCanTrade = True
AltKarmaPlayerCanUseWareHouse = True

+# Low Level Protection - System.
+AltPlayerProtectionLevel = 25
+
# Allow free teleportation around the world.
AltFreeTeleporting = False

Index: C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/Config.java
===================================================================
--- C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/Config.java
+++ C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/Config.java
@@ -749,7 +767,8 @@
    public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
    /** Allow player with karma to use warehouse ?*/
    public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
+
+    public static int ALT_PLAYER_PROTECTION_LEVEL;
    // Day/Night Status
    /** Force the client to change their day and night status ? */
    public static boolean DAY_STATUS_FORCE_CLIENT_UPDATE;
@@ -1479,6 +1503,7 @@
                ALT_GAME_KARMA_PLAYER_CAN_TELEPORT                  = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
                ALT_GAME_KARMA_PLAYER_CAN_TRADE                     = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
                ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE             = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
+                ALT_PLAYER_PROTECTION_LEVEL                         = Integer.parseInt(altSettings.getProperty("AltPlayerProtectionLevel","0"));
                ALT_GAME_FREE_TELEPORT                              = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
                ALT_GAME_SUBCLASS_WITHOUT_QUESTS                    = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
                ALT_GAME_VIEWNPC                    				= Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
Index: C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
+++ C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
@@ -3129,9 +3140,14 @@
				// Check if this L2PcInstance is autoAttackable
				if (isAutoAttackable(player))
				{
+					if(player.getLevel() < Config.ALT_PLAYER_PROTECTION_LEVEL || this.getLevel() < Config.ALT_PLAYER_PROTECTION_LEVEL)
+					{
+						player.sendMessage("You cannot attack the player until he is Level: " + String.valueOf(Config.ALT_PLAYER_PROTECTION_LEVEL));
+						player.sendPacket(new ActionFailed());
+					}
					// Player with lvl < 21 can't attack a cursed weapon holder
					// And a cursed weapon holder  can't attack players with lvl < 21
-					if ((isCursedWeaponEquiped() && player.getLevel() < 21)
+					else if ((isCursedWeaponEquiped() && player.getLevel() < 21)
							|| (player.isCursedWeaponEquiped() && this.getLevel() < 21))
					{
						player.sendPacket(new ActionFailed());

 

Credits: Eclipse. Thanks for your time.

Link to comment
Share on other sites

  • 4 months later...
Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock