Welcome to MaxCheaters.com

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Inthedash6

Members
  • Posts

    81
  • Joined

  • Last visited

  • Feedback

    0%

About Inthedash6

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Inthedash6's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Lineage ][ Desire Friday 03.01 19:00GMT+2 ...::::::::::: INTERLUDE CHRONICLE :::::::::::... ...::::::::::: RATES :::::::::::... Xp 2000x. Sp 2000x. Aden 1x. Drop 1x. PartyXp 1x. PartySp 1x. Starting level - 76. ...::::::::::: ENCHANT RATES :::::::::::... Safe enchant (+5). Simple - 60% Blessed - 80% Crystal - 100% Blessed and simple scrolls max enchant (+40). Crystal scrolls max enchant (+45). Then enchant fails only -1 scroll disappear. ...::::::::::: LIFE STONES :::::::::::... Mid Grade LS Chance = 8% High Grade LS Chance = 10% Top Grade LS Chance = 12% 1 active + 1 passive. ...::::::::::: UNIQUE FEATURES :::::::::::... Main town - Giran. Giran, Aden, Rune, Goddard sieges. Wedding system. Unique farming zones. Npc skill enchanter. NPC buffer. Max count of buffs - 58. Max subclasses - 3. Free and no quest class change. Free and no quest sub class. Online password change. Top 10 PvP/PK npc in game. Augmentation system (preconfigured). Unique monsters. Offline trade system. Interlude retail skills. Server up-time [24/7] [99]%. Perfect class balance. ...::::::::::: CUSTOM ITEMS :::::::::::... Armors: Apella Dynasty Gods Epic Apella Dynasty, Epic and God's armors have 2lvls stats. Weapons: Master Monster Master and Monster weapons have same stats. Jewels: Raid Boss Dusk(TOP) Other: Unique tattoos Accessories Mask Wings ...::::::::::: SERVER CURRENCY :::::::::::... Claws You can purchase Apella, Dynasty, Epic and God's armor and weapons. Voter coin You can purchase Enchants, Life Stones, etc... Donator coin You can purchase all armors and weapons and more items and buy augment active or passive skill. Festival adena You can purchase Enchants, Life Stones, special buffs, etc... ...::::::::::: CUSTOM DROP :::::::::::... * Farm Zone - Claws zone. * Claws, Adena. * PC Bang Points - Just stay online to get it. * Claws - Mini Raid Boss zone, Epic Jewels zone, Mix Farm zone and Grand Bosses. * Voter Coin - Daily vote and auto vote reward. * Donator coin - Mini Raid Boss zone. * Festival Adena - Server auto events. * Monster weapons - Party Boss. * Monster armors - Party Boss. * Super mask - Party Boss. ...::::::::::: VOICED COMMANDS :::::::::::... .menu - Player Manager [ON/OFF]. .status - View player status. .change - Change your Account Password. .joinoly .leaveoly - Join or Leave Olympiad. .tvtjoin .tvtleave - Join or leave tvt event. .ctfjoin .ctfleave - Join or leave ctf event. .dmjoin .dmleave - Join of leave dm event. .online - current online players count. .repair - repairs stuck character in world. .dressme - change character appearance. .status - shows player combat information. .raidinfo - shows raid boss respawn information. ...::::::::::: EVENT SYSTEM :::::::::::... TVT event [00:00 03:00 06:00 09:00 12:00 15:00 18:00 21:00] hours. CTF event [01:00 04:00 07:00 10:00 13:00 16:00 19:00 22:00] hours. DM event [02:00 05:00 08:00 11:00 14:00 17:00 20:00 23:00] hours. Trivia event delay [60] minutes. Casino event working [24/7]. Unique event shop. ...::::::::::: OLYMPIAD GAME :::::::::::... Retail olympiad game. Competition period [4] Days. Olympiad start time [18:00] end [00:00] +2 GMT time zone. Vote reward: In server working vote reward online systems. After server start you can vote for server and automacilly be rewarded. So get ready for server start and for voting !
  2. 25 / 08 / 2018 19:00 GMT+3. We are waiting for you all. For more information visit features section. Join us and be best of the best. See you in game ! http://l2-chaoslegion.eu Server Rates XP: 2000x SP: 2000x Adena: 2000x DropA: 1x Enchant Enchant Max Normal/Blessed: +30 Enchant Max Crystal: +36 Enchant Safe: +5 Simple Enchant Rates: 75% Bessed Enchant Rates: 92% Crystal Enchant Rates: 100% Custom Items Dynasty Armors Vesper Super Armors Apella Armors Monster Weapon Epic Wings Tattoo Basic Things Client - Interlude. Main town - Goddard. Castle crown witch stat. Wedding system. Max buff slot - 60. Max SubClass - 3. Spawn potection 30s. RaidBoss 13. Geodata. Quake system. Auto Vote Reward System. Destroy SS/BSS. Auto TvT,CTF Event. Clan rep item (5000 rep). Leave buff after death. 10 PvP- Hero aura. Anti Heavy System. Custom Items. GM shop. Augmentation(20%). Duel systema. Interlude skill (90%). Sub classes without quest. Nobless without quest. Npc Buffer. Buff time 9 hours. Command Tvt: .jointvt and .leavetvt .raidinfo .pin .vote Server NPC GM Shop Custom Shop NPC Buffer Name Changer Augmenter/Skill Enchanter RaidBoss Manager Bug Reporter GateKeeper PK Protector And more... Olympiad Start - 18:00 (GMT +2) End - 00:00 (GMT +2) Olympiad system Every 1 Weeks (Full Working), Retail Olympiad http://l2-chaoslegion.eu
  3. Dear players, L2 ChaosLegion high rates Custom pvp server opens for you on 22 / JUNE / 2018 19:00 GMT+3. We are waiting for you all. For more information visit features section. Join us and be best of the best. See you in game ! http://l2-chaoslegion.eu Server Rates XP: 2000x SP: 2000x Adena: 2000x DropA: 1x Enchant Enchant Max Normal/Blessed: +30 Enchant Max Crystal: +36 Enchant Safe: +5 Simple Enchant Rates: 75% Bessed Enchant Rates: 92% Crystal Enchant Rates: 100% Custom Items Dynasty Armors Apella Armors Monster Weapon Epic Wings Tattoo Basic Things Client - Interlude. Main town - Giran. Castle crown witch stat. Wedding system. Max buff slot - 60. Max SubClass - 3. Spawn potection 30s. RaidBoss 13. Geodata. Quake system. Auto Vote Reward System. Destroy SS/BSS. Auto TvT,CTF Event. Clan rep item (5000 rep). Leave buff after death. 10 PvP- Hero aura. Anti Heavy System. Custom Items. GM shop. Augmentation(15%). Duel systema. Interlude skill (90%). Sub classes without quest. Nobless without quest. Npc Buffer. Buff time 9 hours. Command Tvt: .jointvt and .leavetvt .raidinfo .pin .vote Server NPC GM Shop Custom Shop NPC Buffer Name Changer Augmenter/Skill Enchanter RaidBoss Manager Bug Reporter GateKeeper PK Protector And more... Olympiad Start - 18:00 (GMT +2) End - 00:00 (GMT +2) Olympiad system Every 1 Weeks (Full Working), Retail Olympiad http://l2-chaoslegion.eu
  4. Dear players, L2 ChaosLegion high rates Custom pvp server opens for you on 18 / MARCH / 2018 19:00 GMT+2. We are waiting for you all. For more information visit features section. Join us and be best of the best. See you in game ! http://l2-chaoslegion.eu Server Rates XP: 2000x SP: 2000x Adena: 2000x DropA: 1x Enchant Enchant Max Normal/Blessed: +30 Enchant Max Crystal: +36 Enchant Safe: +5 Simple Enchant Rates: 75% Bessed Enchant Rates: 92% Crystal Enchant Rates: 100% Custom Items Dynasty Armors Custom Armors Monster Weapon Epic Wings Tattoo Basic Things Client - Interlude. Main town - Giran. Castle crown witch stat. Wedding system. Max buff slot - 60. Max SubClass - 3. Spawn potection 30s. RaidBoss 13. Geodata. Quake system. Auto Vote Reward System. Destroy SS/BSS. Auto TvT,CTF Event. Clan rep item (5000 rep). Leave buff after death. 10 PvP- Hero aura. Anti Heavy System. Custom Items. GM shop. Augmentation(15%). Duel systema. Interlude skill (90%). Sub classes without quest. Nobless without quest. Npc Buffer. Buff time 9 hours. Command Tvt: .jointvt and .leavetvt .raidinfo .pin .vote Server NPC GM Shop Custom Shop NPC Buffer Name Changer Augmenter/Skill Enchanter RaidBoss Manager Bug Reporter GateKeeper PK Protector And more... Olympiad Start - 18:00 (GMT +2) End - 00:00 (GMT +2) Olympiad system Every 1 Weeks (Full Working), Retail Olympiad http://l2-chaoslegion.eu
  5. Hi everyone,I'm looking l2 support themes like l2help.lt or some like this.Thanks
  6. Hello Test server will be opened 19.12.2017 19:00 GMT+2. Invite your friend and help for us to test our server. All found bugs report to bug report NPC. Thanks. See you in the game! http://l2-fusion.euServer RatesXp: 2000xSp: 2000xDrop: 1xAdena: 2000xServerInterlude PvP No Custom items server. Retail server with custom modifications.Enchantment RatesSafe: +4Max: +21Max with Crystal: +24Normal Scroll: 75%Blessed Scroll: 92%Crystal Scroll: 100%Olympiad InformationOlympiad Starts: 18:00 Olympiad Ends: 00:00 Hero Changes: Every four daysHero Status can be retrieved from Monument of HeroesAdditional InformationClient - Interlude.No Custom + Apella armor.Main town - Giran.Donate manager.Wedding system.Max buff slot - 60.Max SubClass - 3.Spawn potection 30s.RaidBoss 7.Geodata.Increased movement speed on all classesQuake system.Auto Vote Reward System.Destroy SS/BSS.Auto TvT,CTF Event.Leave buff after death.Nick color: 50,100,200,300,400 PvP.Title color: 50,100,200,350,500 PK.10 PvP- Hero aura.Anti Heavy System.GM shop.Augmentation(20%).1 Active and 1 Passive.Duel systema.Online password change. Interlude skill (90%).Sub classes without quest.Nobless without quest.Stackable scroll/ls.Npc Buffer.Buff time 9 hours.CommandTvt: .jointvt and .leavetvtOnline: .onlineHeal: .buffshttp://l2-fusion.eu
  7. WIPE ! NEW SEASON GRAND START FROM - 27/02/2018! 19:00 GMT+2 All characters will be deleted and game will starts for everyone from zero. It`s great chance for new and old players to start, who got bored or had some problems. We promise you a good and stable game ! You have great chance be a server leader. So get ready and be the one of the first clans since first moment ! Be patient and use this time to advertise server start date to people for more fun ! See you in the game! http://l2-fusion.eu Server Rates Xp: 2000x Sp: 2000x Drop: 1x Adena: 2000x Server Interlude PvP No Custom items server. Retail server with custom modifications. Enchantment Rates Safe: +4 Max: +21 Max with Crystal: +24 Normal Scroll: 75% Blessed Scroll: 92% Crystal Scroll: 100% Olympiad Information Olympiad Starts: 18:00 Olympiad Ends: 00:00 Hero Changes: Every four days Hero Status can be retrieved from Monument of Heroes Additional Information Client - Interlude. No Custom + Apella armor. Main town - Giran. Donate manager. Wedding system. Max buff slot - 60. Max SubClass - 3. Spawn potection 30s. RaidBoss 7. Geodata. Increased movement speed on all classes Quake system. Auto Vote Reward System. Destroy SS/BSS. Auto TvT,CTF Event. Leave buff after death. Nick color: 50,100,200,300,400 PvP. Title color: 50,100,200,350,500 PK. 10 PvP- Hero aura. Anti Heavy System. GM shop. Augmentation(20%). 1 Active and 1 Passive. Duel systema. Online password change. Interlude skill (90%). Sub classes without quest. Nobless without quest. Stackable scroll/ls. Npc Buffer. Buff time 9 hours. Command Tvt: .jointvt and .leavetvt Online: .online Heal: .buffs http://l2-fusion.eu
  8. WIPE ! NEW SEASON GRAND START FROM ZERO FOR EVERONE ! INVITE YOUR FRIENDS, CREATE YOUR OWN CLANS, AND GET READY FOR FREALLY BIG WAR ! DONT MISS THE CHANCE TO BE BEST OF THE BEST IN GAME ! . Change zones,monster,fix class balance. Server Start 2016.12.22 19:00 (GMT+2 Lithuania time)[/b] http://l2-fusion.eu Server Rates Xp: 2000x Sp: 2000x Drop: 1x Adena: 2000x Server Interlude PvP No Custom items server. Retail server with custom modifications. Enchantment Rates Safe: +3 Max: +15 Max with Crystal: +18 Normal Scroll: 65% Blessed Scroll: 85% Crystal Scroll: 100% Olympiad Information Olympiad Starts: 18:00 Olympiad Ends: 00:00 Hero Changes: Every four days Hero Status can be retrieved from Monument of Heroes Additional Information Client - Interlude. No Custom + Apella armor. Main town - Giran. Donate manager. Wedding system. Max buff slot - 60. Max SubClass - 3. Spawn potection 30s. RaidBoss 7. Geodata. Increased movement speed on all classes Quake system. Auto Vote Reward System. Destroy SS/BSS. Auto TvT,CTF Event. Leave buff after death. Nick color: 100,300,500,700,1000 PvP. Title color: 50,100,200,350,500 PK. 10 PvP- Hero aura. Anti Heavy System. GM shop. Augmentation(20%). 1 Active and 1 Passive. Duel systema. Online password change. Interlude skill (90%). Sub classes without quest. Nobless without quest. Stackable scroll/ls. Npc Buffer. Buff time 9 hours. Command Tvt: .jointvt and .leavetvt Online: .online Heal: .buffs http://l2-fusion.eu Please UP
  9. delete from where? + + public long cklastlogin() + { + long chklogin = 0; + try (Connection con = L2DatabaseFactory.getInstance().getConnection()) + { + PreparedStatement statement = con.prepareStatement("SELECT lastactive FROM accounts WHERE login=?"); + statement.setString(1, getAccountName()); + ResultSet rset = statement.executeQuery(); + + // Go though the recordset of this SQL query + while (rset.next()) + { + chklogin = rset.getLong("lastactive"); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + Date date = new Date(chklogin); + sendMessage("Last Login:"+dateFormat.format(date)); + } + + rset.close(); + statement.close(); + } + catch (Exception e) + { + _log.warning("Could not restore Last Login: " + e); + } + return chklogin; + }
  10. I have error: public long cklastlogin() [javac] C:\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\model\actor\instance\L2PcInstance.java:10457: error: illegal start of expression [javac] public long cklastlogin(); [javac] ^ [javac] C:\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\model\actor\instance\L2PcInstance.java:10457: error: ';' expected [javac] public long cklastlogin(); [javac]
  11. http://www.4shared.com/img/PnpeKHRNce/s25/157e7930310/image http://www.4shared.com/rar/WiimsNndba/antibot.html Download data files ACIS: ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/datatables/AntiBotTable.java =================================================================== --- java/net/sf/l2j/gameserver/datatables/AntiBotTable.java (revision 0) +++ java/net/sf/l2j/gameserver/datatables/AntiBotTable.java (revision 0) @@ -0,0 +1,183 @@ +/* + * 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 net.sf.l2j.gameserver.datatables; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.logging.Level; +import java.util.logging.Logger; + +import net.sf.l2j.gameserver.ThreadPoolManager; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.serverpackets.PledgeImage; +import net.sf.l2j.util.Rnd; + +/** + * + * @author Fissban + * + */ +public class AntiBotTable +{ + public static Logger _log = Logger.getLogger(AntiBotTable.class.getName()); + + public static Map<Integer, antiBotData> _imageAntiBotOri = new HashMap<>(); + public static Map<Integer, antiBotData> _imageAntiBotClient = new HashMap<>(); + + public final static int[] img_antibot_id = + { + 7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009 + }; + + public void loadImage() + { + LoadImgAntiBot(); + _log.log(Level.INFO, "loading " + _imageAntiBotOri.size() + " images of AntiBot"); + } + + private static void LoadImgAntiBot() + { + _imageAntiBotOri.clear(); + int cont = 0; + + for (int imgId : img_antibot_id) + { + File image = new File("data/images/antibot/" + imgId + ".dds"); + _imageAntiBotOri.put(cont, new antiBotData(cont, ConverterImgBytes(image))); + cont++; + } + + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new startEncriptCaptcha(), 100, 600000); // 10 Minutes + } + + public void sendImage(L2PcInstance player, int imgId) + { + PledgeImage packet = null; + + if ((imgId >= 50000) && (imgId <= 800000)) + { + for (Entry<Integer, antiBotData> entrySet : _imageAntiBotClient.entrySet()) + { + antiBotData imgCoding = entrySet.getValue(); + + if (imgId == imgCoding.getCodificacion()) + { + packet = new PledgeImage(imgId, imgCoding.getImagen()); + } + } + } + + player.sendPacket(packet); + } + + public static class startEncriptCaptcha implements Runnable + { + public startEncriptCaptcha() + { + + } + + @Override + public void run() + { + _imageAntiBotClient.clear(); + + for (Entry<Integer, antiBotData> entrySet : _imageAntiBotOri.entrySet()) + { + entrySet.getValue().getImagen(); + _imageAntiBotClient.put(entrySet.getKey(), new antiBotData(Rnd.get(50000, 800000), entrySet.getValue().getImagen())); + } + } + } + + public int getAntiBotClientID(int pos) + { + int returnCoding = 0; + + for (Entry<Integer, antiBotData> entrySet : _imageAntiBotClient.entrySet()) + { + int numeroImage = entrySet.getKey().intValue(); + + if (pos == numeroImage) + { + antiBotData imgCoding = entrySet.getValue(); + returnCoding = imgCoding.getCodificacion(); + } + + if (pos > 9) + { + _log.log(Level.SEVERE, "error in getAntiBotClientID...number dont exist"); + } + } + return returnCoding; + } + + public static class antiBotData + { + int _codificacion; + byte[] _data; + + public antiBotData(int codificacion, byte[] data) + { + _codificacion = codificacion; + _data = data; + } + + public int getCodificacion() + { + return _codificacion; + } + + public byte[] getImagen() + { + return _data; + } + } + + private static byte[] ConverterImgBytes(File imagen) + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + byte[] buffer = new byte[1024]; + try (FileInputStream fis = new FileInputStream(imagen)) + { + for (int readNum; (readNum = fis.read(buffer)) != -1;) + { + bos.write(buffer, 0, readNum); + } + } + catch (IOException e) + { + _log.log(Level.SEVERE, "Error when converter image to byte[]"); + } + + return bos.toByteArray(); + } + + public static AntiBotTable getInstance() + { + return SingletonHolder._instance; + } + + private static class SingletonHolder + { + protected static final AntiBotTable _instance = new AntiBotTable(); + } +} Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 13) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -35,6 +35,7 @@ import net.sf.l2j.gameserver.communitybbs.Manager.ForumsBBSManager; import net.sf.l2j.gameserver.datatables.AccessLevels; import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights; +import net.sf.l2j.gameserver.datatables.AntiBotTable; import net.sf.l2j.gameserver.datatables.ArmorSetsTable; import net.sf.l2j.gameserver.datatables.AugmentationData; import net.sf.l2j.gameserver.datatables.BookmarkTable; @@ -309,6 +310,8 @@ MovieMakerManager.getInstance(); + AntiBotTable.getInstance().loadImage(); + if (Config.DEADLOCK_DETECTOR) { _log.info("Deadlock detector is enabled. Timer: " + Config.DEADLOCK_CHECK_INTERVAL + "s."); Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 13) +++ java/net/sf/l2j/Config.java (working copy) @@ -513,6 +513,13 @@ public static boolean STORE_SKILL_COOLTIME; public static int BUFFS_MAX_AMOUNT; + /** AntiBot */ + public static boolean ANTIBOT_ENABLE; + public static int ANTIBOT_TIME_JAIL; + public static int ANTIBOT_TIME_VOTE; + public static int ANTIBOT_KILL_MOBS; + public static int ANTIBOT_MIN_LEVEL; + // -------------------------------------------------- // Server // -------------------------------------------------- @@ -1110,6 +1117,12 @@ BUFFS_MAX_AMOUNT = players.getProperty("MaxBuffsAmount", 20); STORE_SKILL_COOLTIME = players.getProperty("StoreSkillCooltime", true); + ANTIBOT_ENABLE = players.getProperty("AntiBotEnable", true); + ANTIBOT_TIME_JAIL = players.getProperty("AntiBotTimeJail", 1); + ANTIBOT_TIME_VOTE = players.getProperty("AntiBotTimeVote", 30); + ANTIBOT_KILL_MOBS = players.getProperty("AntiBotKillMobs", 1); + ANTIBOT_MIN_LEVEL = players.getProperty("AntiBotMinLevel", 1); + // server ExProperties server = load(SERVER_FILE); Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 13) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy) @@ -179,6 +179,18 @@ final int arenaId = Integer.parseInt(_command.substring(12).trim()); activeChar.enterOlympiadObserverMode(arenaId); } + else if (_command.startsWith("antibot")) + { + StringTokenizer st = new StringTokenizer(_command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + activeChar.checkCode(st.nextToken()); + return; + } + activeChar.checkCode("Fail"); + } } catch (Exception e) { Index: java/net/sf/l2j/gameserver/network/clientpackets/Say2.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 13) +++ java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (working copy) @@ -49,6 +49,7 @@ public final static int PARTYROOM_COMMANDER = 15; // (Yellow) public final static int PARTYROOM_ALL = 16; // (Red) public final static int HERO_VOICE = 17; + public final static int CRITICAL_ANNOUNCE = 18; private final static String[] CHAT_NAMES = { @@ -69,7 +70,8 @@ "PARTYMATCH_ROOM", "PARTYROOM_COMMANDER", "PARTYROOM_ALL", - "HERO_VOICE" + "HERO_VOICE", + "CRITICAL_ANNOUNCE" }; private static final String[] WALKER_COMMAND_LIST = Index: java/net/sf/l2j/gameserver/network/serverpackets/PledgeImage.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/PledgeImage.java (revision 0) +++ java/net/sf/l2j/gameserver/network/serverpackets/PledgeImage.java (revision 0) @@ -0,0 +1,44 @@ +/* + * 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 net.sf.l2j.gameserver.network.serverpackets; + +public class PledgeImage extends L2GameServerPacket +{ + private final int _crestId; + private final byte[] _data; + + public PledgeImage(int crestId, byte[] data) + { + _crestId = crestId; + _data = data; + } + + @Override + protected final void writeImpl() + { + writeC(0x6c); + writeD(_crestId); + + if (_data != null) + { + writeD(_data.length); + writeB(_data); + } + else + { + writeD(0); + } + } +} \ No newline at end of file Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 13) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -48,6 +48,7 @@ import net.sf.l2j.gameserver.communitybbs.BB.Forum; import net.sf.l2j.gameserver.communitybbs.Manager.ForumsBBSManager; import net.sf.l2j.gameserver.datatables.AccessLevels; +import net.sf.l2j.gameserver.datatables.AntiBotTable; import net.sf.l2j.gameserver.datatables.CharNameTable; import net.sf.l2j.gameserver.datatables.CharTemplateTable; import net.sf.l2j.gameserver.datatables.ClanTable; @@ -157,12 +158,14 @@ import net.sf.l2j.gameserver.model.zone.type.L2BossZone; import net.sf.l2j.gameserver.network.L2GameClient; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.clientpackets.Say2; import net.sf.l2j.gameserver.network.serverpackets.AbstractNpcInfo; import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.ChairSit; import net.sf.l2j.gameserver.network.serverpackets.ChangeWaitType; import net.sf.l2j.gameserver.network.serverpackets.CharInfo; import net.sf.l2j.gameserver.network.serverpackets.ConfirmDlg; +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay; import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate; import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot; import net.sf.l2j.gameserver.network.serverpackets.ExDuelUpdateUserInfo; @@ -170,6 +173,7 @@ import net.sf.l2j.gameserver.network.serverpackets.ExFishingStart; import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadMode; import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode; +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage; import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount; import net.sf.l2j.gameserver.network.serverpackets.FriendList; import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle; @@ -219,6 +223,7 @@ import net.sf.l2j.gameserver.network.serverpackets.TradePressOwnOk; import net.sf.l2j.gameserver.network.serverpackets.TradeStart; import net.sf.l2j.gameserver.network.serverpackets.UserInfo; +import net.sf.l2j.gameserver.skills.AbnormalEffect; import net.sf.l2j.gameserver.skills.Env; import net.sf.l2j.gameserver.skills.Formulas; import net.sf.l2j.gameserver.skills.Stats; @@ -364,6 +369,11 @@ } } + private String _code = ""; + private int _attempt = 0; + private int _mobs_dead = 0; + public static ScheduledFuture<?> _antiBotTask; + private L2GameClient _client; private String _accountName; @@ -10647,4 +10657,183 @@ } } } + + // AntiBoot + public void antibot() + { + increaseMobsDead(); + + if (getMobsDead() >= Config.ANTIBOT_KILL_MOBS) + { + resetMobsDead(); + _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new startAntiBotTask(), Config.ANTIBOT_TIME_VOTE * 1000); + } + } + + private static void stopAntiBotTask() + { + if (_antiBotTask != null) + { + _antiBotTask.cancel(false); + _antiBotTask = null; + } + } + + private class startAntiBotTask implements Runnable + { + public startAntiBotTask() + { + setIsParalyzed(true); + setIsInvul(true); + startAbnormalEffect(AbnormalEffect.FLOATING_ROOT); + sendPacket(new ExShowScreenMessage("[AntiBot]: You have " + Config.ANTIBOT_TIME_VOTE + " to confirm the Captcha!", 10000)); + getActingPlayer().sendPacket(new CreatureSay(0, Say2.CRITICAL_ANNOUNCE, "[AntiBot]:", "You have " + Config.ANTIBOT_TIME_VOTE + " to confirm the Catpcha.")); + showHtml_Start(); + } + + @Override + public void run() + { + if (!isInJail()) + { + sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Your time limit has elapsed.")); + increaseAttempt(); + + if (getAttempt() >= 3) + { + setIsParalyzed(false); + setIsInvul(false); + startAbnormalEffect(AbnormalEffect.FLOATING_ROOT); + getActingPlayer().setPunishLevel(L2PcInstance.PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL); + getActingPlayer().sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes.")); + _log.warning("[AntiBot]: Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes."); + } + else + { + _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new startAntiBotTask(), Config.ANTIBOT_TIME_VOTE * 1000); + } + } + } + } + + public String num2img(int numero) + { + String num = Integer.toString(numero); + char[] digitos = num.toCharArray(); + + String tmp = ""; + for(int x=0;x<num.length();x++) + { + int dig = Integer.parseInt(Character.toString(digitos[x])); + final int it = AntiBotTable.getInstance().getAntiBotClientID(dig); + AntiBotTable.getInstance().sendImage(this, it); + tmp += "<img src=Crest.crest_" + Config.SERVER_ID + "_" + it + " width=38 height=33 align=left>"; + } + + return tmp; + } + + public void showHtml_Start() + { + NpcHtmlMessage html = new NpcHtmlMessage(0); + html.setFile("data/html/antiBot/start.htm"); + + html.replace("%playerName%", getName()); + html.replace("%attemp%", String.valueOf(3 - getAttempt())); + int maxR = 3; + + String random = new String(); + + for(int x = 0; x<maxR; x++) + random += Integer.toString(Rnd.get(0,9)); + + html.replace("%code1%",num2img(Integer.parseInt(random))); + + this.sendPacket(html); + setCode(String.valueOf(Integer.parseInt(random))); + } + + public void showHtml_End() + { + NpcHtmlMessage html = new NpcHtmlMessage(0); + html.setFile("data/html/antiBot/end.htm"); + html.replace("%playerName%", getName()); + + this.sendPacket(html); + } + + public void checkCode(String code) + { + if (code.equals(getCode())) + { + stopAntiBotTask(); + resetAttempt(); + + sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Congratulations, has passed control.")); + setIsParalyzed(false); + setIsInvul(false); + stopAbnormalEffect(AbnormalEffect.FLOATING_ROOT); + } + else + { + stopAntiBotTask(); + increaseAttempt(); + + _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new startAntiBotTask(), Config.ANTIBOT_TIME_VOTE * 1000); + } + + if (getAttempt() >= 3) + { + stopAntiBotTask(); + resetAttempt(); + + setIsParalyzed(false); + setIsInvul(false); + startAbnormalEffect(AbnormalEffect.FLOATING_ROOT); + + setPunishLevel(PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL); + sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes.")); + _log.warning("[AntiBot]: Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes."); + } + } + + private int getMobsDead() + { + return _mobs_dead; + } + + private void increaseMobsDead() + { + _mobs_dead++; + } + + private void resetMobsDead() + { + _mobs_dead = 0; + } + + private void setCode(String code) + { + _code = code; + } + + private String getCode() + { + return _code; + } + + public void increaseAttempt() + { + _attempt += 1; + } + + public int getAttempt() + { + return _attempt; + } + + public void resetAttempt() + { + _attempt = 0; + } } \ No newline at end of file Index: java/net/sf/l2j/gameserver/model/actor/L2Attackable.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/L2Attackable.java (revision 13) +++ java/net/sf/l2j/gameserver/model/actor/L2Attackable.java (working copy) @@ -450,6 +450,12 @@ if (!super.doDie(killer)) return false; + // AntiBot + if (Config.ANTIBOT_ENABLE && (killer != null) && killer instanceof L2PcInstance && (killer.getLevel() >= Config.ANTIBOT_MIN_LEVEL)) + { + killer.getActingPlayer().antibot(); + } + // Notify the Quest Engine of the L2Attackable death if necessary try { Index: config/players.properties =================================================================== --- config/players.properties (revision 13) +++ config/players.properties (working copy) @@ -294,4 +294,23 @@ MaxBuffsAmount = 20 # Store buffs/debuffs on user logout? -StoreSkillCooltime = True \ No newline at end of file +StoreSkillCooltime = True + +#============================================================= +# AntiBot +#============================================================= + +# AntiBot. True to enable, False to disable. +AntiBotEnable = True + +# Time the user will be in jail in minutes. +AntiBotTimeJail = 10 + +# Time that the user will have to control captcha in seconds. +AntiBotTimeVote = 40 + +# Dead mobs needed for captcha. +AntiBotKillMobs = 100 + +# Level min need for captcha. +AntiBotMinLevel = 1 \ No newline at end of file Frozen: ### Eclipse Workspace Patch 1.0 #P L2jFrozen_GameServer Index: head-src/com/l2jfrozen/gameserver/model/L2Attackable.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/L2Attackable.java (revision 1118) +++ head-src/com/l2jfrozen/gameserver/model/L2Attackable.java (working copy) @@ -542,6 +542,12 @@ LOGGER.error("", e); } + // AntiBot + if (Config.ANTIBOT_ENABLE && (killer != null) && killer instanceof L2PcInstance && (killer.getLevel() >= Config.ANTIBOT_MIN_LEVEL)) + { + killer.getActingPlayer().antibot(); + } + // Notify the Quest Engine of the L2Attackable death if necessary try { Index: head-src/com/l2jfrozen/gameserver/datatables/AntiBotTable.java =================================================================== --- head-src/com/l2jfrozen/gameserver/datatables/AntiBotTable.java (revision 0) +++ head-src/com/l2jfrozen/gameserver/datatables/AntiBotTable.java (revision 0) @@ -0,0 +1,183 @@ +/* + * 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 com.l2jfrozen.gameserver.datatables; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.network.serverpackets.PledgeImage; +import com.l2jfrozen.gameserver.thread.ThreadPoolManager; +import com.l2jfrozen.util.random.Rnd; + +/** + * + * @author Fissban + * + */ +public class AntiBotTable +{ + public static Logger _log = Logger.getLogger(AntiBotTable.class.getName()); + + public static Map<Integer, antiBotData> _imageAntiBotOri = new HashMap<>(); + public static Map<Integer, antiBotData> _imageAntiBotClient = new HashMap<>(); + + public final static int[] img_antibot_id = + { + 7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009 + }; + + public void loadImage() + { + LoadImgAntiBot(); + _log.log(Level.INFO, "loading " + _imageAntiBotOri.size() + " images of AntiBot"); + } + + private static void LoadImgAntiBot() + { + _imageAntiBotOri.clear(); + int cont = 0; + + for (int imgId : img_antibot_id) + { + File image = new File("data/images/antibot/" + imgId + ".dds"); + _imageAntiBotOri.put(cont, new antiBotData(cont, ConverterImgBytes(image))); + cont++; + } + + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new startEncriptCaptcha(), 100, 600000); // 10 Minutes + } + + public void sendImage(L2PcInstance player, int imgId) + { + PledgeImage packet = null; + + if ((imgId >= 50000) && (imgId <= 800000)) + { + for (Entry<Integer, antiBotData> entrySet : _imageAntiBotClient.entrySet()) + { + antiBotData imgCoding = entrySet.getValue(); + + if (imgId == imgCoding.getCodificacion()) + { + packet = new PledgeImage(imgId, imgCoding.getImagen()); + } + } + } + + player.sendPacket(packet); + } + + public static class startEncriptCaptcha implements Runnable + { + public startEncriptCaptcha() + { + + } + + @Override + public void run() + { + _imageAntiBotClient.clear(); + + for (Entry<Integer, antiBotData> entrySet : _imageAntiBotOri.entrySet()) + { + entrySet.getValue().getImagen(); + _imageAntiBotClient.put(entrySet.getKey(), new antiBotData(Rnd.get(50000, 800000), entrySet.getValue().getImagen())); + } + } + } + + public int getAntiBotClientID(int pos) + { + int returnCoding = 0; + + for (Entry<Integer, antiBotData> entrySet : _imageAntiBotClient.entrySet()) + { + int numeroImage = entrySet.getKey().intValue(); + + if (pos == numeroImage) + { + antiBotData imgCoding = entrySet.getValue(); + returnCoding = imgCoding.getCodificacion(); + } + + if (pos > 9) + { + _log.log(Level.SEVERE, "error in getAntiBotClientID...number dont exist"); + } + } + return returnCoding; + } + + public static class antiBotData + { + int _codificacion; + byte[] _data; + + public antiBotData(int codificacion, byte[] data) + { + _codificacion = codificacion; + _data = data; + } + + public int getCodificacion() + { + return _codificacion; + } + + public byte[] getImagen() + { + return _data; + } + } + + private static byte[] ConverterImgBytes(File imagen) + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + byte[] buffer = new byte[1024]; + try (FileInputStream fis = new FileInputStream(imagen)) + { + for (int readNum; (readNum = fis.read(buffer)) != -1;) + { + bos.write(buffer, 0, readNum); + } + } + catch (IOException e) + { + _log.log(Level.SEVERE, "Error when converter image to byte[]"); + } + + return bos.toByteArray(); + } + + public static AntiBotTable getInstance() + { + return SingletonHolder._instance; + } + + private static class SingletonHolder + { + protected static final AntiBotTable _instance = new AntiBotTable(); + } +} \ No newline at end of file Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/PledgeImage.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/serverpackets/PledgeImage.java (revision 0) +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/PledgeImage.java (revision 0) @@ -0,0 +1,50 @@ +/* + * 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 com.l2jfrozen.gameserver.network.serverpackets; + +public class PledgeImage extends L2GameServerPacket +{ + private final int _crestId; + private final byte[] _data; + + public PledgeImage(int crestId, byte[] data) + { + _crestId = crestId; + _data = data; + } + + @Override + protected final void writeImpl() + { + writeC(0x6c); + writeD(_crestId); + + if (_data != null) + { + writeD(_data.length); + writeB(_data); + } + else + { + writeD(0); + } + } + + @Override + public String getType() + { + return null; + } +} Index: head-src/com/l2jfrozen/gameserver/GameServer.java =================================================================== --- head-src/com/l2jfrozen/gameserver/GameServer.java (revision 1118) +++ head-src/com/l2jfrozen/gameserver/GameServer.java (working copy) @@ -44,6 +44,7 @@ import com.l2jfrozen.gameserver.controllers.GameTimeController; import com.l2jfrozen.gameserver.controllers.RecipeController; import com.l2jfrozen.gameserver.controllers.TradeController; +import com.l2jfrozen.gameserver.datatables.AntiBotTable; import com.l2jfrozen.gameserver.datatables.GmListTable; import com.l2jfrozen.gameserver.datatables.HeroSkillTable; import com.l2jfrozen.gameserver.datatables.NobleSkillTable; @@ -423,6 +424,9 @@ AdminCommandAccessRights.getInstance(); GmListTable.getInstance(); + Util.printSection("AntiBot"); + AntiBotTable.getInstance().loadImage(); + Util.printSection("Handlers"); ItemHandler.getInstance(); SkillHandler.getInstance(); Index: config/head/other.properties =================================================================== --- config/head/other.properties (revision 1118) +++ config/head/other.properties (working copy) @@ -239,4 +239,23 @@ ClickTask = 50 # Crit announce -GMShowCritAnnouncerName = False \ No newline at end of file +GMShowCritAnnouncerName = False + +#============================================================= +# AntiBot +#============================================================= + +# AntiBot. True to enable, False to disable. +AntiBotEnable = True + +# Time the user will be in jail in minutes. +AntiBotTimeJail = 10 + +# Time that the user will have to control captcha in seconds. +AntiBotTimeVote = 40 + +# Dead mobs needed for captcha. +AntiBotKillMobs = 100 + +# Level min need for captcha. +AntiBotMinLevel = 1 \ No newline at end of file Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 1118) +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -61,6 +61,7 @@ import com.l2jfrozen.gameserver.controllers.GameTimeController; import com.l2jfrozen.gameserver.controllers.RecipeController; import com.l2jfrozen.gameserver.datatables.AccessLevel; +import com.l2jfrozen.gameserver.datatables.AntiBotTable; import com.l2jfrozen.gameserver.datatables.GmListTable; import com.l2jfrozen.gameserver.datatables.HeroSkillTable; import com.l2jfrozen.gameserver.datatables.NobleSkillTable; @@ -175,6 +176,7 @@ import com.l2jfrozen.gameserver.network.serverpackets.ExOlympiadUserInfo; import com.l2jfrozen.gameserver.network.serverpackets.ExPCCafePointInfo; import com.l2jfrozen.gameserver.network.serverpackets.ExSetCompassZoneCode; +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jfrozen.gameserver.network.serverpackets.FriendList; import com.l2jfrozen.gameserver.network.serverpackets.HennaInfo; import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate; @@ -712,6 +714,12 @@ } } + /** AntiBot. */ + private String _code = ""; + private int _attempt = 0; + private int _mobs_dead = 0; + public static ScheduledFuture<?> _antiBotTask; + /** The _client. */ private L2GameClient _client; @@ -18740,6 +18748,8 @@ // during fall validations will be disabled for 10 ms. /** The Constant FALLING_VALIDATION_DELAY. */ private static final int FALLING_VALIDATION_DELAY = 10000; + + public static final String Say2 = null; /** The _falling timestamp. */ private long _fallingTimestamp = 0; @@ -19644,4 +19654,182 @@ _currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed); } + // AntiBot + public void antibot() + { + increaseMobsDead(); + + if (getMobsDead() >= Config.ANTIBOT_KILL_MOBS) + { + resetMobsDead(); + _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new startAntiBotTask(), Config.ANTIBOT_TIME_VOTE * 1000); + } + } + + private static void stopAntiBotTask() + { + if (_antiBotTask != null) + { + _antiBotTask.cancel(false); + _antiBotTask = null; + } + } + + private class startAntiBotTask implements Runnable + { + public startAntiBotTask() + { + setIsParalyzed(true); + setIsInvul(true); + startAbnormalEffect(L2Character.ABNORMAL_EFFECT_FLOATING_ROOT); + sendPacket(new ExShowScreenMessage("[AntiBot]: You have " + Config.ANTIBOT_TIME_VOTE + " to confirm the Captcha!", 10000)); + getActingPlayer().sendPacket(new CreatureSay(0, Say2.CRITICAL_ANNOUNCE, "[AntiBot]:", "You have " + Config.ANTIBOT_TIME_VOTE + " to confirm the Catpcha.")); + showHtml_Start(); + } + + @Override + public void run() + { + if (!isInJail()) + { + sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Your time limit has elapsed.")); + increaseAttempt(); + + if (getAttempt() >= 3) + { + setIsParalyzed(false); + setIsInvul(false); + startAbnormalEffect(L2Character.ABNORMAL_EFFECT_FLOATING_ROOT); + getActingPlayer().setPunishLevel(L2PcInstance.PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL); + getActingPlayer().sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes.")); + LOGGER.warn("[AntiBot]: Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes."); + } + else + { + _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new startAntiBotTask(), Config.ANTIBOT_TIME_VOTE * 1000); + } + } + } + } + + public String num2img(int numero) + { + String num = Integer.toString(numero); + char[] digitos = num.toCharArray(); + + String tmp = ""; + for(int x=0;x<num.length();x++) + { + int dig = Integer.parseInt(Character.toString(digitos[x])); + final int it = AntiBotTable.getInstance().getAntiBotClientID(dig); + AntiBotTable.getInstance().sendImage(this, it); + tmp += "<img src=Crest.crest_" + Config.SERVER_ID + "_" + it + " width=38 height=33 align=left>"; + } + + return tmp; + } + + public void showHtml_Start() + { + NpcHtmlMessage html = new NpcHtmlMessage(0); + html.setFile("data/html/antiBot/start.htm"); + + html.replace("%playerName%", getName()); + html.replace("%attemp%", String.valueOf(3 - getAttempt())); + int maxR = 3; + + String random = new String(); + + for(int x = 0; x<maxR; x++) + random += Integer.toString(Rnd.get(0,9)); + + html.replace("%code1%",num2img(Integer.parseInt(random))); + + this.sendPacket(html); + setCode(String.valueOf(Integer.parseInt(random))); + } + + public void showHtml_End() + { + NpcHtmlMessage html = new NpcHtmlMessage(0); + html.setFile("data/html/antiBot/end.htm"); + html.replace("%playerName%", getName()); + + this.sendPacket(html); + } + + public void checkCode(String code) + { + if (code.equals(getCode())) + { + stopAntiBotTask(); + resetAttempt(); + + sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Congratulations, has passed control.")); + setIsParalyzed(false); + setIsInvul(false); + stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_FLOATING_ROOT); + } + else + { + stopAntiBotTask(); + increaseAttempt(); + + _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new startAntiBotTask(), Config.ANTIBOT_TIME_VOTE * 1000); + } + + if (getAttempt() >= 3) + { + stopAntiBotTask(); + resetAttempt(); + + setIsParalyzed(false); + setIsInvul(false); + startAbnormalEffect(L2Character.ABNORMAL_EFFECT_FLOATING_ROOT); + + setPunishLevel(PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL); + sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "[AntiBot]:", "Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes.")); + LOGGER.warn("[AntiBot]: Character " + getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes."); + } + } + + private int getMobsDead() + { + return _mobs_dead; + } + + private void increaseMobsDead() + { + _mobs_dead++; + } + + private void resetMobsDead() + { + _mobs_dead = 0; + } + + private void setCode(String code) + { + _code = code; + } + + private String getCode() + { + return _code; + } + + public void increaseAttempt() + { + _attempt += 1; + } + + public int getAttempt() + { + return _attempt; + } + + public void resetAttempt() + { + _attempt = 0; + } } \ No newline at end of file Index: head-src/com/l2jfrozen/Config.java =================================================================== --- head-src/com/l2jfrozen/Config.java (revision 1118) +++ head-src/com/l2jfrozen/Config.java (working copy) @@ -579,6 +579,13 @@ public static boolean ALLOW_AIO_IN_EVENTS; public static boolean ANNOUNCE_CASTLE_LORDS; + /** AntiBot */ + public static boolean ANTIBOT_ENABLE; + public static int ANTIBOT_TIME_JAIL; + public static int ANTIBOT_TIME_VOTE; + public static int ANTIBOT_KILL_MOBS; + public static int ANTIBOT_MIN_LEVEL; + /** Configuration to allow custom items to be given on character creation */ public static boolean CUSTOM_STARTER_ITEMS_ENABLED; public static List<int[]> STARTING_CUSTOM_ITEMS_F = new ArrayList<>(); @@ -683,6 +690,11 @@ ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False")); ALLOW_AIO_IN_EVENTS = Boolean.parseBoolean(otherSettings.getProperty("AllowAioInEvents", "False")); ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False")); + ANTIBOT_ENABLE = Boolean.parseBoolean(otherSettings.getProperty("AntiBotEnable", "true")); + ANTIBOT_TIME_JAIL = Integer.parseInt(otherSettings.getProperty("AntiBotTimeJail", "1")); + ANTIBOT_TIME_VOTE = Integer.parseInt(otherSettings.getProperty("AntiBotTimeVote", "30")); + ANTIBOT_KILL_MOBS = Integer.parseInt(otherSettings.getProperty("AntiBotKillMobs", "1")); + ANTIBOT_MIN_LEVEL = Integer.parseInt(otherSettings.getProperty("AntiBotMinLevel", "1")); if (ENABLE_AIO_SYSTEM) // create map if system is enabled { final String[] AioSkillsSplit = otherSettings.getProperty("AioSkills", "").split(";"); Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java (revision 1118) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java (working copy) @@ -20,6 +20,8 @@ */ package com.l2jfrozen.gameserver.network.clientpackets; +import java.util.StringTokenizer; + import org.apache.log4j.Logger; import com.l2jfrozen.Config; @@ -317,6 +319,18 @@ else if (_command.startsWith("OlympiadArenaChange")) { Olympiad.bypassChangeArena(_command, activeChar); + } + else if (_command.startsWith("antibot")) + { + StringTokenizer st = new StringTokenizer(_command); + st.nextToken(); + + if (st.hasMoreTokens()) + { + activeChar.checkCode(st.nextToken()); + return; + } + activeChar.checkCode("Fail"); } } catch (final Exception e)