Jump to content

Recommended Posts

Posted (edited)

Copy from l2jacis to l2jfrozen work 100%

 

http://rgho.st/6cDtBxqKH Images! 

Index: head-src/com/l2jfrozen/gameserver/custom/Antibot.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/custom/Antibot.java	(revision 0)
+++ head-src/com/l2jfrozen/gameserver/custom/Antibot.java	(revision 0)
@@ -0,0 +1,134 @@
+package com.l2jfrozen.gameserver.custom;
+
+import java.io.File;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jfrozen.gameserver.network.serverpackets.PledgeCrest;
+import com.l2jfrozen.util.DDSConverter;
+import com.l2jfrozen.util.random.Rnd;
+
+
+public class Antibot {
+
+	   public static void showHtmlWindow(L2PcInstance activeChar)
+	   {
+	     int rnd = Rnd.get(1,4);
+		generateLogo(activeChar, 50011);
+		generateLogo(activeChar, 50012);
+		generateLogo(activeChar, 50013);
+		generateLogo(activeChar, 50014);
+	   	
+	   	NpcHtmlMessage nhm = new NpcHtmlMessage(5);
+	   	StringBuilder tb = new StringBuilder("");
+	   	
+	   	tb.append("<html><head><title>Antibot</title></head><body>");
+	   	tb.append("<center>");
+	   	tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
+	   	tb.append("<tr>");
+	   	tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
+	   	tb.append("<td valign=\"top\"><font color=\"FF6600\">Antibot</font>");
+	   	if(rnd == 1)
+	   	tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, we just wanna make sure you are not a bot.<font color=\"FF0000\"> CLICK THE ELF</font><br1></td>");
+	   	else if(rnd == 2)
+        tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, we just wanna make sure you are not a bot.<font color=\"FF0000\"> CLICK THE HUMAN</font><br1></td>");
+	   	else if(rnd == 3)
+	    tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, we just wanna make sure you are not a bot.<font color=\"FF0000\"> CLICK THE DARK ELF</font><br1></td>");
+	   	else if(rnd == 4)
+	    tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, we just wanna make sure you are not a bot.<font color=\"FF0000\"> CLICK THE LINEAGE ][</font><br1></td>");
+		   	
+	   	tb.append("</tr>");
+	   	tb.append("</table>");
+	   	tb.append("<table width=\"256\" cellpadding=\"5\" bgcolor=\"000000\">");
+	   	switch(rnd)
+	   	{
+	   	    case 1:
+	   		   	tb.append("<tr>");
+		     	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_correct\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\"></td>");
+		    	tb.append("</tr>");
+		    	tb.append("<tr>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\"></td>");
+		        tb.append("</tr>");
+	   		break;
+	   	    case 2:
+	   		   	tb.append("<tr>");
+		     	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_correct\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\"></td>");
+		    	tb.append("</tr>");
+		    	tb.append("<tr>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\"></td>");
+		        tb.append("</tr>");
+	   	    	break;
+	   	    case 3:
+	   		   	tb.append("<tr>");
+		     	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\"></td>");
+		    	tb.append("</tr>");
+		    	tb.append("<tr>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_correct\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\"></td>");
+		        tb.append("</tr>");
+	   	    	break;
+	   	    case 4:
+	   		   	tb.append("<tr>");
+		     	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50011 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50012 + "\"></td>");
+		    	tb.append("</tr>");
+		    	tb.append("<tr>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_correct\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50013 + "\"></td>");
+		    	tb.append("<td width=\"128\" valign=\"top\" align=\"center\"><button action=\"bypass -h antibot_wrong\" width=128 height=128 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 50014 + "\"></td>");
+		        tb.append("</tr>");
+	   	    	break;
+	   	    	
+	   	}
+	   	tb.append("</table>");
+	   	
+		tb.append("</center>");
+	   	tb.append("</body></html>");
+	   	
+	   	nhm.setHtml(tb.toString());
+	   	activeChar.sendPacket(nhm);
+	}
+	   
+	public static void generateLogo(L2PcInstance activeChar,int imgId)
+	{
+	       try
+	       {
+	     	  if(imgId == 50011)
+	     	  {
+	               File captcha = new File("data/images/elf.png");    
+	               PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array());
+	               activeChar.sendPacket(packet);
+	     	  }
+	     	  
+	     	  if(imgId == 50012)
+	     	  {
+	               File captcha = new File("data/images/Lineage2.png");    
+	               PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array());
+	               activeChar.sendPacket(packet);
+	     	  }
+	     	  
+	     	  if(imgId == 50013)
+	     	  {
+	               File captcha = new File("data/images/Lineage3.png");    
+	               PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array());
+	               activeChar.sendPacket(packet);
+	     	  }
+	     	  
+	     	  if(imgId == 50014)
+	     	  {
+	               File captcha = new File("data/images/Lineage4.png");    
+	               PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array());
+	                  activeChar.sendPacket(packet);
+	     	  }
+	     	  
+	       }
+	       catch (Exception e)
+	       {}	
+	}
+	
+}
===========================================================================================


### Eclipse Workspace Patch 1.0
#P gevorakos2015
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java	(revision 1117)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java	(working copy)
@@ -23,6 +23,7 @@
 import static com.l2jfrozen.gameserver.ai.CtrlIntention.AI_INTENTION_ACTIVE;
 
 import java.text.DateFormat;
 import java.util.List;
 
 import javolution.text.TextBuilder;
@@ -30,6 +31,10 @@
 
 import org.omg.PortableServer.POAManagerPackage.State;
 
+import com.l2jfrozen.gameserver.custom.Antibot;
 import com.l2jfrozen.Config;
 import com.l2jfrozen.gameserver.ai.CtrlIntention;
 import com.l2jfrozen.gameserver.cache.HtmCache;
@@ -59,6 +64,7 @@
 import com.l2jfrozen.gameserver.model.actor.knownlist.NpcKnownList;
 import com.l2jfrozen.gameserver.model.actor.stat.NpcStat;
 import com.l2jfrozen.gameserver.model.actor.status.NpcStatus;
 import com.l2jfrozen.gameserver.model.entity.event.CTF;
 import com.l2jfrozen.gameserver.model.entity.event.DM;
 import com.l2jfrozen.gameserver.model.entity.event.L2Event;
@@ -147,6 +153,8 @@
 	/** The _is in town. */
 	private boolean _isInTown = false;
 	
+	private final int[] ANTIMOBS = Config.ALT_CAPTCHA_ANTIBOT_LIST;
+	
 	/**
 	 * Kill the L2NpcInstance (the corpse disappeared after 7 seconds).<BR>
 	 * <BR>
@@ -3053,8 +3084,69 @@
 	 * @return true, if successful
 	 */
 	@Override
	public boolean doDie(L2Character killer)
 	{		             
+	 //ANTIBOT - Start
+	 if(Config.SHOW_CAPTCHA)
+	 {	
+	  if(contains(ANTIMOBS, getNpcId()) && (killer instanceof L2PcInstance) || (killer instanceof L2PetInstance) || (killer instanceof L2SummonInstance))
+	  {
+				//+1 to mobcounter
+				player.setAntibotKills(player.getAntibotKills() + 1);
+				            
+				
+				if(player.getClassId() == ClassId.dreadnought && player.getAntibotKills() == 320)
+				{
+					player._antibotCorrect = false;
+					player._antibotRunning = true;
+					Antibot.showHtmlWindow(player);
+				    player.sendMessage("You have 10 seconds to click on the dog or you will get back in town for botting!");
+					ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+					{
+						@Override
+		                public void run()
+		                {
+							if(!player._antibotCorrect)
+							{
+								player.sendMessage("You failed clicking on the bog. You are a bot!");
+								player.setAntibotKills(0);
+								player.teleToLocation(81630, 148610, -3467);
+							}
+							
+							player._antibotRunning = false;
+		                }
+						}, 10000);
+				}
+				
+					//Checks the mobcounter
+					if(player.getAntibotKills() == Config.ALT_CAPTCHA_MOBS_KILLS)
+					{
+						player._antibotCorrect = false;
+						player._antibotRunning = true;
+						Antibot.showHtmlWindow(player);
+						player.sendMessage("You have 10 seconds to click on the elf or you will get back in town for botting!");
+						ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+						{
+							@Override
+			                public void run()
+			                {
+								if(!player._antibotCorrect)
+								{
+									player.sendMessage("You failed clicking on the bog. You are a bot!");
+									player.setAntibotKills(0);
+									player.teleToLocation(Config.ALT_CAPTCHA_ANTIBOT_X, Config.ALT_CAPTCHA_ANTIBOT_Y, Config.ALT_CAPTCHA_ANTIBOT_Z);
+								}
+								
+								player._antibotRunning = false;
+			                }
+							}, 10000);
+					}
+		    }
+	    }
 		if (!super.doDie(killer))
 			return false;
 		

Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java	(revision 1117)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java	(working copy)
@@ -20,15 +20,54 @@
  */
 package com.l2jfrozen.gameserver.network.clientpackets;

 	{
@@ -121,10 +165,389 @@
 			{
 				comeHere(activeChar);
 			}
+			else if (_command.startsWith("antibot_"))
+			{
+		   if(_command.substring(8).equals("correct"))
+			 {
+		    activeChar._antibotCorrect = true;
+			activeChar.setAntibotKills(0);
+			activeChar.sendMessage("Thank you for your co-opperation. Have a nice farm time!");
+				}
+				if(_command.substring(8).equals("wrong"))
+				{
+					activeChar._antibotCorrect = false;
+				}				
+			}
 		    else if (_command.startsWith("welcome_"))
		    {
		       WelcomeHtm.ShowWelcome(activeChar, _command,null);
		    }
			
			else if (_command.startsWith("votehopzone"))
 		}
 	@Override
 	public String getType()
 	{
 		return "[C] 21 RequestBypassToServer";
 	}
	
 }

	    		//Captcha Antibot
	    		public static boolean SHOW_CAPTCHA;
	    		public static String ALT_CAPTCHA_ANTIBOT;
	    		public static int[] ALT_CAPTCHA_ANTIBOT_LIST;
	    		public static int ALT_CAPTCHA_MOBS_KILLS;
	    		public static int ALT_CAPTCHA_ANTIBOT_X;
	    		public static int ALT_CAPTCHA_ANTIBOT_Y;
	    		public static int ALT_CAPTCHA_ANTIBOT_Z;


			SHOW_CAPTCHA = Boolean.parseBoolean(L2JFrozenSettings.getProperty("CaptchaEnabled", "true"));
			ALT_CAPTCHA_ANTIBOT = L2JFrozenSettings.getProperty("CaptchaNpcId", "2375,3500,3501");
			String[] array1 = ALT_CAPTCHA_ANTIBOT.split(",");
			ALT_CAPTCHA_ANTIBOT_LIST = new int[array1.length];
			for (int i = 0; i < array1.length; i++)
			ALT_CAPTCHA_ANTIBOT_LIST[i] = Integer.parseInt(array1[i]);
			ALT_CAPTCHA_MOBS_KILLS = Integer.parseInt(L2JFrozenSettings.getProperty("CaptchaMobsKills", "1"));
			ALT_CAPTCHA_ANTIBOT_X = Integer.parseInt(L2JFrozenSettings.getProperty("CaptchaSpawnX", ""));
			ALT_CAPTCHA_ANTIBOT_Y = Integer.parseInt(L2JFrozenSettings.getProperty("CaptchaSpawnY", ""));
			ALT_CAPTCHA_ANTIBOT_Z = Integer.parseInt(L2JFrozenSettings.getProperty("CaptchaSpawnZ", ""));

Configs

#=============================================================
#                  Captcha Antibot
#=============================================================
# Captcha True or False
CaptchaEnabled = True

# Captcha Npc Id px. 38299,38827,3827
CaptchaNpcId = 60,61,20

#Captcha Mobs Kills px. 300
CaptchaMobsKills = 200

#Captcha Teleport Bot Location Town
CaptchaSpawnX = 82391
CaptchaSpawnY = 149214
CaptchaSpawnZ = -3495

Edited by Crazyboy*
  • 2 weeks later...
Posted (edited)

hey man ...so i tried ur code and here are some problems that showed up..

 

first of all there is no such thing like: head-src/com/l2jfrozen/gameserver/custom

 

 (all i could find was  head-src/com/l2jfrozen/gameserver/handler/custom)

 

secondly, import com.l2jfrozen.util.DDSConverter;  does not exist...

 

here's a photo...hope u can help me fix it ;)

Edited by protoftw

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock