Jump to content

Search the Community

Showing results for tags 'code'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Lineage II Server Packs [Java]
  • Lineage II Server Packs [PTS]
  • Lineage II Server Scripts
  • Lineage II Client Scripts
  • Lineage II Items & Chars
  • Website Templates
  • DenArt Designs's Demo Updater


  • General Zone
    • Announcements and News
    • Newbies Introduce Urself
    • Maxcheaters Competitions & Events
    • Votes/Polls Area
    • Report Section
    • Downloads Section
  • Lineage II General Section
    • General Discussion [English]
    • Request Support [English]
  • Lineage II Hacks,Cheats and Bots
    • Hacks & Cheats [English]
    • Request Hacks & Cheats [English]
    • Botting [English]
    • Request Botting [English]
  • Lineage II Private Servers
    • Buy Advertising Link #1
    • Private Servers
    • Buy Advertising Link #2
    • [Previews] L2 Private Servers
    • Clans and Alliances
  • Lineage II Marketplace
    • Marketplace [Items & Chars]
    • Marketplace [L2Packs & Files]
    • Marketplace [Powerlvl & Support]
  • Lineage II OFF Server Development
    • Server Development Discussion [L2OFF]
    • Request Server Development Help [L2OFF]
    • Server Shares & Files [L2OFF]
  • Lineage II Java Server Development
    • Server Development Discussion [L2J]
    • Request Server Development Help [L2J]
    • Server Shares & Files [L2J]
    • Private Projects [L2J]
  • Lineage II Client Development
    • Client Development Discussion
  • MMO Games
    • League of Legends
    • World Of Warcraft Area
    • Other Multiplayer Games
  • General Section
  • Graphics/GFX Zone
  • VIP/SVIP/Donators Zone
  • MaxCheaters Corner
  • TEST's Topics
  • L2Classic Club's Just trying this thing out
  • Lineage 2 Revolution Club's Discussions
  • Lineage 2 Revolution Club's Tutorials
  • Lineage 2 Revolution Club's Request Help
  • DenArt Designs's Hello and welcome to my club!
  • DenArt Designs's News
  • `Kara for staff's Topics
  • `Kara for staff's Kara`

