Jump to content

SySt3MGaM3RFr3aKs

Members
  • Posts

    838
  • Joined

  • Last visited

    Never
  • Feedback

    0%

Everything posted by SySt3MGaM3RFr3aKs

  1. Hello everybody, Here is one of the first, Gracia epilogue Precompiled Packs ( for those who don't know how to compile. ) Gracia Epilogue, L2J. Game Revision: [glow=red,2,300]3724[/glow] Data Revision: [glow=red,2,300]6813[/glow] Download Link: Catch it SVN Game: http://www.l2jserver.com/svn/trunk/ SVN Data: http://www.l2jdp.com/svn/trunk/ Timeline Game: http://l2jserver.com/trac/timeline Timeline Data: http://www.l2jdp.com/trac/timeline Nothing special, just sharing to help some Peaple out there :P.
  2. Hello here is a simple protection for low level Characters , ( Avoid Pking, PvPing, ETC ) Here is the diff file ( is a well known protection, if is already shared on Mod, please lock it ) Index: C:/Program Files/WorkSpace/Eclipse/java/config/altsettings.properties =================================================================== --- C:/Program Files/WorkSpace/Eclipse/java/config/altsettings.properties +++ C:/Program Files/WorkSpace/Eclipse/java/config/altsettings.properties @@ -70,9 +70,21 @@ AltKarmaPlayerCanTrade = True AltKarmaPlayerCanUseWareHouse = True +# Low Level Protection - System. +AltPlayerProtectionLevel = 25 + # Allow free teleportation around the world. AltFreeTeleporting = False Index: C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/Config.java =================================================================== --- C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/Config.java +++ C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/Config.java @@ -749,7 +767,8 @@ public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE; /** Allow player with karma to use warehouse ?*/ public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE; + + public static int ALT_PLAYER_PROTECTION_LEVEL; // Day/Night Status /** Force the client to change their day and night status ? */ public static boolean DAY_STATUS_FORCE_CLIENT_UPDATE; @@ -1479,6 +1503,7 @@ ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true")); ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true")); ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true")); + ALT_PLAYER_PROTECTION_LEVEL = Integer.parseInt(altSettings.getProperty("AltPlayerProtectionLevel","0")); ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False")); ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False")); ALT_GAME_VIEWNPC = Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False")); Index: C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java +++ C:/Program Files/WorkSpace/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java @@ -3129,9 +3140,14 @@ // Check if this L2PcInstance is autoAttackable if (isAutoAttackable(player)) { + if(player.getLevel() < Config.ALT_PLAYER_PROTECTION_LEVEL || this.getLevel() < Config.ALT_PLAYER_PROTECTION_LEVEL) + { + player.sendMessage("You cannot attack the player until he is Level: " + String.valueOf(Config.ALT_PLAYER_PROTECTION_LEVEL)); + player.sendPacket(new ActionFailed()); + } // Player with lvl < 21 can't attack a cursed weapon holder // And a cursed weapon holder can't attack players with lvl < 21 - if ((isCursedWeaponEquiped() && player.getLevel() < 21) + else if ((isCursedWeaponEquiped() && player.getLevel() < 21) || (player.isCursedWeaponEquiped() && this.getLevel() < 21)) { player.sendPacket(new ActionFailed()); Credits: Eclipse. Thanks for your time.
  3. Hello, here is a diff file to config the Max critical cap of your server This patch is for Interlude L2J, it works on other Chronicles too. Simple, nothing Special Credits: Me Index: D:/Workspace/Eclipse/config/altsettings.properties =================================================================== --- D:/Workspace/Eclipse/config/altsettings.properties +++ D:/Workspace/Eclipse/config/altsettings.properties @@ -216,6 +216,9 @@ AltLottery2and1NumberPrize = 200 +# Critical Cap ( Max Critical ) +# Retail: 500 +CriticalCap = 500 Index: D:/Workspace/Eclipse/java/net/sf/l2j/Config.java =================================================================== --- D:/Workspace/Eclipse/java/net/sf/l2j/Config.java +++ D:/Workspace/Eclipse/java/net/sf/l2j/Config.java @@ -155,6 +155,9 @@ /** Fast or slow multiply coefficient for skill hit time */ public static float ALT_GAME_SKILL_HIT_RATE; + /**Cricial Cap Configuration*/ + public static int CRITICAL_CAP; + /** Alternative gameing - loss of XP on death */ public static boolean ALT_GAME_DELEVEL; @@ -1490,6 +1493,7 @@ ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "false")); ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000")); ALT_GAME_SKILL_HIT_RATE = Float.parseFloat(altSettings.getProperty("AltGameSkillHitRate", "1.")); + CRITICAL_CAP = Integer.parseInt(altSettings.getProperty("CriticalCap", "500")); IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true")); SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("SpBookNeeded", "true")); AUTO_LOOT = altSettings.getProperty("AutoLoot").equalsIgnoreCase("True"); @@ -1986,6 +1990,7 @@ else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue); else if (pName.equalsIgnoreCase("AltGameSkillHitRate")) ALT_GAME_SKILL_HIT_RATE = Float.parseFloat(pValue); + else if (pName.equalsIgnoreCase("CriticalCap")) CRITICAL_CAP = Integer.parseInt(pValue); else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.valueOf(pValue); else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.valueOf(pValue); Index: D:/Workspace/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java =================================================================== --- D:/Workspace/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java +++ D:/Workspace/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java @@ -154,8 +154,8 @@ int criticalHit = (int) calcStat(Stats.CRITICAL_RATE, _ActiveChar.getTemplate().baseCritRate, target, skill); // Set a cap of Critical Hit at 500 - if(criticalHit > 500) - criticalHit = 500; + if(criticalHit > Config.CRITICAL_CAP) + criticalHit = Config.CRITICAL_CAP; return criticalHit; } Index: D:/Workspace/Eclipse/java/net/sf/l2j/gameserver/skills/Formulas.java =================================================================== --- D:/Workspace/Eclipse/java/net/sf/l2j/gameserver/skills/Formulas.java +++ D:/Workspace/Eclipse/java/net/sf/l2j/gameserver/skills/Formulas.java @@ -370,8 +370,8 @@ { env.value *= DEXbonus[p.getDEX()]; env.value *= 10; - if(env.value > 500) - env.value = 500; + if(env.value > Config.CRITICAL_CAP) + env.value = Config.CRITICAL_CAP; } } }
  4. Hello MxC Members, here is a diff file to add TvT Commands .tvtjoin, .tvtleave to you Server. Is really simple, The one Cobra ( I think shared ) Was for L2JFree. Here is for L2J: Index: /Lineage 2 Empire/L2JInterlude-Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TvT.java =================================================================== --- /Lineage 2 Empire/L2JInterlude-Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TvT.java (revision 11) +++ /Lineage 2 Empire/L2JInterlude-Game/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TvT.java (revision 11) @@ -0,0 +1,43 @@ +package net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.entity.TvTEvent; + + +public class TvT implements IVoicedCommandHandler +{ + private static final String[] VOICED_COMMANDS = { "tvtjoin", "tvtleave" }; + + public String[] getVoicedCommandList() + { + return VOICED_COMMANDS; + } + + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) + { + if (command.equalsIgnoreCase("tvtjoin")) + { + boolean aaa = TvTEvent.addParticipant(activeChar); + if(aaa) + activeChar.sendMessage("Registered to TvT"); + else + activeChar.sendMessage("Registration failed"); + + return aaa; + } + else if (command.equalsIgnoreCase("tvtleave")) + { + return TvTEvent.removeParticipant(activeChar.getName()); + } + + return false; + } + +} Index: /Lineage 2 Empire/L2JInterlude-Game/java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- /Lineage 2 Empire/L2JInterlude-Game/java/net/sf/l2j/gameserver/GameServer.java (revision 6) +++ /Lineage 2 Empire/L2JInterlude-Game/java/net/sf/l2j/gameserver/GameServer.java (revision 11) @@ -198,16 +198,17 @@ import net.sf.l2j.gameserver.handler.usercommandhandlers.DisMount; import net.sf.l2j.gameserver.handler.usercommandhandlers.Escape; import net.sf.l2j.gameserver.handler.usercommandhandlers.Loc; import net.sf.l2j.gameserver.handler.usercommandhandlers.Mount; import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat; import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo; import net.sf.l2j.gameserver.handler.usercommandhandlers.Time; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvT; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats; import net.sf.l2j.gameserver.handler.voicedcommandhandlers.OnlinePlayers; import net.sf.l2j.gameserver.idfactory.IdFactory; import net.sf.l2j.gameserver.instancemanager.AuctionManager; import net.sf.l2j.gameserver.instancemanager.BoatManager; import net.sf.l2j.gameserver.instancemanager.CastleManager; import net.sf.l2j.gameserver.instancemanager.CastleManorManager; @@ -599,16 +600,18 @@ _log.config("UserCommandHandler: Loaded " + _userCommandHandler.size() + " handlers."); _voicedCommandHandler = VoicedCommandHandler.getInstance(); _voicedCommandHandler.registerVoicedCommandHandler(new stats()); if(L2Config.L2JMOD_ALLOW_WEDDING) _voicedCommandHandler.registerVoicedCommandHandler(new Wedding()); + _voicedCommandHandler.registerVoicedCommandHandler(new TvT()); + if(L2Config.BANKING_SYSTEM_ENABLED) _voicedCommandHandler.registerVoicedCommandHandler(new Banking()); if(L2Config.ALLOW_ONLINE_VCOMMAND) _voicedCommandHandler.registerVoicedCommandHandler(new OnlinePlayers()); _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers."); Credits: Cobra, and ŚyśţęmƒяәдҚς for reworking it for L2J Interlude.
  5. Hidded for 200 Posts, because is unique. And Useful for all Interlude Servers.
  6. I Really like the Video, good luck !/
  7. Hello MxC, i would like to share Flood Protection rework, this will help you avoid some bugs, spams, lags. This is for Interlude, Gracia final already has it. The first thing you have to is to delete old Floodprotections Is so easy, look a bit: Delete floodprotector.java, after delete all the errors comes up from this delete :P. Delete Support from L2Pcinstance. Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java @@ -201,5 +201,4 @@ import net.sf.l2j.gameserver.templates.L2WeaponType; import net.sf.l2j.gameserver.util.Broadcast; -import net.sf.l2j.gameserver.util.FloodProtector; import net.sf.l2j.util.Point3D; import net.sf.l2j.util.Rnd; @@ -10883,6 +10883,5 @@ // Close the connection with the client closeNetConnection(); - // remove from flood protector - FloodProtector.getInstance().removePlayer(getObjectId()); + if (getClanId() > 0) { Then add the new FloodProtection System, look again: Take this file: FloodProtection Rework is a diff file, is the rework for FloodProtection ( is too easy to add by hand ) Then after all these, you will have to add the protection in the files you want to protect: Here is an example: Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 421) +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 423) @@ -17,4 +17,6 @@ import java.util.logging.Level; import java.util.logging.Logger; + +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.Config; @@ -60,4 +62,11 @@ { L2PcInstance activeChar = getClient().getActiveChar(); + + if (!activeChar.getFloodProtectors().getServerBypass().tryPerformAction("_command")) + { + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (activeChar == null) NOTE: "Actionfailed.STATIC_PACKET " can be changed to new ActionFaled()); without harming the code. { Here is the link for all important: http://www.4shared.com/file/184891519/dbc74782/Protectingit.html Note: This is important for all Interlude Servers.
  8. Hello, i noticed that in L2J, Interlude these commands ( sethero, setnoble ) doesn't exists. So i decided to Share them. Adapted on interlude L2J as i said before. Here is the diff file REALLY SIMPLE: Index: /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java =================================================================== --- /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java +++ /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java @@ -0,0 +1,155 @@ +/* + * 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.handler.admincommandhandlers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.l2j.Config; +import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.GmListTable; +import net.sf.l2j.gameserver.handler.IAdminCommandHandler; +import net.sf.l2j.gameserver.model.L2Object; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; + +public class AdminHero implements IAdminCommandHandler +{ + private static String[] _adminCommands = + { + "admin_sethero",}; + private final static Log _log = LogFactory.getLog(AdminHero.class.getName()); + private static final int REQUIRED_LEVEL = Config.GM_MENU; + + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + if (!Config.ALT_PRIVILEGES_ADMIN) + { + if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM())) + { + return false; + } + } + if (command.startsWith("admin_sethero")) + { + L2Object target = activeChar.getTarget(); + L2PcInstance player = null; + SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2); + if (target instanceof L2PcInstance) + { + player = (L2PcInstance)target; + } else + { + player = activeChar; + } + + if (player.isHero()) + { + player.setHero(false); + sm.addString("You are no longer a server hero."); + GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" removed hero stat of player"+ target.getName()); + Connection connection = null; + try + { + connection = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?"); + statement.setString(1,target.getName()); + ResultSet rset = statement.executeQuery(); + int objId = 0; + if (rset.next()) + { + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) {connection.close(); return false;} + + statement = connection.prepareStatement("UPDATE characters SET hero=0 WHERE obj_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e) + { + _log.warn("could not set Hero stats of char:", e); + } + finally + { + try { connection.close(); } catch (Exception e) {} + } + } + else + { + player.setHero(true); + sm.addString("You are now a server Hero, congratulations!"); + GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" has given Hero stat for player "+target.getName()+"."); + Connection connection = null; + try + { + connection = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?"); + statement.setString(1,target.getName()); + ResultSet rset = statement.executeQuery(); + int objId = 0; + if (rset.next()) + { + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) {connection.close(); return false;} + + statement = connection.prepareStatement("UPDATE characters SET hero=1 WHERE obj_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e) + { + _log.warn("could not set Hero stats of char:", e); + } + finally + { + try { connection.close(); } catch (Exception e) {} + } + + } + player.sendPacket(sm); + player.broadcastUserInfo(); + if(player.isHero() == true) + { + } + } + return false; + } + public String[] getAdminCommandList() { + return _adminCommands; + } + private boolean checkLevel(int level) + { + return (level >= REQUIRED_LEVEL); + } +} Index: /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminNoble.java =================================================================== --- /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminNoble.java +++ /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminNoble.java @@ -0,0 +1,156 @@ +/* + * 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.handler.admincommandhandlers; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import net.sf.l2j.Config; +import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.GmListTable; +import net.sf.l2j.gameserver.handler.IAdminCommandHandler; +import net.sf.l2j.gameserver.model.L2Object; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; + + +public class AdminNoble implements IAdminCommandHandler +{ + private static String[] _adminCommands = + { + "admin_setnoble",}; + private final static Log _log = LogFactory.getLog(AdminNoble.class.getName()); + private static final int REQUIRED_LEVEL = Config.GM_MENU; + + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + if (!Config.ALT_PRIVILEGES_ADMIN) + { + if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM())) + { + return false; + } + } + if (command.startsWith("admin_setnoble")) + { + L2Object target = activeChar.getTarget(); + L2PcInstance player = null; + SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2); + if (target instanceof L2PcInstance) + { + player = (L2PcInstance)target; + } else + { + player = activeChar; + } + + if (player.isNoble()) + { + player.setNoble(false); + sm.addString("You are no longer a server noble."); + GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" removed noble stat of player"+ target.getName()); + Connection connection = null; + try + { + connection = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?"); + statement.setString(1,target.getName()); + ResultSet rset = statement.executeQuery(); + int objId = 0; + if (rset.next()) + { + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) {connection.close(); return false;} + + statement = connection.prepareStatement("UPDATE characters SET nobless=0 WHERE obj_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e) + { + _log.warn("could not set noble stats of char:", e); + } + finally + { + try { connection.close(); } catch (Exception e) {} + } + } + else + { + player.setNoble(true); + sm.addString("You are now a server noble, congratulations!"); + GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" has given noble stat for player "+target.getName()+"."); + Connection connection = null; + try + { + connection = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?"); + statement.setString(1,target.getName()); + ResultSet rset = statement.executeQuery(); + int objId = 0; + if (rset.next()) + { + objId = rset.getInt(1); + } + rset.close(); + statement.close(); + + if (objId == 0) {connection.close(); return false;} + + statement = connection.prepareStatement("UPDATE characters SET nobless=1 WHERE obj_id=?"); + statement.setInt(1, objId); + statement.execute(); + statement.close(); + connection.close(); + } + catch (Exception e) + { + _log.warn("could not set noble stats of char:", e); + } + finally + { + try { connection.close(); } catch (Exception e) {} + } + + } + player.sendPacket(sm); + player.broadcastUserInfo(); + if(player.isNoble() == true) + { + } + } + return false; + } + public String[] getAdminCommandList() { + return _adminCommands; + } + private boolean checkLevel(int level) + { + return (level >= REQUIRED_LEVEL); + } +} And to register them to Gameserver here: Index: /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/GameServer.java +++ /trunk/Eclipse/src/main/java/net/sf/l2j/gameserver/GameServer.java @@ -90,4 +90,5 @@ import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHeal; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHelpPage; +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHero; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminInvul; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminKick; @@ -100,4 +101,5 @@ import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminMobGroup; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminMonsterRace; +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminNoble; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminPForge; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminPathNode; @@ -569,6 +571,7 @@ _adminCommandHandler.registerAdminCommandHandler(new AdminManor()); _adminCommandHandler.registerAdminCommandHandler(new AdminTvTEvent()); - //_adminCommandHandler.registerAdminCommandHandler(new AdminRadar()); - _log.config("AdminCommandHandler: Loaded " + _adminCommandHandler.size() + " handlers."); + _adminCommandHandler.registerAdminCommandHandler(new AdminHero()); + _adminCommandHandler.registerAdminCommandHandler(new AdminNoble()); + _log.config("AdminCommandHandler: Loaded " + _adminCommandHandler.size() + " handlers."); _userCommandHandler = UserCommandHandler.getInstance(); Credits: L2JForum and SySt3MFr3aKs.
  9. Hello Everybody, here is a simple Code. to Avoid Quest stucking and LAGS And more more Shits :) Bypass Flood Protection: ### Eclipse Workspace Patch 1.0 #P L2_GameServer_It Index: java/net/sf/l2j/gameserver/util/FloodProtector.java =================================================================== --- java/net/sf/l2j/gameserver/util/FloodProtector.java (revision 3695) +++ java/net/sf/l2j/gameserver/util/FloodProtector.java (working copy) @@ -50,7 +50,7 @@ // ========================================================= // reuse delays for protected actions (in game ticks 1 tick = 100ms) - private static final int[] REUSEDELAY = new int[]{ 4, 42, 42, 16, 100 }; + private static final int[] REUSEDELAY = new int[]{ 4, 42, 42, 16, 100, Config.PROTECTED_BYPASS }; // protected actions public static final int PROTECTED_USEITEM = 0; @@ -58,6 +58,7 @@ public static final int PROTECTED_FIREWORK = 2; public static final int PROTECTED_ITEMPETSUMMON = 3; public static final int PROTECTED_HEROVOICE = 4; + public static final int PROTECTED_BYPASS = 5; // ========================================================= // Constructor Index: java/config/options.properties =================================================================== --- java/config/options.properties (revision 3695) +++ java/config/options.properties (working copy) @@ -16,6 +16,9 @@ # If next switch is set to true every newly created character will have access level 200. EverybodyHasAdminRights = False +# Protected Server Bypass. +ProtectedBypass = 4 + # Setting for serverList # Displays [] in front of server name ServerListBrackets = False Index: java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java =================================================================== --- java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java (revision 3695) +++ java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java (working copy) @@ -32,6 +32,7 @@ import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.entity.L2Event; +import net.sf.l2j.gameserver.util.FloodProtector; import net.sf.l2j.gameserver.serverpackets.ActionFailed; import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage; @@ -64,6 +65,13 @@ if (activeChar == null) return; + + if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_BYPASS)) + { + activeChar.sendMessage("You cannot bypass so fast."); + activeChar.sendPacket(new ActionFailed()); + return; + } try { if (_command.startsWith("admin_")) //&& activeChar.getAccessLevel() >= Config.GM_ACCESSLEVEL) Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 3695) +++ java/net/sf/l2j/Config.java (working copy) @@ -588,6 +588,8 @@ /** FloodProtector initial capacity */ public static int FLOODPROTECTOR_INITIALSIZE; + + public static int PROTECTED_BYPASS; /** Allow Discard item ?*/ public static boolean ALLOW_DISCARDITEM; @@ -1259,6 +1261,8 @@ ONLY_GM_ITEMS_FREE = Boolean.valueOf(optionsSettings.getProperty("OnlyGMItemsFree", "True")); + PROTECTED_BYPASS = Integer.parseInt(optionsSettings.getProperty("ProtectedBypass", "4")); + ALLOW_WAREHOUSE = Boolean.valueOf(optionsSettings.getProperty("AllowWarehouse", "True")); WAREHOUSE_CACHE = Boolean.valueOf(optionsSettings.getProperty("WarehouseCache", "False")); WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15")); 1Thousent -beep-ing Sorrys is is already Shared.
  10. This is based on Interlude L2J, but it is adapted to other Chronicles too. It protects the server from some kind of Enchant exploits ( Is not already shared ) Here is the Diff file: Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 164) @@ -61,8 +61,20 @@ L2PcInstance activeChar = getClient().getActiveChar(); if (activeChar == null || _objectId == 0) return; + + if (activeChar.isProcessingTransaction()) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + activeChar.setActiveEnchantItem(null); + return; + } L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId); L2ItemInstance scroll = activeChar.getActiveEnchantItem(); - activeChar.setActiveEnchantItem(null); + if (item == null || scroll == null) + { + activeChar.setActiveEnchantItem(null); + return; + } + if (item == null || scroll == null) return; @@ -74,5 +86,6 @@ { activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); - return; + activeChar.setActiveEnchantItem(null); + return; } @@ -89,4 +102,26 @@ return; } + + switch (item.getLocation()) + { + case INVENTORY: + case PAPERDOLL: + { + if (item.getOwnerId() != activeChar.getObjectId()) + { + activeChar.setActiveEnchantItem(null); + return; + } + break; + } + default: + { + Util.handleIllegalPlayerAction(activeChar,"Player " + +activeChar.getName() + +" tried to use enchant Exploit!", IllegalPlayerAction.PUNISH_KICKBAN); + return; + } + } + int itemType2 = item.getItem().getType2(); boolean enchantItem = false;
  11. Fix for Max CP Exploit, as my title says :P For Interlude L2J, servers. Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java @@ -244,5 +244,5 @@ } - public final int getMaxCp() + public int getMaxCp() { if (_activeChar == null) Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java =================================================================== --- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java +++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java @@ -42,4 +42,5 @@ private int _oldMaxHp; // stats watch private int _oldMaxMp; // stats watch + private int _oldMaxCp; // stats watch // ========================================================= @@ -411,4 +412,19 @@ } + @Override + public final int getMaxCp() + { + int val = super.getMaxCp(); + if (val != _oldMaxCp) + { + _oldMaxCp = val; + if (getActiveChar().getStatus().getCurrentCp() != val) + { + getActiveChar().getStatus().setCurrentCp(getActiveChar().getStatus().getCurrentCp()); + } + } + return val; + } + @Override public final int getSp() Credits: ŚyśţęmƒяәдҚς
  12. SoulShots, sprintshots, B.Shots.. you cannot use them while paralyzed. Here is a diff file to fix it. Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/SoulShots.java (revision 115) @@ -24,4 +24,5 @@ import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot; import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUser; @@ -61,4 +62,10 @@ if(!activeChar.getAutoSoulShot().containsKey(itemId)) activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_USE_SOULSHOTS)); + return; + } + if (activeChar.isParalyzed()) + { + activeChar.sendMessage("You Cannot Use Soulshots While You Are Paralyzed!"); + activeChar.sendPacket(new ActionFailed()); return; } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/SpiritShot.java (revision 115) @@ -24,4 +24,5 @@ import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot; import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUser; @@ -66,4 +67,11 @@ if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE) return; + if (activeChar.isParalyzed()) + { + activeChar.sendMessage("You Cannot Use Spirishots While You Are Paralyzed!"); + activeChar.sendPacket(new ActionFailed()); + return; + } + // Check for correct grade int weaponGrade = weaponItem.getCrystalType(); Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 115) @@ -24,4 +24,5 @@ import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.ExAutoSoulShot; import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUser; @@ -60,4 +61,10 @@ activeChar.sendPacket(sm); sm = null; + return; + } + if (activeChar.isParalyzed()) + { + activeChar.sendMessage("You Cannot Use Blessed Spirishots While You Are Paralyzed!"); + activeChar.sendPacket(new ActionFailed()); return; } Credits: ŚyśţęmƒяәдҚς
  13. Potion Fix: - When you target a distant mob, and use a skill the Char starts to run to the mob. BUT WHEN you click on a potions, char stops running. Same as when you are attacking PCs. Okay here is a patch to fix it, for Interlude L2J. Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/L2Character.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/L2Character.java (revision 124) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/L2Character.java (revision 149) @@ -5604,4 +5604,8 @@ L2PcInstance currPlayer = (L2PcInstance)this; SkillDat queuedSkill = currPlayer.getQueuedSkill(); + + // Rescuing old skill cast task if exist + if (skill.isPotion()) + queuedSkill = currPlayer.getCurrentSkill(); currPlayer.setCurrentSkill(null, false, false); Credits: ŚyśţęmƒяәдҚς
  14. My shares till now, on MxCheaters forum. !Updated: 27 Times - Shared on [glow=red,2,300]10.01.1010.[/glow] - [share] L2JAttacker Fix [ Interlude ] - [share]Remove PVPFlag, command - Shared on [glow=red,2,300]07.01.2010.[/glow] - [share-Updated] New* Away Command - Shared on [glow=red,2,300]04.01.2010.[/glow] - [share] Java buff Function, Simple - Shared on [glow=red,2,300]31.12.2009.[/glow] - [share] Disable Grade / Weight Penalty - [share] Gracia Epilogue Precompiled Pack - [share] Low Level Protection System - [share] Critical Cap ( Max Critical ) - [share] TvT Commands ( L2J ) - Shared on [glow=red,2,300]30.12.2009.[/glow] - [Guide][share][int] FloodProtection Rework. Important ! - [share][int] Sethero / Noble Commands for Admin. - [share] Enchant, preventing some exploits. - [share] Unknown Packets ( PHX ) Spam protection. - [share][int]Max CP Exploit fix. - [share][int] Shots, preventing exploits. - [share][int] Fix potions, when attacking with skill. - [Guide] Gain skill when in Jail zone. - [share][int] R-L Bluff effect. - [share] Damage configuration, Useful for PvP Servers - [share][int] Blow skill rates. - [share][int] Retail-Like, reworked Boat engine - [share][int] Signet Skills L2J. (Core + DP ) Support - [share] Chat filter system. - [glow=red,2,300]Older Shares.[/glow] - [Compiled] Archid + Jenova - [Compiled] Hardcode - [share] Auto-Loot Raid - [share] Event engines. - [share] Server bypass Protection - [share] Configurable GM Message !!
  15. Hello MxC Community, i decided to share something that Eminence was using for the Jail System. More info:. When somebody goes to the Jail Zone, he gains one Skill ( of your choice ), is really really simple. So Lets Start: Open the L2JailZone.java file wich is located right here: [glow=red,2,300]java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java[/glow] And add the lines ( when somebody ENTER'S the Jail Zone ) + character.startAbnormalEffect(0x2000); + if (character.getKnownSkill(Your Skill ID) == null) + { + character.addSkill(SkillTable.getInstance().getInfo(Your Skill ID, 1)); + } And add the lines after ( remove this skill when he LEFTS the Jail zone ) + character.stopAbnormalEffect((short) 0x2000); + if (character.getKnownSkill(Your Skill ID) != null) + { + character.removeSkill(SkillTable.getInstance().getInfo(Your Skill ID, 1)); + } And do not forget to add the imports: ( In the same file ) +import net.sf.l2j.gameserver.datatables.SkillTable; And here is the diff file to add it easier :P: Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java (revision 28) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java (revision 183) @@ -18,5 +18,4 @@ package net.sf.l2j.gameserver.model.zone.type; +import net.sf.l2j.gameserver.datatables.SkillTable; import net.sf.l2j.gameserver.model.L2Character; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; @@ -44,9 +43,4 @@ character.setInsideZone(L2Character.ZONE_JAIL, true); character.setInsideZone(L2Character.ZONE_PVP, true); + character.startAbnormalEffect(0x2000); + if (character.getKnownSkill(Your skill id) == null) + { + character.addSkill(SkillTable.getInstance().getInfo(Your skill id, 1)); + } ((L2PcInstance)character).sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE)); } @@ -60,9 +54,4 @@ character.setInsideZone(L2Character.ZONE_JAIL, false); character.setInsideZone(L2Character.ZONE_PVP, false); + character.stopAbnormalEffect((short) 0x2000); + if (character.getKnownSkill(Your skill id) != null) + { + character.removeSkill(SkillTable.getInstance().getInfo(Your skill id, 1)); + } ((L2PcInstance)character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE)); } This code is not only for Jail Zone, you can add it on any zone you would like is just an example. Hope you like it. Credits: to me ŚyśţęmƒяәдҚς.
  16. Retail-Like Bluff effect, for Interlude L2J Here is a simple diff file: Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/serverpackets/BeginRotation.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/serverpackets/BeginRotation.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/serverpackets/BeginRotation.java (revision 159) @@ -19,18 +19,15 @@ package net.sf.l2j.gameserver.network.serverpackets; -import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; - public class BeginRotation extends L2GameServerPacket { private static final String _S__77_BEGINROTATION = "[s] 62 BeginRotation"; - private int _charObjId; - private int _degree; - private int _side; + private int _charObjId, _degree, _side, _speed; - public BeginRotation(L2PcInstance player, int degree, int side) + public BeginRotation(int objectId, int degree, int side, int speed) { - _charObjId = player.getObjectId(); + _charObjId = objectId; _degree = degree; _side = side; + _speed = speed; } @@ -42,4 +39,5 @@ writeD(_degree); writeD(_side); + writeD(_speed); } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/serverpackets/StopRotation.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/serverpackets/StopRotation.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/serverpackets/StopRotation.java (revision 159) @@ -19,6 +19,4 @@ package net.sf.l2j.gameserver.network.serverpackets; -import net.sf.l2j.gameserver.model.L2Character; - /** * This class ... @@ -29,11 +27,11 @@ { private static final String _S__78_STOPROTATION = "[s] 63 StopRotation"; - private int _charObjId; - private int _degree; + private int _charObjId, _degree, _speed; - public StopRotation(L2Character player, int degree) + public StopRotation(int objectId, int degree, int speed) { - _charObjId = player.getObjectId(); + _charObjId = objectId; _degree = degree; + _speed = speed; } @@ -44,4 +42,6 @@ writeD(_charObjId); writeD(_degree); + writeD(_speed); + writeC(0); // ? } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/FinishRotating.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/FinishRotating.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/FinishRotating.java (revision 159) @@ -46,5 +46,5 @@ if (getClient().getActiveChar() == null) return; - StopRotation sr = new StopRotation(getClient().getActiveChar(), _degree); + StopRotation sr = new StopRotation(getClient().getActiveChar().getObjectId(), _degree, 0); getClient().getActiveChar().broadcastPacket(sr); } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/StartRotating.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/StartRotating.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/StartRotating.java (revision 159) @@ -46,5 +46,5 @@ if (getClient().getActiveChar() == null) return; - BeginRotation br = new BeginRotation(getClient().getActiveChar(), _degree, _side); + BeginRotation br = new BeginRotation(getClient().getActiveChar().getObjectId(), _degree, _side, 0); getClient().getActiveChar().broadcastPacket(br); } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/skills/effects/EffectBluff.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/skills/effects/EffectBluff.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/skills/effects/EffectBluff.java (revision 159) @@ -19,10 +19,10 @@ package net.sf.l2j.gameserver.skills.effects; -import net.sf.l2j.gameserver.ai.CtrlIntention; -import net.sf.l2j.gameserver.model.L2CharPosition; import net.sf.l2j.gameserver.model.L2Effect; import net.sf.l2j.gameserver.model.actor.instance.L2FolkInstance; import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2SiegeSummonInstance; +import net.sf.l2j.gameserver.network.serverpackets.BeginRotation; +import net.sf.l2j.gameserver.network.serverpackets.StopRotation; import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; import net.sf.l2j.gameserver.skills.Env; @@ -33,5 +33,6 @@ * Implementation of the Bluff Effect */ -final class EffectBluff extends L2Effect { +final class EffectBluff extends L2Effect +{ public EffectBluff(Env env, EffectTemplate template) @@ -50,6 +51,5 @@ public void onStart() { - getEffected().startFear(); - if(getEffected() instanceof L2FolkInstance) return; + if(getEffected() instanceof L2FolkInstance) return; // if(getEffected() instanceof L2SiegeGuardInstance) return; // Cannot be used on Headquarters Flag. @@ -58,33 +58,12 @@ if(getEffected() instanceof L2SiegeSummonInstance) - { return; - } - int posX = getEffected().getX(); - int posY = getEffected().getY(); - int posZ = getEffected().getZ(); - int signx=-1; - int signy=-1; - if (getEffected().getX()>getEffector().getX()) - signx=1; - if (getEffected().getY()>getEffector().getY()) - signy=1; - - //posX += signx*40; //distance less than melee attacks (40) - //posY += signy*40; - - getEffected().setRunning(); - getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, - new L2CharPosition(posX +(signx*40),posY + (signy*40),posZ,0)); - getEffected().sendPacket(SystemMessage.sendString("You can feel Bluff's effect")); - getEffected().setTarget(null); + + getEffected().broadcastPacket(new BeginRotation(getEffected().getObjectId(), getEffected().getHeading(), 1, 65535)); + getEffected().broadcastPacket(new StopRotation(getEffected().getObjectId(), getEffector().getHeading(), 65535)); + getEffected().setHeading(getEffector().getHeading()); onActionTime(); } - @Override - public void onExit() - { - getEffected().stopFear(this); - - } + @Override public boolean onActionTime() Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/skills/effects/EffectRemoveTarget.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/skills/effects/EffectRemoveTarget.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/skills/effects/EffectRemoveTarget.java (revision 159) @@ -18,4 +18,5 @@ package net.sf.l2j.gameserver.skills.effects; +import net.sf.l2j.gameserver.ai.CtrlIntention; import net.sf.l2j.gameserver.model.L2Effect; import net.sf.l2j.gameserver.skills.Env; @@ -44,4 +45,5 @@ getEffected().abortAttack(); getEffected().abortCast(); + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, getEffector()); } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/ai/AbstractAI.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/ai/AbstractAI.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/ai/AbstractAI.java (revision 159) @@ -624,5 +624,5 @@ { // Send a Server->Client packet StopRotation to the actor and all L2PcInstance in its _knownPlayers - StopRotation sr = new StopRotation(_actor, pos.heading); + StopRotation sr = new StopRotation(_actor.getObjectId(), pos.heading, 0); _actor.sendPacket(sr); _actor.broadcastPacket(sr); Credits: L2JForum, and ŚyśţęmƒяәдҚς ( For many modifications i did here )
  17. Hello, this is a way to " balance " Blow skill Sucess. Here is a Simple diff file. Index: /trunk/Eclipse-Game/config/Custom/Classbalance.properties =================================================================== --- /trunk/Eclipse-Game/config/Custom/Classbalance.properties (revision 76) +++ /trunk/Eclipse-Game/config/Custom/Classbalance.properties (revision 127) @@ -1,3 +1,9 @@ # Eclipse Configurable Damage Optimizations. +#--------------------------------------------- +# Blow Success Configs +#--------------------------------------------- +FrontBlowSuccess = 50 +SideBlowSuccess = 60 +BehindBlowSuccess = 70 #--------------------------------------------- Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/skillhandlers/Blow.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/skillhandlers/Blow.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/handler/skillhandlers/Blow.java (revision 126) @@ -18,4 +18,5 @@ package net.sf.l2j.gameserver.handler.skillhandlers; +import net.sf.l2j.L2Config; import net.sf.l2j.gameserver.handler.ISkillHandler; import net.sf.l2j.gameserver.model.L2Character; @@ -45,7 +46,7 @@ private int _successChance; - public final static int FRONT = 50; - public final static int SIDE = 60; - public final static int BEHIND = 70; + public final static int FRONT = L2Config.FRONT_BLOW_SUCCESS; + public final static int SIDE = L2Config.SIDE_BLOW_SUCCESS; + public final static int BEHIND = L2Config.BEHIND_BLOW_SUCCESS; public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets){ Index: /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java (revision 121) +++ /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java (revision 126) @@ -794,5 +794,7 @@ public static float POLE_VS_LIGHT; public static float POLE_VS_ROBE; - + public static int FRONT_BLOW_SUCCESS; + public static int SIDE_BLOW_SUCCESS; + public static int BEHIND_BLOW_SUCCESS; // Packet information @@ -1341,4 +1343,7 @@ POLE_VS_ROBE = Float.parseFloat(cbSettings.getProperty("PoleVsHeavy", "1.80")); + FRONT_BLOW_SUCCESS = Integer.parseInt(cbSettings.getProperty("FrontBlowSuccess", "50")); + SIDE_BLOW_SUCCESS = Integer.parseInt(cbSettings.getProperty("SideBlowSuccess", "60")); + BEHIND_BLOW_SUCCESS = Integer.parseInt(cbSettings.getProperty("BehindBlowSuccess", "70")); } catch (Exception e) Credits: L2JForum. ONLY.
  18. Boat system rework, for L2J-IL. Useful for RPG IL Servers. R-L fix. Hope you like it. Add it manually, if from my Private eclipse Project. Download Like: http://www.4shared.com/file/180241076/b6adfcba/changeset_r69.html For more info, read the code. And remember add it by hand. Credits: L2JForum, George, ŚyśţęmƒяәдҚς and Virus. !!!
  19. Singet skills for Interlude Chronicle, Support for L2J. Sorry it was too big, so i uploaded somewhere, is a diff file. Easy to insert by hand. Core support: Download link: http://www.4shared.com/file/184746405/5eb91e02/Signet_Skills_L2J.html DP Support: Index: /trunk/Eclipse-Data/data/stats/skills/0400-0499.xml =================================================================== --- /trunk/Eclipse-Data/data/stats/skills/0400-0499.xml (revision 44) +++ /trunk/Eclipse-Data/data/stats/skills/0400-0499.xml (revision 106) @@ -1193,123 +1193,188 @@ </skill> <skill id="454" levels="1" name="Symbol of Defense"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that maximizes the defense abilities of those nearby. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="10000"/> + <set name="reuseDelay" val="300000"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13018"/> + <set name="triggerEffectId" val="5123"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8875"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="1" name="Signet" time="180000" val="0"> + </effect> </for> </skill> <skill id="455" levels="1" name="Symbol of Noise"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that cancels the singing or dancing abilities of those nearby. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET_GROUND"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="16000"/> + <set name="reuseDelay" val="300000"/> + <set name="castRange" val="400"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13025"/> + <set name="initialEffectDelay" val="3000"/> + <set name="offensive" val="True"/> + <set name="triggerEffectId" val="5124"/> + <set name="element" val="2"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8876"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="0x7fffffff" name="SignetNoise" time="4" val="0"> + </effect> </for> </skill> <skill id="456" levels="1" name="Symbol of Resistance"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that maximizes resistance to abnormal states of those nearby. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="10000"/> + <set name="reuseDelay" val="300000"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13018"/> + <set name="triggerEffectId" val="5125"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8875"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="1" name="Signet" time="180000" val="0"> + </effect> </for> </skill> <skill id="457" levels="1" name="Symbol of Honor"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that maximizes the HP/CP recovery rate of those nearby. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="10000"/> + <set name="reuseDelay" val="300000"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13018"/> + <set name="triggerEffectId" val="5126"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8875"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="1" name="Signet" time="180000" val="0"> + </effect> </for> </skill> <skill id="458" levels="1" name="Symbol of Energy"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that increases P. Atk. and force for those nearby. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="10000"/> + <set name="reuseDelay" val="300000"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13018"/> + <set name="triggerEffectId" val="5127"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8875"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="1" name="Signet" time="180000" val="0"> + </effect> </for> </skill> <skill id="459" levels="1" name="Symbol of the Sniper"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that maximizes the archery skill of those nearby. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="10000"/> + <set name="reuseDelay" val="300000"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13018"/> + <set name="triggerEffectId" val="5128"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8875"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="1" name="Signet" time="180000" val="0"> + </effect> </for> </skill> <skill id="460" levels="1" name="Symbol of the Assassin"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Generates a signet that maximizes your dodging ability and increases the chance of inflicting a deadly attack for those near to you. Applies to all targets within the affected area. The effect disappears if you leave the area. Level 2 or higher Battle Force required. Consumes 1 Battle Symbol. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- needs core support --> + <set name="target" val="TARGET_SIGNET"/> + <set name="skillType" val="MOG"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="hitTime" val="10000"/> + <set name="reuseDelay" val="300000"/> + <set name="skillRadius" val="200"/> + <set name="magicLvl" val="80"/> + <set name="effectNpcId" val="13018"/> + <set name="triggerEffectId" val="5129"/> + <set name="isMagic" val="true"/> + <set name="power" val="200"/> + <set name="itemConsumeId" val="8875"/> + <set name="itemConsumeCount" val="1"/> + <set name="mpInitialConsume" val="36"/> + <set name="mpConsume" val="36"/> + <cond msg="Proper BattleForces required."> + <player battle_force="2"/> + </cond> + <for> + <effect self="1" count="1" name="Signet" time="180000" val="0"> + </effect> </for> </skill> <skill id="461" levels="2" name="Break Duress"> -<!-- - Needs to be finished. - Target is set to TARGET_NONE, skillType to NOTDONE for server compatability. - Description(s): - Lvl 1 - Uses Focused Force to escape from an immobile state. Level 2 Focused Force charge required. - Lvl 2 - Uses Focused Force to escape from a slow or immobile state. Level 3 Focused Force charge required. ---> - <set name="target" val="TARGET_NONE"/> - <set name="skillType" val="NOTDONE"/> - <set name="operateType" val="OP_PASSIVE"/> - <set name="castRange" val="-1"/> - <for> -<!-- how can I use num_charges when skillType is not CHARGEDAM ? --> - </for> + <table name="#charges"> 2 3 </table> + <table name="#mpConsume"> 20 35 </table> + <table name="#buffEffects"> 1201 1201;1160 </table> + <set name="hitTime" val="1000"/> + <set name="mpConsume" val="#mpConsume"/> + <set name="reuseDelay" val="20000"/> + <set name="target" val="TARGET_SELF"/> + <set name="charge_skill_id" val="50"/> + <set name="num_charges" val="#charges"/> + <set name="operateType" val="OP_ACTIVE"/> + <set name="exitBuffs" val="#buffEffects"/> + <set name="skillType" val="EXITBUFFS"/> </skill> </list> Hope you like it. NOTE: This code is not mine, i don't know who coded it.
  20. Chat filter system, with a log to write the words you don't allow in your server. Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 12) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/Say2.java (revision 130) @@ -192,4 +192,48 @@ _logChat.log(record); + } + + if (L2Config.USE_CHAT_FILTER) + { + if (_type == SHOUT || _type == TRADE || _type == HERO_VOICE) + { + String filteredText = _text; + filteredText = filteredText.replace("=", ""); + filteredText = filteredText.replace("*", ""); + filteredText = filteredText.replace(" ", ""); + filteredText = filteredText.replace("-", ""); + filteredText = filteredText.replace("_", ""); + filteredText = filteredText.replace(".", ""); + filteredText = filteredText.replace(",", ""); + filteredText = filteredText.replace("'", ""); + filteredText = filteredText.replace("/", ""); + filteredText = filteredText.replace("+", ""); + filteredText = filteredText.toLowerCase(); + if(!activeChar.inObserverMode() && !activeChar.isInDuel() && !activeChar.isInOlympiadMode() + && L2Config.CHAT_FILTER_PUNISHMENT.equalsIgnoreCase("jail") && !activeChar.isInCombat()) { + for (int i = 0; i < L2Config.FILTER_LIST.size(); i++) + { + if(filteredText.contains(L2Config.FILTER_LIST.get(i).toString())) { + int punishmentLength = 0; + punishmentLength = L2Config.CHAT_FILTER_PUNISHMENT_PARAM1 + (L2Config.CHAT_FILTER_PUNISHMENT_PARAM2*activeChar.ChatFilterCount); + activeChar.sendMessage("[ChatFilterSystem] Be careful whith words"); + activeChar.sendMessage("[ChatFilterSystem] Word " + L2Config.FILTER_LIST.get(i).toString()+ " is untolerable"); + activeChar.setInJail(true, punishmentLength); + activeChar.ChatFilterCount += 1; + _text = "[CFS] Jailed for " + punishmentLength + "mins"; + break; + } + } + } else { + for (int i = 0; i < L2Config.FILTER_LIST.size(); i++) + { + if(filteredText.contains(L2Config.FILTER_LIST.get(i).toString())) { + activeChar.sendMessage("[ChatFilterSystem] Be careful whith words"); + activeChar.sendMessage("[ChatFilterSystem] Word " + L2Config.FILTER_LIST.get(i).toString()+ " is untolerable"); + _text = "[CFS] Text cleared"; + } + } + } + } } Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 105) +++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 130) @@ -216,6 +216,6 @@ private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?"; - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?"; - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?"; + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,chat_filter_count=? WHERE obj_id=?"; + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,chat_filter_count FROM characters WHERE obj_id=?"; private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC"; private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)"; @@ -5910,5 +5910,6 @@ player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level")); - + player.setChatFilterCount(rset.getInt("chat_filter_count")); + // Add the L2PcInstance object in _allObjects //L2World.getInstance().storeObject(player); @@ -6274,5 +6275,6 @@ statement.setString(55, getName()); statement.setLong(56, getDeathPenaltyBuffLevel()); - statement.setInt(57, getObjectId()); + statement.setInt(57, getChatFilterCount()); + statement.setInt(58, getObjectId()); statement.execute(); @@ -6393,5 +6395,16 @@ finally { try { con.close(); } catch (Exception e) {} } } - + + /** ChatFilterCounter */ + public int ChatFilterCount = 0; + + public void setChatFilterCount(int cfcount) + { + ChatFilterCount = cfcount; + } + public int getChatFilterCount() + { + return ChatFilterCount; + } /** * Return True if the L2PcInstance is on line.<BR><BR> Index: /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java =================================================================== --- /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java (revision 128) +++ /trunk/Eclipse-Game/java/net/sf/l2j/L2Config.java (revision 130) @@ -6,4 +6,7 @@ import java.io.InputStream; import java.io.OutputStream; +import java.io.LineNumberReader; +import java.io.BufferedReader; +import java.io.FileReader; import java.math.BigInteger; import java.util.List; @@ -60,4 +63,5 @@ public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties"; public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties"; + public static final String CHAT_FILTER_FILE = "./config/ChatFilter.txt"; public static int MAX_ITEM_IN_PACKET; @@ -770,6 +774,10 @@ public static final FloodProtectorConfig FLOOD_PROTECTOR_WEREHOUSE = new FloodProtectorConfig("WerehouseFloodProtector"); public static final FloodProtectorConfig FLOOD_PROTECTOR_MISC = new FloodProtectorConfig("MiscFloodProtector"); - public static final FloodProtectorConfig FLOOD_PROTECTOR_CHAT = new FloodProtectorConfig("ChatFloodProtector"); - + public static final FloodProtectorConfig FLOOD_PROTECTOR_CHAT = new FloodProtectorConfig("ChatFloodProtector"); + public static boolean USE_CHAT_FILTER; + public static List<String> FILTER_LIST = new FastList<String>(); + public static String CHAT_FILTER_PUNISHMENT; + public static int CHAT_FILTER_PUNISHMENT_PARAM1; + public static int CHAT_FILTER_PUNISHMENT_PARAM2; // Class Balance @@ -2100,4 +2108,33 @@ floodprotectorSettings.load(is); is.close(); + + USE_CHAT_FILTER = Boolean.parseBoolean(floodprotectorSettings.getProperty("UseChatFilter", "True")); + CHAT_FILTER_PUNISHMENT = floodprotectorSettings.getProperty("ChatFilterPunishment", "off"); + CHAT_FILTER_PUNISHMENT_PARAM1 = Integer.parseInt(floodprotectorSettings.getProperty("ChatFilterPunishmentParam1", "1")); + CHAT_FILTER_PUNISHMENT_PARAM2 = Integer.parseInt(floodprotectorSettings.getProperty("ChatFilterPunishmentParam2", "1")); + + if (USE_CHAT_FILTER) + { + try + { + LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE)))); + String line = null; + while ((line = lnr.readLine()) != null) + { + if (line.trim().length() == 0 || line.startsWith("#")) + { + continue; + } + FILTER_LIST.add(line.trim()); + } + _log.info("Chat Filter: Loaded " + FILTER_LIST.size() + " words"); + } + catch (Exception e) + { + e.printStackTrace(); + throw new Error("Failed to Load "+CHAT_FILTER_FILE+" File."); + } + } + loadFloodProtectorConfigs(floodprotectorSettings); _log.info("# " + FLOODPROTECTOR_CONFIG_FILE + " Sucessfully LOADED #"); Index: /trunk/Eclipse-Game/config/ChatFilter.txt =================================================================== --- /trunk/Eclipse-Game/config/ChatFilter.txt (revision 130) +++ /trunk/Eclipse-Game/config/ChatFilter.txt (revision 130) @@ -0,0 +1,7 @@ +lag +laag +laaag +laaaag +laaaaag +laaaaaag +laaaaaaag Index: /trunk/Eclipse-Game/config/Custom/FloodProtector.properties =================================================================== --- /trunk/Eclipse-Game/config/Custom/FloodProtector.properties (revision 76) +++ /trunk/Eclipse-Game/config/Custom/FloodProtector.properties (revision 130) @@ -7,4 +7,16 @@ # PunishmentType - type of the punishment ('none', 'ban', 'jail'), used only, if PunishmentLimit is greater than zero # PunishmentTime - for how many minutes should be the player/account punished, player is punished in case of 'jail', account is punishedin case of 'ban' (0 = forever) + +#--------------------------------------------------------------- +# Chat Filter system - +#--------------------------------------------------------------- +# Enable chat filter +UseChatFilter = False +# Player punishment for illegal word: off, jail +ChatFilterPunishment = off +# How long the punishment is in effect, min +ChatFilterPunishmentParam1 = 10 +# How much to increase every new punishment for player, min +ChatFilterPunishmentParam2 = 5 FloodProtectorUseItemInterval = 4 Credits: one guy from L2JForum, and ŚyśţęmƒяәдҚς for some modifications, nothing special, just removal effect.
  21. Seems really cool. Thanks for sharing it with MxC Members. MATIM.
  22. Oh my god, oh my god. This fucking awesome. Hope it will be ready soon. Yeah >!
  23. Merry Christmas, Sofaki. Thanks for Sharing it with us.. Love Love :P
  24. You already shared this thing: http://www.maxcheaters.com/forum/index.php?topic=110390.0 Someone junk it.
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..