Jump to content

[SHARE]Pvp related chat system


Intrepid

Recommended Posts

  • 1 month later...
  • 1 month later...

The only problem is that the anti-flood system does not work. Anyone able to add and anti-flood system still work?

 

I await an answer!

 

Thats your problem if you cant patch a file not the problem of the patch itself.

Link to comment
Share on other sites

That's right, I'm that with this problem. Below is my script like this. Some friend of the forum here, could you help me?

 

Be very grateful! Intrepid, Congratulations for your system.

 

I await a response

 

Index: C:/Projeto_L2JServer/workspace/L2J_DataPack/data/scripts/handlers/chathandlers/ChatTrade.java
===================================================================
--- C:/Projeto_L2JServer/workspace/L2J_DataPack/data/scripts/handlers/chathandlers/ChatTrade.java	(revision 7785)
+++ C:/Projeto_L2JServer/workspace/L2J_DataPack/data/scripts/handlers/chathandlers/ChatTrade.java	(working copy)
@@ -16,10 +16,7 @@

import java.util.Collection;

-import com.l2jserver.Config;
-import com.l2jserver.gameserver.datatables.MapRegionTable;
import com.l2jserver.gameserver.handler.IChatHandler;
-import com.l2jserver.gameserver.model.BlockList;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
@@ -43,32 +40,13 @@
	 */
	public void handleChat(int type, L2PcInstance activeChar, String target, String text)
	{
-		CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
-		
-		Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
-		
-		if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
+		if((activeChar.getPvpKills() >= 1000) || (activeChar.isGM()))
		{
-			int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
+			CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
+		
+			Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
			for (L2PcInstance player : pls)
-			{
-				if (region == MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY()) && !BlockList.isBlocked(player, activeChar) && player.getInstanceId() == activeChar.getInstanceId())
-					player.sendPacket(cs);
-			}
-		}
-		else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("global"))
-		{
-			if (!activeChar.isGM() && !activeChar.getFloodProtectors().getGlobalChat().tryPerformAction("global chat"))
-			{
-				activeChar.sendMessage("Do not spam trade channel.");
-				return;
-			}
-			
-			for (L2PcInstance player : pls)
-			{
-				if (!BlockList.isBlocked(player, activeChar))
-					player.sendPacket(cs);
-			}
+				player.sendPacket(cs);
		}
	}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...