Product Groups

  • Advertisements
  • Special Groups

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 21 results

  1. ### Eclipse Workspace Patch 1.0 #P L2J_DataPack Index: dist/game/data/scripts/custom/QuizEvent/QuizEvent.java =================================================================== --- dist/game/data/scripts/custom/QuizEvent/QuizEvent.java (revision 0) +++ dist/game/data/scripts/custom/QuizEvent/QuizEvent.java (working copy) package custom.QuizEvent; import java.io.File; import java.util.HashMap; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.util.Broadcast; import com.l2jserver.util.Rnd; /** * * @author Bellatrix * */ public class QuizEvent { public static boolean _quizRunning; private static String _question; private static String _answer1; private static String _answer2; private static String _answer3; private static int _rightanswer; private static Map<L2PcInstance,Integer> _players; private static int status; private static int announced; private static ThreadPoolManager tpm; private static AutoEventTask task; private static String[][] _questions; private static int i = 0; private static final int STATUS_NOT_IN_PROGRESS = 0; private static final int STATUS_ASK = 1; private static final int STATUS_ANSWER = 2; private static final int STATUS_END = 3; //---------------------------------------------------------------------------- //------------------------------ CONFIG -------------------------------------- //---------------------------------------------------------------------------- //Number of questions per event private static int _questionNumber = 3; //The Item ID of the reward private static int _rewardID = 57; //The ammount of the reward private static int _rewardCount = 1000; //Wait for the first event after the server start (in seconds) private static int _initWait = 3600; //Time for answer the question (in seconds) private static int _answerTime = 60; //Time between two event (in seconds) private static int _betweenTime = 18000; public QuizEvent() { tpm = ThreadPoolManager.getInstance(); status = STATUS_NOT_IN_PROGRESS; task = new AutoEventTask(); announced = 0; _quizRunning = false; _question = ""; _answer1 = ""; _answer2 = ""; _answer3 = ""; _rightanswer = 0; _players = new HashMap<>(100); _questions = new String[20][]; includeQuestions(); tpm.scheduleGeneral(task, _initWait*1000); } private void includeQuestions() { File questionFile = new File(Config.DATAPACK_ROOT, "data/scripts/custom/QuizEvent/QuizEvent.xml"); Document doc = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setIgnoringComments(true); dbf.setValidating(false); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(questionFile); for (Node root = doc.getFirstChild(); root != null; root = root.getNextSibling()) { if ("list".equalsIgnoreCase(root.getNodeName())) { for (Node child = root.getFirstChild(); child != null; child = child.getNextSibling()) { if ("question".equalsIgnoreCase(child.getNodeName())) { int id, correct; String ask, answer1, answer2, answer3; NamedNodeMap attrs = child.getAttributes(); id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue()); correct = Integer.parseInt(attrs.getNamedItem("correct").getNodeValue()); ask = attrs.getNamedItem("ask").getNodeValue(); answer1 = attrs.getNamedItem("answer1").getNodeValue(); answer2 = attrs.getNamedItem("answer2").getNodeValue(); answer3 = attrs.getNamedItem("answer3").getNodeValue(); _questions[id] = new String[]{ ask, answer1, answer2, answer3, ""+correct }; i++; } } } } } catch (Exception e) { } } private class AutoEventTask implements Runnable { @Override public void run() { switch (status) { case STATUS_NOT_IN_PROGRESS: announceStart(); break; case STATUS_ASK: if (announced < _questionNumber) { announceQuestion(); } else { status = STATUS_END; tpm.scheduleGeneral(task, 3000); } break; case STATUS_ANSWER: announceCorrect(); break; case STATUS_END: endEvent(); break; default: break; } } } //Get a random question from the quiz_event table private static void selectQuestion() { int id = Rnd.get(i)+1; _question = _questions[id][0]; _answer1 = _questions[id][1]; _answer2 = _questions[id][2]; _answer3 = _questions[id][3]; _rightanswer = Integer.parseInt(""+_questions[id][4]); } //Announce the question private static void announceQuestion() { selectQuestion(); Broadcast.toAllOnlinePlayers("-----------------"); Broadcast.toAllOnlinePlayers("Question: "+_question); Broadcast.toAllOnlinePlayers("-----------------"); Broadcast.toAllOnlinePlayers("1: "+_answer1); Broadcast.toAllOnlinePlayers("2: "+_answer2); Broadcast.toAllOnlinePlayers("3: "+_answer3); Broadcast.toAllOnlinePlayers("-----------------"); status = STATUS_ANSWER; tpm.scheduleGeneral(task, _answerTime*1000); } //Announce the correct answer private static void announceCorrect() { Broadcast.toAllOnlinePlayers("-----------------"); Broadcast.toAllOnlinePlayers("The correct answer was: "+_rightanswer); Broadcast.toAllOnlinePlayers("-----------------"); announced++; giveReward(); status = STATUS_ASK; tpm.scheduleGeneral(task, 5000); } private static void announceStart() { _quizRunning = true; _players.clear(); Broadcast.toAllOnlinePlayers("Quiz Event begins! "+_questionNumber+" questions. "+_answerTime+" secs for answer each. "); Broadcast.toAllOnlinePlayers("Type . and the number of the correct answer to the chat. (Like: .1)"); Broadcast.toAllOnlinePlayers("Get Ready!"); status = STATUS_ASK; tpm.scheduleGeneral(task, 5000); } //Add a player and its answer public static void setAnswer(L2PcInstance player, int answer) { if( _players.containsKey(player) ) player.sendMessage("You already choosen an aswer!: "+_players.get(player)); else _players.put(player, answer); } private static void endEvent() { _quizRunning = false; Broadcast.toAllOnlinePlayers("The Quiz Event is over!"); announced = 0; status = STATUS_NOT_IN_PROGRESS; tpm.scheduleGeneral(task, _betweenTime*1000); } private static void giveReward() { for( L2PcInstance p: _players.keySet()) { if(_players.get(p) == _rightanswer) { p.sendMessage("Your answer was correct!"); p.addItem("Quiz", _rewardID, _rewardCount, p, true); } else { p.sendMessage("Your answer was not correct!"); } } _players.clear(); } } \ No newline at end of file Index: dist/game/data/scripts/Custom/QuizEvent/QuizEvent.xml =================================================================== --- dist/game/data/scripts/custom/QuizEvent/QuizEvent.xml (revision 8768) +++ dist/game/data/scripts/custom/QuizEvent/QuizEvent.xml (working copy) <?xml version="1.0" encoding="UTF-8"?> <list> <question id = "1" ask = "Quel type Bijoux Drop Baium" answer1 = "Necklace" answer2 = "Ring" answer3 = "Earring" correct = "2" /> <question id = "2" ask = "Comment s'appel l'admin" answer1 = "Bellatrix" answer2 = "Roberta" answer3 = "Jo" correct = "1" /> <question id = "3" ask = "Quel Recompense donne le tvt" answer1 = "Codex" answer2 = "Coin" answer3 = "EventCoin" correct = "3" /> </list> Index: dist/game/data/scripts/handlers/voicedcommandhandlers/Quiz.java =================================================================== --- dist/game/data/scripts/handlers/voicedcommandhandlers/Quiz.java (revision 0) +++ dist/game/data/scripts/handlers/voicedcommandhandlers/Quiz.java (working copy) package handlers.voicedcommandhandlers; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import custom.QuizEvent.QuizEvent; /** * @author Bellatrix */ public class Quiz implements IVoicedCommandHandler { private static final String[] _voicedCommands = { "quiz", "1", "2", "3" }; /** * @see Bellatrix */ @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) { if (command.equalsIgnoreCase("1") && QuizEvent._quizRunning) { QuizEvent.setAnswer(activeChar, 1); } if (command.equalsIgnoreCase("2") && QuizEvent._quizRunning) { QuizEvent.setAnswer(activeChar, 2); } if (command.equalsIgnoreCase("3") && QuizEvent._quizRunning) { QuizEvent.setAnswer(activeChar, 3); } return true; } /** * @see Bellatrix */ @Override public String[] getVoicedCommandList() { new QuizEvent(); return _voicedCommands; } } Index: dist/game/data/scripts/handlers/MasterHandlers.java =================================================================== --- dist/game/data/scripts/handlers/MasterHandlerjava (revision 0) +++ dist/game/data/scripts/handlers/Masterhandlers.java (working copy) import handlers.voicedcommandhandlers.Quiz; private static final Class<?>[] VOICED_COMMAND_HANDLERS = { StatsVCmd.class, // TODO: Add configuration options for this voiced commands: // CastleVCmd.class, // SetVCmd.class, (Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null), (Config.BANKING_SYSTEM_ENABLED ? Banking.class : null), (Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null), (Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null), (Config.L2JMOD_ENABLE_ONLINE_STATUS ? OnlineStatus.class : null), (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null), (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null), Quiz.class,
  2. ### Eclipse Workspace Patch 1.0 #P L2J_Server Index: Dist/game/data/handlers\voicedcommandhandler\PvP.java =================================================================== --- Dist/game/data/handlers\voicedcommandhandler\PvP.java (revision 0) +++ Dist/game/data/handlers\voicedcommandhandler\PvP.java (working copy) @@ -0,0 +1,48 @@ +/* +*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 2, 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, write to the Free Software +*Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +*02111-1307, USA. +* +*http://www.gnu.org/copyleft/gpl.html +*/ +package handlers.voicedcommandhandlers; + +import org.l2jdevs.gameserver.handler.IVoicedCommandHandler; +import org.l2jdevs.gameserver.model.actor.instance.L2PcInstance; + +/** +* PvP info +* @author Zestu, +*/ +public class PvP implements IVoicedCommandHandler { +private static final String[] VOICED_COMMANDS = { + "pvp" + }; + + @Override + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) { + if (command.equalsIgnoreCase("pvp")) { + if (activeChar.getTarget() == null) { + activeChar.sendMessage("You have no one targeted."); + return false; + } + if (!(activeChar.getTarget() instanceof L2PcInstance)) { + activeChar.sendMessage("You can only get the info of a player."); + + return false; + } + + L2PcInstance targetp = (L2PcInstance) activeChar.getTarget(); + + activeChar.sendMessage("=========<NameServer>========="); + activeChar.sendMessage("" + targetp.getName() + ""); + activeChar.sendMessage("PvP Kills: " + targetp.getPvpKills()); + activeChar.sendMessage("PvP Flags: " + targetp.getPvpFlag()); + activeChar.sendMessage("PK Kills: " + targetp.getPkKills()); + activeChar.sendMessage("=========<>========="); + + } + return true; + } + + @Override + public String[] getVoicedCommandList() { + return VOICED_COMMANDS; + } + } \ No newline at end of file Index: Dist/game/data/handlers\MasterHandler.java =================================================================== --- Dist/game/data/handlers\MasterHandler.java (revision 0) +++ Dist/game/data/handlers\MasterHandler.java (working copy) @@ -65,6 +65,7 @@ +import handlers.voicedcommandhandlers.PvP; private static final Class<?>[] VOICED_COMMAND_HANDLERS = { StatsVCmd.class, // TODO: Add configuration options for this voiced commands: // CastleVCmd.class, // SetVCmd.class, (Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null), (Config.BANKING_SYSTEM_ENABLED ? Banking.class : null), (Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null), (Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null), (Config.L2JMOD_ENABLE_ONLINE_STATUS ? OnlineStatus.class : null), (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null), (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null), + PvP.class,
  3. As the title say i will share with you one password manager for Acis 370. Credits: Sweets( Ive just made the imports right and the necessary changes in case that someone didnt know and have problem). Go to : net.sf.l2j.gameserver.model.actor.instance and create a new class with name: L2PasswordInstance /* * 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.model.actor.instance; import java.security.MessageDigest; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Base64; import java.util.StringTokenizer; import net.sf.l2j.commons.concurrent.ThreadPool; import net.sf.l2j.L2DatabaseFactory; import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; /** * @author SweeTs */ public class L2PasswordInstance extends Folk { public L2PasswordInstance(int objectId, NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(Player player, String command) { if (command.startsWith("change_password")) { StringTokenizer st = new StringTokenizer(command); st.nextToken(); String newPass = ""; String repeatNewPass = ""; try { if (st.hasMoreTokens()) { newPass = st.nextToken(); repeatNewPass = st.nextToken(); } } catch (Exception e) { player.sendMessage("Please fill all the blanks before requesting for a password change."); return; } if (!conditions(newPass, repeatNewPass, player)) return; changePassword(newPass, repeatNewPass, player); } } private static boolean conditions(String newPass, String repeatNewPass, Player player) { if (newPass.length() < 3) { player.sendMessage("The new password is too short!"); return false; } else if (newPass.length() > 45) { player.sendMessage("The new password is too long!"); return false; } else if (!newPass.equals(repeatNewPass)) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PASSWORD_ENTERED_INCORRECT2)); return false; } return true; } @Override public void showChatWindow(Player activeChar) { final NpcHtmlMessage html = new NpcHtmlMessage(0); final StringBuilder sb = new StringBuilder(); sb.append("<html><title>Account Manager</title>"); sb.append("<body><center>"); sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"); sb.append("New password: <edit var=\"new\" width=100 height=15><br>"); sb.append("Repeat: <edit var=\"repeatnew\" width=100 height=15><br>"); sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>"); sb.append("<a action=\"bypass -h npc_%objectId%_change_password $new $repeatnew\">Change password</a>"); sb.append("</center></body></html>"); html.setHtml(sb.toString()); html.replace("%objectId%", getObjectId()); activeChar.sendPacket(html); } private static void changePassword(String newPass, String repeatNewPass, Player activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?")) { byte[] newPassword = MessageDigest.getInstance("SHA").digest(newPass.getBytes("UTF-8")); ps.setString(1, Base64.getEncoder().encodeToString(newPassword)); ps.setString(2, activeChar.getAccountName()); ps.executeUpdate(); activeChar.sendMessage("Congratulations! Your password has been changed. You will now be disconnected for security reasons. Please login again."); ThreadPool.schedule(() -> activeChar.logout(false), 3000); } catch (Exception e) { _log.warning("There was an error while updating account:" + e); } } } After you are passing this the only thing that you have to do is create a new npc with type: L2Password. HAVE A NICE DAY GUYS :)
  4. This little code will shows the real diff range of async between server and client position. By default, this code was maked for aCis but can be use for any L2J forks. ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java (revision 1133) +++ java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java (working copy) @@ -2,6 +2,8 @@ import java.nio.BufferUnderflowException; +import net.sf.l2j.commons.math.MathUtil; + import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.actor.ai.CtrlIntention; import net.sf.l2j.gameserver.model.actor.instance.Player; @@ -95,6 +97,18 @@ activeChar.sendPacket(ActionFailed.STATIC_PACKET); return; } + + // Check async range. + dx = _originX - activeChar.getX(); + dy = _originY - activeChar.getY(); + double dz1 = _originZ - activeChar.getZ(); + float diff = (float) Math.sqrt(dx * dx + dy * dy + dz1 * dz1); + int heading = MathUtil.calculateHeadingFrom(_originX, _originY, activeChar.getX(), activeChar.getY()); + if (Math.abs(activeChar.getHeading() - heading) > 16000) + diff = diff * -1; + + activeChar.sendMessage("Async distance: " + diff); + activeChar.getAI().setIntention(CtrlIntention.MOVE_TO, new Location(_targetX, _targetY, _targetZ)); } } \ No newline at end of file Index: java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java (revision 1133) +++ java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java (working copy) @@ -1,5 +1,7 @@ package net.sf.l2j.gameserver.network.clientpackets; +import net.sf.l2j.commons.math.MathUtil; + import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.model.zone.ZoneId; import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle; @@ -88,5 +90,17 @@ player.setClientY(_y); player.setClientZ(_z); player.setClientHeading(_heading); // No real need to validate heading. + + // Check async range. + dx = _x - player.getX(); + dy = _y - player.getY(); + dz = _z - player.getZ(); + float diff = (float) Math.sqrt(dx * dx + dy * dy + dz * dz); + + int heading = MathUtil.calculateHeadingFrom(_x, _y, player.getX(), player.getY()); + if (Math.abs(player.getHeading() - heading) > 16000) + diff = diff * -1; + + player.sendMessage("[4] Async distance: " + diff); } } \ No newline at end of file Have fun, so!
  5. Hey, correct me if i am wrong, but what i have noticed that 99% interlude packs still have this bug. I saw this in Acis, Frozen, Mobius and actually in all older packs. DIFF: Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (revision 5) +++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (working copy) @@ -34,7 +34,7 @@ writeD(_activeChar.getX()); writeD(_activeChar.getY()); writeD(_activeChar.getZ()); - writeD(_activeChar.getHeading()); + writeD(0); writeD(_activeChar.getObjectId()); writeS(_activeChar.getName()); writeD(_activeChar.getRace().ordinal()); @@ -180,7 +180,7 @@ writeD(_activeChar.getAppearance().getNameColor()); - writeD(0x00); // isRunning() as in UserInfo? + writeD(_activeChar.getHeading()); writeD(_activeChar.getPledgeClass()); writeD(_activeChar.getPledgeType());
  6. Short version : upon L2PHX (or any packet manipulation tool) use, the manual or automatic send of EnterWorld packet creates issues (for example, if the config spawn protection is activated, it sends anew the spawn protection, making you immune everytime you send back the packet). Simply select EnterWorld packet from "Packet Sniffer" tab, "Add packet to send..." and check "send every 100 ms". Issue : packet manipulation spam, calling multiple times the same subroutines (spawn protection custom and whatever custom you added in EnterWorld). Potentially fix other exploits based on your spawnMe() content. Fix : generate a new GameClientState (personally called ENTERING), isolate EnterWorld on it (RequestManorList being called automatically, it must be part of ENTERING too). Any subsequent calls of EnterWorld will call onUnknownPacket, because it will be considered out of ENTERING scope, since we're already at IN_GAME scope once the Player instance is fully loaded (such stuff already exists for all packets : login packets can't be called during ingame state, etc. It's just than EnterWorld is a transition packet between lobby and ingame, but it is considered an ingame packet while it shouldn't). Since chronicle got different opcodes, you have to adapt using your own chronicle opcodes. I can't and won't deliver a unique version for all chronicles. Since I'm an IL guy, I share for IL. The diff patch can help you to guess what to edit. Possible improvements : If you know more packets which should be sent only during that translation time between AUTHED and IN_GAME, you can answer here (notably for higher chronicles than IL) with your own version for your own chronicle. I will refresh the initial topic with the different versions. Not sure if RequestManorList can be called anywhere else (manor panel, etc). I preferred to keep it on IN_GAME. If you know the answer, consider to reply :) ! aCis version, based on latest (GameClient is generally called L2GameClient) : ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (revision 1146) +++ java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (working copy) @@ -62,7 +62,7 @@ sendPacket(SSQInfo.sendSky()); - client.setState(GameClientState.IN_GAME); + client.setState(GameClientState.ENTERING); sendPacket(new CharSelected(cha, client.getSessionId().playOkID1)); } Index: java/net/sf/l2j/gameserver/network/GameClient.java =================================================================== --- java/net/sf/l2j/gameserver/network/GameClient.java (revision 1157) +++ java/net/sf/l2j/gameserver/network/GameClient.java (working copy) @@ -64,6 +64,7 @@ { CONNECTED, // client has just connected AUTHED, // client has authed but doesnt has character attached to it yet + ENTERING, // client is currently loading his Player instance, but didn't end IN_GAME // client has selected a char and is in game } @@ -168,6 +168,7 @@ case AUTHED: return "[Account: " + getAccountName() + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]"; + case ENTERING: case IN_GAME: return "[Character: " + (getPlayer() == null ? "disconnected" : getPlayer().getName()) + " - Account: " + getAccountName() + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]"; Index: java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java =================================================================== --- java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (revision 1145) +++ java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (working copy) @@ -51,6 +51,7 @@ break; } break; + case AUTHED: switch (opcode) { @@ -80,6 +81,43 @@ break; } break; + + case ENTERING: + switch (opcode) + { + case 0x03: + msg = new EnterWorld(); + break; + + case 0xd0: + int id2 = -1; + if (buf.remaining() >= 2) + { + id2 = buf.getShort() & 0xffff; + } + else + { + _log.warning("Client: " + client.toString() + " sent a 0xd0 without the second opcode."); + break; + } + + switch (id2) + { + case 8: + msg = new RequestManorList(); + break; + default: + printDebugDoubleOpcode(opcode, id2, buf, state, client); + break; + } + break; + + default: + printDebug(opcode, buf, state, client); + break; + } + break; + case IN_GAME: switch (opcode) { @@ -89,9 +127,6 @@ // case 0x02: // // Say ... not used any more ?? // break; - case 0x03: - msg = new EnterWorld(); - break; case 0x04: msg = new Action(); break; Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 1150) +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -35,6 +35,7 @@ import net.sf.l2j.gameserver.model.pledge.SubPledge; import net.sf.l2j.gameserver.model.zone.ZoneId; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.GameClient.GameClientState; import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.Die; import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate; @@ -77,6 +78,8 @@ return; } + getClient().setState(GameClientState.IN_GAME); + final int objectId = player.getObjectId(); if (player.isGM())
  7. https://www.youtube.com/watch?v=wvwudQvQwIE The video was produced using my pack (or so state the server owner/developer), but L2J got the same issue. All non-customized L2J versions using WeaponEquipTask got this issue. Even if you patched other places to avoid to get multiple similar items with same objectId, this is the initial problem and the only fix you should apply. For the goodness of L2J, I decided to post this fix for free. Short version : Upon UseItem use, and if you're currently attacking, WeaponEquipTask is called to delay the time your weapon is wear. Issue : There is no check upon task call. The item is equipped, no matter what happened between the call time, and the wear time (if you deleted, crystallized, dropped, put item elsewhere,...). Fix : check upon task call if the item is still existing on inventory. For L2J (consider to edit the called method - remove item parameter). /** Weapon Equip Task */ private static class WeaponEquipTask implements Runnable { private final L2PcInstance activeChar; protected WeaponEquipTask(L2PcInstance character) { activeChar = character; } @Override public void run() { // Check if the item is still on inventory. final ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId); if (item == null) return; // Equip or unEquip activeChar.useEquippableItem(item, false); } } If you use aCis, here's the modified task found on UseItem (will be part of rev 380) : if (activeChar.isAttackingNow()) ThreadPool.schedule(() -> { final ItemInstance itemToTest = activeChar.getInventory().getItemByObjectId(_objectId); if(itemToTest == null) return; activeChar.useEquippableItem(itemToTest, false); }, activeChar.getAttackEndTime() - System.currentTimeMillis()); else activeChar.useEquippableItem(item, true); Good luck everyone !
  8. Hello guys, nothing special, just a guy ask me for that and maybe more peoples looking for it. You select enchant aura for all weapons on character selection. Diff Created on aCis 378: Index: config/server.properties =================================================================== --- config/server.properties (revision 9) +++ config/server.properties (working copy) @@ -59,6 +59,10 @@ # Clients related options # ================================================================ +# Visual Enchant for weapons on character selection +# Disable : 0 +VisualEnchant = 16 + # Allow delete chars after D days, 0 = feature disabled. DeleteCharAfterDays = 7 Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 9) +++ java/net/sf/l2j/Config.java (working copy) @@ -497,6 +497,7 @@ public static boolean SERVER_GMONLY; /** clients related */ + public static int VISUAL_ENCHANT; public static int DELETE_DAYS; public static int MAXIMUM_ONLINE_USERS; @@ -1210,6 +1211,7 @@ SERVER_LIST_TESTSERVER = server.getProperty("TestServer", false); SERVER_LIST_PVPSERVER = server.getProperty("PvpServer", true); + VISUAL_ENCHANT = server.getProperty("VisualEnchant", 0); DELETE_DAYS = server.getProperty("DeleteCharAfterDays", 7); MAXIMUM_ONLINE_USERS = server.getProperty("MaximumOnlineUsers", 100); Index: java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java (revision 9) +++ java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java (working copy) @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.List; +import net.sf.l2j.Config; import net.sf.l2j.L2DatabaseFactory; import net.sf.l2j.gameserver.data.sql.ClanTable; import net.sf.l2j.gameserver.model.CharSelectSlot; @@ -149,7 +150,7 @@ writeD((slot.getAccessLevel() > -1) ? ((slot.getDeleteTimer() > 0) ? (int) ((slot.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0) : -1); writeD(slot.getClassId()); writeD((i == _activeId) ? 0x01 : 0x00); - writeC(Math.min(127, slot.getEnchantEffect())); + writeC(Config.VISUAL_ENCHANT > 0 ? Config.VISUAL_ENCHANT : Math.min(127, slot.getEnchantEffect())); writeD(slot.getAugmentationId()); } getClient().setCharSelectSlot(_slots);
  9. Deleted all my shares a while ago but wanted to leave this one here because there are people selling this stupidly simple code. It's command based individual vote reward for Hopzone, Topzone and Network. Commands are .votehope, .votetop and .votenet. It is secured on both the account level and the IP level so it's as protected as it gets without adding HWID. It can be easily converted to a NPC based one. Code: https://gist.github.com/Elfocrash/a5ba37666dd9c4d3f9a9ec022301930c Link for gson 2.6.2 https://repo1.maven.org/maven2/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar
  10. Hello forum, i was searching around and i saw on many forum's peoples selling this code for gold. (30-40 euro) rolf... That's who we are, sad... So this is one "Gift" from me for the new year. On this code you have the listed options: You can add as many zones you want. You can setup for each zone the running time. (On the current diff i have make Giran Arena and Gludin Arena). Gatekeeper command : <a action="bypass -h npc_%objectId%_pvp">Random Zone</a> The codes required more then 1 zone. Ofc you can add your own configs like "Auto Flag" "Auto Nobles" and whatever you want.. take this share like platform and work on it. DIFF is coded on aCis 381 revision - Feel free to adapt it in whatever revision or project you need. Credits : StinkyMadness Code r381: Here
  11. I saw a guy trying to sell this code for 20E.... I thing you get what it is right? You have a chance to craft items with enchant. the only thing you have to do is to add 2 values in recipes.xml. example: <recipe alias="mk_leather_boots" id="69" material="1931-4;1882-8;1885-1;2130-1" product="40-1" itemId="2176" level="2" mpConsume="84" successRate="100" isDwarven="true"/> You can add enchant by adding enchantChance="70" enchant="4-19" (means you have 70% chance to get a random value from 4 - 19 as enchant) in case you want a constant value you can put it like "10-10" <recipe alias="mk_leather_boots" id="69" material="1931-4;1882-8;1885-1;2130-1" enchantChance="70" enchant="4-19" product="40-1" itemId="2176" level="2" mpConsume="84" successRate="100" isDwarven="true"/> rev 375 here is the code: [Hidden Content]
  12. Hello there.. Here is my Epic Boss Manager from my old server. Nothing special, but some of you may need it. What's inside? Works only with retail Grandbosses. [No retail zaken id] Inform you about the status of Grandboss. Inform you about respawn time. Date/Time. Enable/Disable it on configs. # Announce Grandboss status. # Ex: If status for Antharas/Valakas/Frintezza change to 2 player get announce: # Grandboss>name is engaged in battle. # If status changed to 3: Grandbossname has been killed. Type .epic for details! # For Baium if status change to 1 - Baium is awake and fighting. # All Grandboses respawned - Grandbossname is spawned in the world! AnnounceGrandBossStatus = True [Hidden Content]
  13. Hello there.. Here is my buffer from my old server.. (Main html made by prwtoftw) What's inside? Mage | Fighter set [config] Buffs/Dance/Song/Extra etc one by one Special buffs + Malaria Vote buff [If you want it, you can enable it, config] Scheme Buffer Code Preview > [Hidden Content] Code/HTML/XML > [Hidden Content]
  14. Hello guys, Before 4-5 months i created a script for a new raid in order to avoid all classic raids that are really boring... It isn't something special, but i always like different and unusual things... Plagueseeker Raid Starting with some special cameras while all players are paralyzed. When the broadcast end, the following features stands there: action task every 2 seconds: There is 20% chance to 'debuff' a random player if is healer class Debuffs: 20% chance for 15% chance for 10% chance for 50% chance for There is 5% chance to 1) Spawn some minions when the hp of the raid is lower than 40% in order to protect the raid boss (can be happened unlimited times with chance 5%). Minions will suicide after 10 seconds after the spawn time if not get killed. 2) Pick a random target and kill him instant. When the hp of the raid is lower than 50% Broadcast again some special cameras (while players are paralyzed again), an earthquake for 5 seconds and instant kill 10 random players around the raid in 700 radius (can be happened only 1 time). inactivity task If the raid boss not attacked for more than 15 minutes, all players are going back and raid will be deleted. * All the above features are meant to be used in a boss zone ( i used 150000 as a custom one in my pack). Any feature wont work outside of the zone, I wont share any thing like that since its just c/p. * Its your responsibility to use the necessary checks in order to avoid bugs like move the raid out of zone. I coded for me at coliseum with doors closed. Also you have to set by urself how the raid will be spawned (i was about to code the spawn thing but i dont remember why i didnt). I used //spawn just for the video . Code: [Hidden Content] Coded (if i remember well) in acis 370. Note: If you want to expand it or understand how a script can be coded, check this topic (if any other post is related to scripts and have informations post it)
  15. Hello if you need any code/help about your server you can request here.
  16. Kalhspera. edw pera ine 1 donate manager. apo ton l2sayn to exw vgalei kai to dinw se esas. parakalw mhn krazete. :D Code: http://pastebin.com/tuWcQAXQ EDIT: 3exasa na valw to name sto Instance. valte L2DonateShopInstance (ADAPTED FOR L2JACIS http://pastebin.com/6d9P4wm1 ) by member l2jkain SCREENSHOTS Download: Gia na doulepsi to code prepei na valete auta ta arxia. Click Me Diavaste to ReadMe.txt To sql uparxi sto arxio. To Donate Coin exei id 1704 Ean vgalei kapoio provlima kalo einai na kanete 1 post se auto to topic gia na to checkarw. :) Doulevei sto l2jfrozen last rev. twra gia prohgoumena den 3erw. :D UPDATED** //augment command http://www.maxcheaters.com/topic/207755-l2jfrozen-augment-command/ CREDITS: fofas
  17. Hello guys! I use this TvT Event and I have add/fix/remove some things. If you have already this event you will understand what I mean. Removed useless lines/methods. Isn't something special but I wanted to share with you. Mana potions/Escape scrolls,skills fixed. Problems with NPC respawn/spawn. Added Respawn delay on die, Noblesse on die, Do not lose buffs (with config), Reward after 5/8/12/15/20 kills without die & announce the name of player with the count of kills without die. (if you die, kills goes 0 again). You can find the option of the kills count on TvTEvent.java [Watch the lines]. Players can't be healed on event (with config). .tvtjoin / .tvtleave / .tvtstatus Config/Npc [http://pastebin.com/xUd4bJhN] Core [http://pastebin.com/vkGuh57i] Core FOR 360+ rev [http://pastebin.com/ZF85SVBk] Systextures-html [https://dir50.com/6kww37s9u3dy/Systextures-html.rar.html] LINK 2 [if you find problem]
  18. So i coded this like 2 years ago or something and people try to pull of stuff like claiming they had the ideas and shit. And the code: http://pastebin.com/DPWMYwuy Enjoy I know its shit coded but i don't have time to recode it.
  19. Well i found this event shared in acis forum long ago and i saw that someone is selling it for 15 euros and i just giggled. Here is the code reworked for aCis bugless and clean. Code: http://pastebin.com/zyBhenYm
  20. Hello, i was searching for this command but i didnt found it in our forum so i decided to share it, below you can preview the html's How to install it? EASY: 1. GameServer\data\html\mods (add here the repair FOLDER not only the files) 2. GameServer\data\scripts\handlers\voicedcommandhandlers (only the file Repair.java) (dont forget to edit your masterhandler.java script) [Hidden Content] Credits: Szponiasty
  21. Well, one friend asked to me to help him coding a simple "pvp zone" and then asked to me to add an item checker... etc So I coded a "MultiFunction", "AIO"... whatever... zone. Easy to modify, with configs... and I wanted to share it with you. Simply if you don't like it or you don't like me, don't spam here. We know that some of this features could be already shared over the net... blabla... But here are all together, are configurable and I think that it's 90% without bugs. Note: Default zone: Crystal Caverns Quickly enumeration of which configs it has: -Enable/Disable pvp flag on enter -Enable/Disable revive delay & set the time -Specify (unlimited) random respawns if revive enabled -Specify random respawn radius -Enable/Disable noblesse blessing on enter -Enable/Disable remove buffs on enter -Enable/Disable remove pets on enter -Specify special reward when hunting inside -Specify items that will be unequiped & blocked to use inside the zone -Specify items by grades that will be unequiped & blocked to use inside the zone -Specify an enchant level. Items with that level or more, will be unequiped & blocked to use inside the zone -Specify classes id's that won't be able to enter to this zone V.1.3 - 14/02/2013 Coded for l2jserver Freya. - Wyatt L2jServer Freya patch Addapted to l2jfrozen Interlude. - Wyatt L2jFrozen Interlude patch. Addapted to l2jserver H5 Beta, rev core:5639 datapack:9185. - Valanths L2jServer H5 Beta patch Addapted to l2jserver H5 Beta, rev core:6165 datapack:9909. - Valanths L2jServer H5 Beta patch Addapted to Acis, Changeset 309. - Tяαnce Acis patch Addapted to Acis, rev:299. - Dεbian Acis patch Credits: Wyatt