Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/CustomMods/ProtectionMods.ini b/config/CustomMods/ProtectionMods.ini
- index 51409f2..c476345 100644
- --- a/config/CustomMods/ProtectionMods.ini
- +++ b/config/CustomMods/ProtectionMods.ini
- @@ -42,3 +42,14 @@
- # Default: 0, 0
- ShoutRestrictionValue = 40
- +#=============================================================
- +# Anti PvP Sames IPS
- +#=============================================================
- +# PVP ( Bot ) Protection Enabled?
- +# Recomended is True ( Official = False )
- +PvPSameIP = False
- +
- +# PVP ( Summon ) Protection Enabled?
- +# Recomended is True ( Official = False )
- +PvPSumon = False
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index bd85520..ffaa2f8 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -83,6 +83,8 @@
- public static boolean ANNOUNCE_PK_KILL;
- public static boolean ANNOUNCE_PVP_KILL;
- /** Clan Hall function */
- + public static boolean PVP_SAME_IP;
- + public static boolean PVP_SUMON;
- public static long CH_TELE_FEE_RATIO;
- public static int CH_TELE1_FEE;
- public static int CH_TELE2_FEE;
- @@ -1119,6 +1121,8 @@
- WELCOME_MESSAGE_TIME_ENCHANT = Integer.parseInt(Protection.getProperty("ScreenEnchantMessageTime", "6")) * 1000;
- SHOUT_RESTRICTION_TYPE = ShoutRestrictionType.valueOf(Protection.getProperty("ShoutRestrictionType", "NONE"));
- SHOUT_RESTRICTION_VALUE = Integer.parseInt(Protection.getProperty("ShoutRestrictionValue", "0"));
- + PVP_SAME_IP = Boolean.parseBoolean(Protection.getProperty("PvPSameIP", "False"));
- + PVP_SUMON = Boolean.parseBoolean(Protection.getProperty("PvPSumon", "False"));
- }
- private static final void loadOff()
- diff --git a/java/net/sf/l2j/gameserver/model/actor/Player.java b/java/net/sf/l2j/gameserver/model/actor/Player.java
- index 698ed21..418fd3f 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/Player.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/Player.java
- @@ -2866,7 +2866,21 @@
- CursedWeaponManager.getInstance().increaseKills(_cursedWeaponEquippedId);
- return;
- }
- -
- + if (Config.PVP_SAME_IP)
- + {
- + String player1 = getClient().getConnection().getInetAddress().getHostAddress();
- + String player1target = targetPlayer.getClient().getConnection().getInetAddress().getHostAddress();
- + if (player1.equals(player1target)) {
- + return;
- + }
- + }
- + // Check if it's pvp SUMMON
- + if (Config.PVP_SUMON)
- + {
- + if(target instanceof Summon || target instanceof Servitor){
- + return;
- + }
- + }
- // If in duel and you kill (only can kill l2summon), do nothing
- if (isInDuel() && targetPlayer.isInDuel())
- return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement