Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P l2jelios_gameserver
- Index: java/net/sf/l2j/gameserver/network/clientpackets/Say2.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 4)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (working copy)
- @@ -24,6 +24,8 @@
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- +import net.sf.l2j.gameserver.util.Broadcast;
- import net.sf.l2j.gameserver.util.IllegalPlayerAction;
- import net.sf.l2j.gameserver.util.Util;
- @@ -165,6 +167,9 @@
- return;
- }
- + if(checkPvpChatFunction(activeChar , _text , _type))
- + return;
- +
- if (activeChar.isChatBanned() || (activeChar.isInJail() && !activeChar.isGM()))
- {
- activeChar.sendPacket(SystemMessageId.CHATTING_PROHIBITED);
- @@ -204,6 +209,25 @@
- _log.warning(activeChar.getName() + " tried to use unregistred chathandler type: " + _type + ".");
- }
- + private static boolean checkPvpChatFunction(L2PcInstance player , String text , int type)
- + {
- + if(Config.ALLOW_PVP_CHAT)
- + {
- + if(type == 0)
- + {
- + if(text.startsWith(Config.PVP_CHAT_PREFIX))
- + {
- + if(player.getPvpKills() >= Config.PVP_AMOUNT_FOR_CHAT)
- + {
- + Broadcast.toAllOnlinePlayers(new CreatureSay(0,15,player.getName(),text.substring(1)));
- + return true;
- + }
- + }
- + }
- + }
- + return false;
- + }
- +
- private static boolean checkBot(String text)
- {
- for (String botCommand : WALKER_COMMAND_LIST)
- Index: config/l2jelios.properties
- ===================================================================
- --- config/l2jelios.properties (revision 5)
- +++ config/l2jelios.properties (working copy)
- @@ -0,0 +1,7 @@
- +# Unique Chat Mode based on PvP
- +# On X PvP you are allowed to talk from a special chat.
- +AllowPvpChat = False
- +# How many PvP are needed to use this chat.
- +PvpAmountForChat = 100
- +# Chat's prefix. Default : -
- +PvpChatPrefix = -
- \ No newline at end of file
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 5)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -485,6 +485,10 @@
- // l2jelios configurable file
- + public static boolean ALLOW_PVP_CHAT;
- + public static String PVP_CHAT_PREFIX;
- + public static int PVP_AMOUNT_FOR_CHAT;
- +
- // --------------------------------------------------
- // Server
- // --------------------------------------------------
- @@ -1256,6 +1260,10 @@
- l2jelios.load(is);
- is.close();
- + ALLOW_PVP_CHAT = Boolean.parseBoolean(l2jelios.getProperty("AllowPvpChat", "False"));
- + PVP_AMOUNT_FOR_CHAT = Integer.parseInt(l2jelios.getProperty("PvpAmountForChat", "100"));
- + PVP_CHAT_PREFIX = l2jelios.getProperty("PvpChatPrefix", "-");
- +
- }
- catch (Exception e)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement