Advertisement
Sarada-L2

Falar no chat somente tendo Lv ou Pvp Acis 394+

Feb 28th, 2021
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. diff --git a/config/CustomMods/ProtectionMods.ini b/config/CustomMods/ProtectionMods.ini
  2. index e3de7d8..51409f2 100644
  3. --- a/config/CustomMods/ProtectionMods.ini
  4. +++ b/config/CustomMods/ProtectionMods.ini
  5. @@ -30,3 +30,15 @@
  6. # Show screen Enchant message for x seconds when character.
  7. ScreenEnchantMessageTime = 4
  8.  
  9. +#=============================================================
  10. +# Protection Speak All Char for Level Or PvP
  11. +#=============================================================
  12. +# Enable restriction for shout/trade voice
  13. +# Usable values: PVP, LEVEL, NONE
  14. +# Default: NONE
  15. +ShoutRestrictionType = LEVEL
  16. +
  17. +# Restriction values for shout/trade voice
  18. +# Default: 0, 0
  19. +ShoutRestrictionValue = 40
  20. +
  21. diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
  22. index a88012b..bd85520 100644
  23. --- a/java/net/sf/l2j/Config.java
  24. +++ b/java/net/sf/l2j/Config.java
  25. @@ -491,7 +491,12 @@
  26. public static int REQUEST_ID;
  27. public static boolean ACCEPT_ALTERNATE_ID;
  28. public static boolean USE_BLOWFISH_CIPHER;
  29. -
  30. + public static ShoutRestrictionType SHOUT_RESTRICTION_TYPE;
  31. + public static int SHOUT_RESTRICTION_VALUE;
  32. + public static enum ShoutRestrictionType
  33. + {
  34. + PVP, LEVEL, NONE
  35. + }
  36. /** Access to database */
  37. public static String DATABASE_URL;
  38. public static String DATABASE_LOGIN;
  39. @@ -1112,6 +1117,8 @@
  40. PHX_ENCHANT_WAREHOUSE = Boolean.parseBoolean(Protection.getProperty("EnableProtectionEnchantWarehouse", "false"));
  41. WELCOME_MESSAGE_ENCHANT = Protection.getProperty("ScreenEnchantMessageText", "Forbidden to Use Enchant near the bank!");
  42. WELCOME_MESSAGE_TIME_ENCHANT = Integer.parseInt(Protection.getProperty("ScreenEnchantMessageTime", "6")) * 1000;
  43. + SHOUT_RESTRICTION_TYPE = ShoutRestrictionType.valueOf(Protection.getProperty("ShoutRestrictionType", "NONE"));
  44. + SHOUT_RESTRICTION_VALUE = Integer.parseInt(Protection.getProperty("ShoutRestrictionValue", "0"));
  45. }
  46.  
  47. private static final void loadOff()
  48. diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java b/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
  49. index 3c5b32f..3e02949 100644
  50. --- a/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
  51. +++ b/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
  52. @@ -5,6 +5,7 @@
  53. import java.util.logging.Logger;
  54.  
  55. import net.sf.l2j.Config;
  56. +import net.sf.l2j.Config.ShoutRestrictionType;
  57. import net.sf.l2j.gameserver.enums.SayType;
  58. import net.sf.l2j.gameserver.handler.ChatHandler;
  59. import net.sf.l2j.gameserver.handler.IChatHandler;
  60. @@ -91,7 +92,17 @@
  61. player.sendPacket(SystemMessageId.CHATTING_PROHIBITED);
  62. return;
  63. }
  64. -
  65. + int restrictionValue = Config.SHOUT_RESTRICTION_VALUE;
  66. + if (Config.SHOUT_RESTRICTION_TYPE == ShoutRestrictionType.PVP && player.getPvpKills() < restrictionValue)
  67. + {
  68. + player.sendMessage("You will gain shout voice at " + restrictionValue + " PVPs.");
  69. + return;
  70. + }
  71. + if (Config.SHOUT_RESTRICTION_TYPE == ShoutRestrictionType.LEVEL && player.getStatus().getLevel() < restrictionValue)
  72. + {
  73. + player.sendMessage("You will gain shout voice at level " + restrictionValue + ".");
  74. + return;
  75. + }
  76. if (type == SayType.PETITION_PLAYER && player.isGM())
  77. type = SayType.PETITION_GM;
  78.  
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement