Advertisement
Sarada-L2

Block PvP/Pk Kill Mesma maquina Acis 394+

Feb 28th, 2021
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. diff --git a/config/CustomMods/ProtectionMods.ini b/config/CustomMods/ProtectionMods.ini
  2. index 51409f2..c476345 100644
  3. --- a/config/CustomMods/ProtectionMods.ini
  4. +++ b/config/CustomMods/ProtectionMods.ini
  5. @@ -42,3 +42,14 @@
  6. # Default: 0, 0
  7. ShoutRestrictionValue = 40
  8.  
  9. +#=============================================================
  10. +# Anti PvP Sames IPS
  11. +#=============================================================
  12. +# PVP ( Bot ) Protection Enabled?
  13. +# Recomended is True ( Official = False )
  14. +PvPSameIP = False
  15. +
  16. +# PVP ( Summon ) Protection Enabled?
  17. +# Recomended is True ( Official = False )
  18. +PvPSumon = False
  19. +
  20. diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
  21. index bd85520..ffaa2f8 100644
  22. --- a/java/net/sf/l2j/Config.java
  23. +++ b/java/net/sf/l2j/Config.java
  24. @@ -83,6 +83,8 @@
  25. public static boolean ANNOUNCE_PK_KILL;
  26. public static boolean ANNOUNCE_PVP_KILL;
  27. /** Clan Hall function */
  28. + public static boolean PVP_SAME_IP;
  29. + public static boolean PVP_SUMON;
  30. public static long CH_TELE_FEE_RATIO;
  31. public static int CH_TELE1_FEE;
  32. public static int CH_TELE2_FEE;
  33. @@ -1119,6 +1121,8 @@
  34. WELCOME_MESSAGE_TIME_ENCHANT = Integer.parseInt(Protection.getProperty("ScreenEnchantMessageTime", "6")) * 1000;
  35. SHOUT_RESTRICTION_TYPE = ShoutRestrictionType.valueOf(Protection.getProperty("ShoutRestrictionType", "NONE"));
  36. SHOUT_RESTRICTION_VALUE = Integer.parseInt(Protection.getProperty("ShoutRestrictionValue", "0"));
  37. + PVP_SAME_IP = Boolean.parseBoolean(Protection.getProperty("PvPSameIP", "False"));
  38. + PVP_SUMON = Boolean.parseBoolean(Protection.getProperty("PvPSumon", "False"));
  39. }
  40.  
  41. private static final void loadOff()
  42. diff --git a/java/net/sf/l2j/gameserver/model/actor/Player.java b/java/net/sf/l2j/gameserver/model/actor/Player.java
  43. index 698ed21..418fd3f 100644
  44. --- a/java/net/sf/l2j/gameserver/model/actor/Player.java
  45. +++ b/java/net/sf/l2j/gameserver/model/actor/Player.java
  46. @@ -2866,7 +2866,21 @@
  47. CursedWeaponManager.getInstance().increaseKills(_cursedWeaponEquippedId);
  48. return;
  49. }
  50. -
  51. + if (Config.PVP_SAME_IP)
  52. + {
  53. + String player1 = getClient().getConnection().getInetAddress().getHostAddress();
  54. + String player1target = targetPlayer.getClient().getConnection().getInetAddress().getHostAddress();
  55. + if (player1.equals(player1target)) {
  56. + return;
  57. + }
  58. + }
  59. + // Check if it's pvp SUMMON
  60. + if (Config.PVP_SUMON)
  61. + {
  62. + if(target instanceof Summon || target instanceof Servitor){
  63. + return;
  64. + }
  65. + }
  66. // If in duel and you kill (only can kill l2summon), do nothing
  67. if (isInDuel() && targetPlayer.isInDuel())
  68. return;
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement