Sistema Anty-Bots (by Pipiou21)

Iniciado por Swarlog, Jun 25, 2025, 09:10 PM

Tema anterior - Siguiente tema

Swarlog

No puedes ver este adjunto.

Index: C:/Users/George/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Attackable.java
    ===================================================================
    --- C:/Users/George/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 4278)
    +++ C:/Users/George/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
    @@ -15,10 +15,13 @@
    package com.l2jserver.gameserver.model.actor;

    import java.util.List;
    import java.util.Map;
    import java.util.logging.Level;

    import com.l2jserver.Config;
    +import com.l2jserver.gameserver.model.L2ItemInstance;
    import com.l2jserver.gameserver.ItemsAutoDestroy;
    import com.l2jserver.gameserver.ThreadPoolManager;
    import com.l2jserver.gameserver.ai.CtrlEvent;
    @@ -36,7 +39,6 @@
    import com.l2jserver.gameserver.model.L2CommandChannel;
    import com.l2jserver.gameserver.model.L2DropCategory;
    import com.l2jserver.gameserver.model.L2DropData;
    -import com.l2jserver.gameserver.model.L2ItemInstance;
    import com.l2jserver.gameserver.model.L2Manor;
    import com.l2jserver.gameserver.model.L2Party;
    import com.l2jserver.gameserver.model.L2Skill;
    @@ -59,7 +61,10 @@
    import com.l2jserver.gameserver.network.clientpackets.Say2;
    import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
    import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
    +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
    +import com.l2jserver.gameserver.network.serverpackets.StopMove;
    import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
    +import com.l2jserver.gameserver.skills.AbnormalEffect;
    import com.l2jserver.gameserver.skills.Stats;
    import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
    import com.l2jserver.gameserver.templates.item.L2EtcItemType;
    @@ -498,13 +503,73 @@
    *
    * @param killer The L2Character that has killed the L2Attackable
    */
    + private static int AntiBotKills = 0;
    + private static int Change = 0;
    + NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
    @Override
    public boolean doDie(L2Character killer)
    {
    // Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
    if (!super.doDie(killer))
    return false;
    + AntiBotKills++;
    + Change = Rnd.get(10);

    + if(AntiBotKills >= 50)
    + {
    + killer.startAbnormalEffect(AbnormalEffect.REAL_TARGET);
    + killer.setIsParalyzed(true);
    + StopMove sm = new StopMove(killer);
    + killer.setIsInvul(true);
    + killer.sendPacket(sm);
    + killer.broadcastPacket(sm);
    + AntiBotKills = 0;
    + switch(Change)
    + {
    + case 1:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12081208\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha 536BD\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 2:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12091209\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha A5B8D\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 3:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12101210\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha 1BF7F\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 4:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12111211\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha EF94C\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 5:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12121212\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha 5103B\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 6:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12131213\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha 8A59B\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 7:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12141214\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha DB3A1\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 8:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12151215\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha 890B4\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;
    + case 9:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12161216\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha D0B28\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + break;

    + case 10:
    + npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System</title><body><center><font color=\"66FF00\">Enter The Captcha Bellow And Click The<br1>Button \"Confirm\" To Continue You Farm.<br1>You Will Be Invulnerable Until You Enter<br1>The Captcha So No One Will Kill You!<br1></font><font color=\"66FF00\"><br><center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" height=\"32\" width=\"300\"><br><center><img src=\"CAPTCHA.12171217\" height=\"35\" width=\"128\"><br></center><edit var=\"captcha\" width=110><br><br></center><button value=\"Confirm\" action=\"bypass -h voice .CAPTCHA $captcha 5B676\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" height=\"32\" width=\"300\"><br>If A GM/Admin Found You Paralized<br1>Like That, You Will Get Banned!<br1>So Enter The Captcha ASAP.</font></center></body></html>");
    + killer.sendPacket( npcHtmlMessage );
    + default:
    + ;
    + }
    + }
    +
    // Enhance soul crystals of the attacker if this L2Attackable had its soul absorbed
    try
    {

    /** This program is free software: you can redistribute it and/or modify it under


    * the terms of the GNU General Public License as published by the Free Software


    * Foundation, either version 3 of the License, or (at your option) any later


    * version.


    *


    * This program is distributed in the hope that it will be useful, but WITHOUT


    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS


    * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more


    * details.


    *


    * You should have received a copy of the GNU General Public License along with


    * this program. If not, see <http://www.gnu.org/licenses/>.


    */


    package handlers.voicedcommandhandlers;





    import java.util.StringTokenizer;


    import java.util.logging.Level;





    import com.l2jserver.gameserver.handler.IVoicedCommandHandler;


    import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;


    import com.l2jserver.gameserver.skills.AbnormalEffect;


    import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;





    /**


    *


    * @author Pipiou21


    *


    */


    public class CAPTCHA implements IVoicedCommandHandler


    {


    private static final String[] _voicedCommands =


    {


    "CAPTCHA"


    };





    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)


    {


    NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );


    if (command.equalsIgnoreCase("CAPTCHA") && target != null)


    {


    StringTokenizer st = new StringTokenizer(target);


    try


    {


    String newpass = null, repeatnewpass = null;


    if (st.hasMoreTokens()) newpass = st.nextToken();


    if (st.hasMoreTokens()) repeatnewpass = st.nextToken();





    if (!(newpass == null || repeatnewpass == null))


    {


    if (newpass.equals(repeatnewpass))


    {


    activeChar.stopAbnormalEffect(AbnormalEffect.REAL_TARGET);


    activeChar.setIsInvul(false);


    activeChar.setIsParalyzed(false);


    return false;


    }





    }


    if (!newpass.equals(repeatnewpass))


    {


    npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System Incorrect</title><body><center><font color=\"FF0000\">Incorrect.<br><br></font><font color=\"66FF00\"><center></font><font color=\"FF0000\">You Will Be Jailed For 1 Min.</font></center></body></html>");


    activeChar.sendPacket( npcHtmlMessage );


    if (activeChar.isFlyingMounted())


    activeChar.untransform();


    activeChar.setPunishLevel(L2PcInstance.PunishLevel.JAIL, 1);


    activeChar.stopAbnormalEffect(AbnormalEffect.REAL_TARGET);


    activeChar.setIsInvul(false);


    activeChar.setIsParalyzed(false);


    return false;


    }


    else


    {


    npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System Incorrect</title><body><center><font color=\"FF0000\">Incorrect.<br><br></font><font color=\"66FF00\"><center></font><font color=\"FF0000\">You Will Be Jailed For 1 Min.</font></center></body></html>");


    activeChar.sendPacket( npcHtmlMessage );


    if (activeChar.isFlyingMounted())


    activeChar.untransform();


    activeChar.setPunishLevel(L2PcInstance.PunishLevel.JAIL, 1);


    activeChar.stopAbnormalEffect(AbnormalEffect.REAL_TARGET);


    activeChar.setIsInvul(false);


    activeChar.setIsParalyzed(false);


    return false;


    }


    }


    catch (Exception e)


    {


    activeChar.sendMessage("A problem occured while adding captcha!");


    _log.log(Level.WARNING, "", e);


    }


    }


    else


    {


    npcHtmlMessage.setHtml("<html><title>Servers Name Antibot System Incorrect</title><body><center><font color=\"FF0000\">Incorrect.<br><br></font><font color=\"66FF00\"><center></font><font color=\"FF0000\">You Will Be Jailed For 1 Min.</font></center></body></html>");


    activeChar.sendPacket( npcHtmlMessage );


    if (activeChar.isFlyingMounted())


    activeChar.untransform();


    activeChar.setPunishLevel(L2PcInstance.PunishLevel.JAIL, 1);


    activeChar.stopAbnormalEffect(AbnormalEffect.REAL_TARGET);


    activeChar.setIsInvul(false);


    activeChar.setIsParalyzed(false);


    return false;


    }


    return true;


    }





    public String[] getVoicedCommandList()


    {


    return _voicedCommands;


    }


    }



    Index: C:/Users/George/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/MasterHandler.java


    ===================================================================


    --- C:/Users/George/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/MasterHandler.java (revision 7482)


    +++ C:/Users/George/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/MasterHandler.java (working copy)


    @@ -35,7 +35,6 @@


    import com.l2jserver.gameserver.handler.UserCommandHandler;


    import com.l2jserver.gameserver.handler.VoicedCommandHandler;





    -


    /**


    *


    * @author nBd


    @@ -299,19 +300,23 @@


    private static void loadVoicedHandlers()


    {


    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());


    if (Config.L2JMOD_ALLOW_WEDDING)


    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());


    if (Config.BANKING_SYSTEM_ENABLED)


    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Banking());


    if (Config.TVT_ALLOW_VOICED_COMMAND)


    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new TvTVoicedInfo());


    if (Config.L2JMOD_CHAT_ADMIN)


    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new ChatAdmin());


    if (Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW)


    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Lang());


    + VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new CAPTCHA());


    _log.config("Loaded " + VoicedCommandHandler.getInstance().size() + " VoicedHandlers");


    }





    /**


    * @param args


    */





    }


    \ No newline at end of file