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 e3de7d8..51409f2 100644
- --- a/config/CustomMods/ProtectionMods.ini
- +++ b/config/CustomMods/ProtectionMods.ini
- @@ -30,3 +30,15 @@
- # Show screen Enchant message for x seconds when character.
- ScreenEnchantMessageTime = 4
- +#=============================================================
- +# Protection Speak All Char for Level Or PvP
- +#=============================================================
- +# Enable restriction for shout/trade voice
- +# Usable values: PVP, LEVEL, NONE
- +# Default: NONE
- +ShoutRestrictionType = LEVEL
- +
- +# Restriction values for shout/trade voice
- +# Default: 0, 0
- +ShoutRestrictionValue = 40
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index a88012b..bd85520 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -491,7 +491,12 @@
- public static int REQUEST_ID;
- public static boolean ACCEPT_ALTERNATE_ID;
- public static boolean USE_BLOWFISH_CIPHER;
- -
- + public static ShoutRestrictionType SHOUT_RESTRICTION_TYPE;
- + public static int SHOUT_RESTRICTION_VALUE;
- + public static enum ShoutRestrictionType
- + {
- + PVP, LEVEL, NONE
- + }
- /** Access to database */
- public static String DATABASE_URL;
- public static String DATABASE_LOGIN;
- @@ -1112,6 +1117,8 @@
- PHX_ENCHANT_WAREHOUSE = Boolean.parseBoolean(Protection.getProperty("EnableProtectionEnchantWarehouse", "false"));
- WELCOME_MESSAGE_ENCHANT = Protection.getProperty("ScreenEnchantMessageText", "Forbidden to Use Enchant near the bank!");
- 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"));
- }
- private static final void loadOff()
- diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java b/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- index 3c5b32f..3e02949 100644
- --- a/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- +++ b/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- @@ -5,6 +5,7 @@
- import java.util.logging.Logger;
- import net.sf.l2j.Config;
- +import net.sf.l2j.Config.ShoutRestrictionType;
- import net.sf.l2j.gameserver.enums.SayType;
- import net.sf.l2j.gameserver.handler.ChatHandler;
- import net.sf.l2j.gameserver.handler.IChatHandler;
- @@ -91,7 +92,17 @@
- player.sendPacket(SystemMessageId.CHATTING_PROHIBITED);
- return;
- }
- -
- + int restrictionValue = Config.SHOUT_RESTRICTION_VALUE;
- + if (Config.SHOUT_RESTRICTION_TYPE == ShoutRestrictionType.PVP && player.getPvpKills() < restrictionValue)
- + {
- + player.sendMessage("You will gain shout voice at " + restrictionValue + " PVPs.");
- + return;
- + }
- + if (Config.SHOUT_RESTRICTION_TYPE == ShoutRestrictionType.LEVEL && player.getStatus().getLevel() < restrictionValue)
- + {
- + player.sendMessage("You will gain shout voice at level " + restrictionValue + ".");
- + return;
- + }
- if (type == SayType.PETITION_PLAYER && player.isGM())
- type = SayType.PETITION_GM;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement