Search the Community

Showing results for tags 'java'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Lineage II Development [L2J]
    • Sources
    • Addons & Mods
    • Tools
  • Lineage II Development [L2OFF]
    • Package Files
    • Mods & Extenders
    • Tools
  • Lineage II Client Development
    • Equipments
    • Npcs
    • Maps
    • Tools
    • Skills
  • Lineage II Bots & Tools
    • Bot Systems
    • Bot Scripts
    • Tools
  • 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
    • Suggestions/Feedback Board
  • 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
    • "BЯATVA" High Five x15 - Opening 30th of October
    • Private Servers
    • L2Elixir Interlude x3 - Launching 31st October
    • [Previews] L2 Private Servers
    • Clans and Alliances
  • Lineage II Verified Marketplace
    • Marketplace [Items & Chars]
    • Marketplace [L2Packs & Files]
    • Marketplace [Powerlvl & Support]
  • 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
  • FiveM Zone
    • FiveM Guides
    • FiveM Development Help
  • MMO Games
    • Fortnite
    • PlayerUnknown's Battlegrounds PUBG
    • League of Legends
    • World Of Warcraft Area
    • Other Multiplayer Games
  • General Section
  • Graphics/GFX Zone
  • VIP/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 93 results

  1. Hello there, Im trying to waste my time on some specific ways like creating my own server. Since i've done most of the job one thing makes me sleep worse everyday. WARN ItemParser: Fail create item: 38040 java.lang.IllegalArgumentException: No enum constant l2f.gameserver.templates.item.EtcItemTemplate.EtcItemType.NONE at java.lang.Enum.valueOf(Unknown Source) at l2f.commons.collections.MultiValueSet.getEnum( at l2f.gameserver.templates.item.EtcItemTemplate.<init>( at at at at at at at l2f.gameserver.GameServer.<init>( at l2f.gameserver.GameServer.main( I've got an Error like this. Just to be clear Item with ID 38040 has been added into XML files as an EtcItem, into etcitemgrp in system and also into Database. Should i implement this in any other file?
  2. Forum: Project: Chat: Wiki:
  3. Καλησπερα στην παρεα, Γνωριζουμε κατι για αυτο νμζ οτι ειναι απο το patch system σε windows 10. Τι φαση με τα πακετα;
  4. [updated 17.10.2017]: Service is stopped. Available only selling existing addons. Working with own projects. IMPORTANT! Please don't adding yourself into my contact list for nothing. I will moving you from my contacts to blacklist. If you not need my services, skip/ignore me. I'm not a free helper and i'm not give the free consultations (exept my regular clients). Start to respect a time of other people. Thanks. My free/paid/demo works: See my personal blog; See my YouTube channel. Regards.
  5. Hello guys i need help i trying to add on my server a Achievement system but when i press Show my achievements or Statitics i got a error about Bypass. For more infos pleasse ask me SEVERE 67 Client: [Character: Test - Account: test - IP:] - Failed running: [C] 21 RequestBypassToServer
  6. simplest custom buffer - easy in use, intuitive window. magical support has been divided onto five independent groups where users can buffup themselves manually or automatically via two pre-definied sets (mage, fighter). also there's an additional option to bestow heroic valor effect in exchange for any item (in this case: gold bar). i recommend to combine this feature with vote reward system :) preview: create new instance: java/gameserver/model/actor/instance/ /* * 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. * * */ package; import java.util.StringTokenizer; import net.sf.l2j.commons.random.Rnd; import; import net.sf.l2j.gameserver.datatables.SkillTable; import; import; import; import; import; import; import; /** * * @author Caparso */ public final class L2BufferInstance extends L2NpcInstance { int fighterbuffs [] = {1397,1087,1044,1243,1304,1259,1204,1068,1388,1040,1036,1035,1048,1045,1077,1242,1086,1043,1240,1268,1032,1033,1191,1189,1182,1354,1353,1352,1392,1393,4699,4700,1416,1363,277,307,309,311,310,272,271,275,274,264,269,265,270,267,268,266,364,349,308,306,304}; int magebuffs [] = {1397,1087,1044,1243,1304,1259,1204,1040,1389,1036,1035,1048,1045,1085,1078,1303,1059,1032,1033,1191,1189,1182,1353,1354,1352,1392,1393,4703,1416,1363,273,276,365,307,309,311,264,265,270,267,268,266,363,349,308,306,304}; int voterewards [] = {1374}; public L2BufferInstance(int objectId, NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String actualCommand = st.nextToken(); int buffid = 0; int bufflevel = 1; String nextWindow = null; if (st.countTokens() == 3) { buffid = Integer.valueOf(st.nextToken()); bufflevel = Integer.valueOf(st.nextToken()); nextWindow = st.nextToken(); } else if (st.countTokens() == 1) { buffid = Integer.valueOf(st.nextToken()); } if (actualCommand.equalsIgnoreCase("getbuff")) { if (buffid != 0) { MagicSkillUse mgc = new MagicSkillUse(this, player, buffid, bufflevel, -1, 0); SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player); showMessageWindow(player); player.broadcastPacket(mgc); showChatWindow(player, nextWindow); } } else if (actualCommand.equalsIgnoreCase("fighterset")) { for (int id: fighterbuffs) { SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id)).getEffects(this, player); } showChatWindow(player); } else if (actualCommand.equalsIgnoreCase("mageset")) { for (int id: magebuffs) { SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id)).getEffects(this, player); } showChatWindow(player); } else if (actualCommand.equalsIgnoreCase("rewards")) { if (player.destroyItemByItemId("voterewards",10600,1, player.getCurrentFolkNPC(), true)) { for (int id: voterewards) { SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id)).getEffects(this, player); } } else { player.sendMessage("You don't have heroic's certifications to exchange."); } showChatWindow(player); } else if (actualCommand.equalsIgnoreCase("restore")) { player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp()); player.setCurrentCp(player.getMaxCp()); showMessageWindow(player); } else if (actualCommand.equalsIgnoreCase("cancel")) { player.stopAllEffects(); showMessageWindow(player); } else super.onBypassFeedback(player, command); } @Override public void onAction(L2PcInstance player) { if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel())); player.sendPacket(new ValidateLocation(this)); } else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false)) { SocialAction sa = new SocialAction(this, Rnd.get(8)); broadcastPacket(sa); player.setCurrentFolkNPC(this); showMessageWindow(player); player.sendPacket(ActionFailed.STATIC_PACKET); } else { player.getAI().setIntention(CtrlIntention.INTERACT, this); player.sendPacket(ActionFailed.STATIC_PACKET); } } private void showMessageWindow(L2PcInstance player) { String filename = "data/html/buffer/" + getNpcId() + ".htm"; filename = getHtmlPath(getNpcId(), 0); NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(filename); html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%npcname%", getName()); player.sendPacket(html); } @Override public String getHtmlPath(int npcId, int val) { String pom = ""; if (val == 0) pom = "" + npcId; else pom = npcId + "-" + val; return "data/html/buffer/" + pom + ".htm"; } }create new npc: <npc id="9001" idTemplate="31081" name="BUFFER" title="L2EUPHORIA.COM"> <set name="level" val="70"/> <set name="radius" val="8"/> <set name="height" val="30.5"/> <set name="rHand" val="0"/> <set name="lHand" val="5802"/> <set name="type" val="L2Buffer"/> <set name="exp" val="0"/> <set name="sp" val="0"/> <set name="hp" val="2444.46819"/> <set name="mp" val="1345.8"/> <set name="hpRegen" val="7.5"/> <set name="mpRegen" val="2.7"/> <set name="pAtk" val="688.86373"/> <set name="pDef" val="295.91597"/> <set name="mAtk" val="470.40463"/> <set name="mDef" val="216.53847"/> <set name="crit" val="4"/> <set name="atkSpd" val="253"/> <set name="str" val="40"/> <set name="int" val="21"/> <set name="dex" val="30"/> <set name="wit" val="20"/> <set name="con" val="43"/> <set name="men" val="20"/> <set name="corpseTime" val="7"/> <set name="walkSpd" val="50"/> <set name="runSpd" val="120"/> <set name="dropHerbGroup" val="0"/> <set name="attackRange" val="40"/> <ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" canMove="true" seedable="false"/> <skills> <skill id="4045" level="1"/> <skill id="4416" level="14"/> </skills> </npc> don't forget to paste this folder within htmls in the right section (gameserver/data/html), then spawn 9001.
  7. Hello mates, here we back again with a new guide, in this tutorial we will go beyond the rules (not forums rules lol), it could be useful for someone, useless for someone else, but .. i like to share things with you mates xD. Oh God someone shut me up to cut this off and get started …. It’s Really boring, don’t you think so ? Well Lineage is getting old, same play style, same aspects, it needs a little refreshment, or maybe a rebirth, people keeps changing servers wishing for something to entertain them, so why not adapt few things from other games ?, actually let’s be more straight and honest LETS STEAL SOME IDEAS :D, but hold on for a second … there are some talented people already adapted some styles and armors and weapons …. etc, and some adapted some events or stuff…. why not you ? you can also adapt things it’s not that hard or impossible if we just thought out of the box . In my opinion i’ll categorize adapting into two categories : 1. Client Adaption : Armors, Effects, Weapons, Interfaces …. etc . and i will not talk about this since it needs a good modeler and designer and i’m not 2. Features Adaption : Like Events, Items, Play style …. etc. and this is what we will be learning, it’s just needs few things to get familiar with. ------------------------------------------------------------------------------------------------------------- How to Get Started : Well it’s Simple, but to get better understanding we need an example to apply what we learn on . so we gonna adapt an idea from another game in this guide. There is a game called “Continent of Ninth Seal” , they keeps updating and adding new items and weapons every time , and one day they added a very good weapons, but some people was complaining about this, since after they got their weapons well enchanted and this is really hard to get, now they need to start over and enchant the new weapons from beginning ….. so they made a new feature which is Enchant Extraction. here is the link for the feature we gonna adapt : Transfer the Enhancement How the Feature Works : For example you have a weapon +16, and you need to change weapons, all you need to do is take your old weapon along with an item called “Weapon Enhancement Extraction Scroll” then go to blacksmith and put your old enhanced weapon with the scroll and you press a button, then your enhanced item will be destroyed and you will get what called “Transcendent Stone +16”, then u enhance the other weapon with this stone which will make it instantly +16 without fail. Note : later they added update to lower the stone with 2 levels means +16 items will make +14 stone. because people started to enhance low items and when get ++++ then extract and add it to high item. also this feature made them sell very well since the Extraction Scroll is for about 7 Dollars. ------------------------------------------------------------------------------------------------------------- The Game : Adapting such a feature is just a game that we gonna play together now,The Game of Thieves, we will play as thieves, oh you laughing at me now …. come on and trust me i’ll tell you how to be a good thief. First let’s make a party and go in our mission….. ------------------------------------------------------------------------------------------------------------- The Mission ( Prove Yourself ) : Hello new thief .. in order to join the Adaption Mafia you have to prove yourself by Proving yourself as a skilled thief . Your first mission is : Our Gaming Spies confirmed that the developers of C9 is working on a new technology which will allow their players to extract their enhancements and contain the enhancement power into some kind of magic stone called “Transcendent Stone” , and with this stone they will be able to put this contained power on another weapon .. we don’t have much info about this technology .. and it is your mission to steal their papers and implement this feature to the mother of games “Lineage” .. Our Spies was able to get into their game and was able to take 2 screenshot regarding the feature… use them wisely. ----------------------------------------------------------------------------------------------------------------------- Oh , what we gonna do ? “Start Small, Progress More” It looks like tough mission, but let’s calm down and break this down into simpler steps, what this feature is about or what things that makes it : – Enhancement Panel : we already got this in our game – Extraction Panel or window : well we don’t have this too, and if we made it like an html with some bypasses it will looks so static, no real on screen interactions …. – Transcendent Stone : well we can easily create an Etc Item, but if it’s done this way we’ll have to create many of this since one for +1, another for +2, +3 …… etc . and this will so much we need a smarter way. well what about create one Etc item and save it’s enhancement level somewhere in server or database … pfff but how players will know if it’s +12 or +10, it will has same name showing on the screen they can fool each others and sell a +1 stone as if it’s +100 stone, oh no we need another way. – Extraction Scroll : this could be the easier part all we need is to create an Etc Item – Being able to move the enhancement from the Transcendent Stone to another weapon . What about quit and say we can’t do this ? ----------------------------------------------------------------------------------------------------------------------- Investigation : “Use what you already have” Before we start we need to make some investigation and see what tools we have and what we can make use of. What things in lineage that “look like” this, this is the first thing you need to think about when you adapting anything to anything, not only Lineage but any software or system you develop, it’s like one of the basic rules in Software Development career is to use what you already have. – Extraction Panel : we need some kind of panel where player put two things, the weapon and the extraction scroll …. think, think, think ….. oh we have two things like this , Enchant panel and augment panel … i think we can use one of them – Transcendent Stone : we need an item with dynamic name to be like ” +6 Transcendent Stone or +10 Transcendent Stone”, hmmmmmmmmmm …. let’s do some brain storming … what items that part of it’s name controlled by server not the client …. why we didn’t thought about this ???? all armors, weapons and jewels has this feature they all can have the +xx thing – Extraction Scroll : it’s just an item man, nothing easier than this … wait wait wait .. i think about something, what about making this as a special enchant scroll, so when user click on it it will automatically pop up a window to select a weapon. – Enhance Back with Transcendent Stone : well we can just make it as enhancement scroll, but ….. we said we gonna make it like armors and weapon, how it can be for example a weapon and scroll in same time . well we need a bit of analyzing , weapon when used they get equipped, scrolls when used they get an enhancement panel …. can’t we check on Equip Request that if it’s our stone then it override the equipping procedure and instead run the enhancement procedure ?? i think we can find a way around. ----------------------------------------------------------------------------------------------------------------------- The Plan : “Going random is the best way to fail” Our plan will split on multi tasks so we can work on one by one as follow Stage .1 : (Preparation) – Create a new UTX File containing the icons for our two items (Transcendent Stone and Extraction Scroll) – Add Items to Itemname-e.dat file with proper names – Add Transcendent Stone to Armorgrp.dat as accessory or something – Add Extraction Scroll to EtcItemgrp.dat – Add both Items to proper XML file in server data files – Estimate current Stage Progress and Check if all work as expected Stage .2 : (Think out of the Box) – Handle player’s Equip action with Transcendent Stone to be forbidden and instead open Enhancement Panel – Handle Enhance panel acceptance for our Transcendent Stone as Enhancement Scroll instead of Armor Part – Handle Player’s Request of Confirming Enhance Process with Transcendent Stone – Handle Usage of Extraction item differently than enhance scroll to extract Enhancement instead of Enhancing – Clean up and Estimate current Stage Progress to Check if all work as expected ----------------------------------------------------------------------------------------------------------------------- ~*- Challenge Accepted -*~ ----------------------------------------------------------------------------------------------------------------------- Stage .1 : – Create a new UTX File containing the icons for our two items (Transcendent Stone and Extraction Scroll) Note : there are many tutorial on this forum about this thing so we will cover it fast. Okay boss we’re on it … at this point we will need to use the screen shots from our spies to get the icons of both and crop them on any image processor, i’ll use Photoshop, also we will need to resize them to 32 by 32 pixels, and i’ll set my crop aspects on Photoshop to be 1×1 to avoid any ratio problems After that we do same for the other one then we resize, in Photoshop i use shortcut CTRL+ALT+I Now we will save both of them as TGA files, i don’t have the DDS plugin installed so i’ll save as TGA, and will name them as transcendent_stone_icon.tga and enhancement_extract_scroll.tga then will close photoshop and go to open Unreal Editor and create new UTX File, will name MxCMission, then import the two TGA files we made (Take care of what highlighted Thanks to @Sinister Smile for helping with this) Let’s Save this file and encrypt it. I’ll use L2Ninja to Encrypt as L2 UTX file Now we add this file to our SysTextures Folder and Task Completed ----------------------------------------------------------------------------------------------------------- – Add Items to Itemname-e.dat file with proper names I’ll use L2Ninja Again to edit this file (you can use any editor) and add both items with ids 85850 and 85851, just any the id you want but be unique and make sure you remember them ----------------------------------------------------------------------------------------------------------- – Add Transcendent Stone to Armorgrp.dat as accessory or something After some investigations i found most armor items express their type for example Baium under it’s name you will see the word “Ring” and same for most armor items except ….. Belts, so because i’m a lazy coder i’ll copy any armorgrp belt code and modify it then add it again to armorgrp.dat, i wont write it from scratch it’s so dam long mate xD So here is the code i copied and modified with our new item id and icon, so i used id of 85851 and icon MxCMission.transcendent_stone_icon ----------------------------------------------------------------------------------------------------------- – Add Extraction Scroll to EtcItemgrp.dat What about doing the same, i’ll just copy anything from that file and change id and icon xD , we can adjust this later . ----------------------------------------------------------------------------------------------------------- – Add both Items to proper XML file in server data files Now we need to add this items to Server XML files, so i’ll create an xml in data/stats/item and will name it mission.xml, then will add the proper code of both item <?xml version="1.0" encoding="UTF-8"?> <list xmlns:xsi="" xsi:noNamespaceSchemaLocation="../../xsd/items.xsd"> <item id="85851" type="Armor" name="Transcendent Stone"> <set name="icon" val="MxCMission.transcendent_stone_icon" /> <set name="default_action" val="EQUIP" /> <set name="armor_type" val="LIGHT" /> <set name="bodypart" val="waist" /> <set name="immediate_effect" val="true" /> <set name="crystal_count" val="30" /> <set name="crystal_type" val="A" /> <set name="material" val="CLOTH" /> <set name="weight" val="440" /> <set name="price" val="371300" /> <set name="enchant_enabled" val="1" /> </item> <item id="85850" type="EtcItem" name="Enhancement Extraction Scroll"> <set name="icon" val="MxCMission.enhancement_extract_scoll" /> <set name="default_action" val="SKILL_REDUCE" /> <set name="immediate_effect" val="true" /> <set name="material" val="PAPER" /> <set name="weight" val="120" /> <set name="is_oly_restricted" val="true" /> <set name="handler" val="EnchantScrolls" /> </item> </list> ----------------------------------------------------------------------------------------------------------- – Estimate current Stage Progress and Check if all work as expected Let’s Start our server and check the items we created …. Yeaaah it’s working and even when we use the Extraction scroll it opens the Enhancement Panel … this is a great start ----------------------------------------------------------------------------------------------------------------------- ~*- Stage 1 Completed with Pleasure -*~ ----------------------------------------------------------------------------------------------------------------------- Stage .2 : (Think out of the Box) JAVA TIME ….. this where things get more exciting but it can be messy so let me tell how things working in L2J so we can have better understanding about the process. I’ll give you a little Hint about how to be on the right path without keep looking on internet or asking … Please Focus on this Part … Everything in Lineage is based on something called Packets. Consider a Packet as an Envelop that contain a letter being send from your Game Client as player to the Game Server and vice versa From Game Server to Game Client, this letters or packets can contain a request or information like for example You wanna Equip a Weapon so you double click on it : Game Client > Game Server : Oh ! Hey Server i want to equip a weapon that has id 9999 Game Server > Game Client : Well, it’s looks fine and allowed for me, Okay No Problem Equip It. Game Client > Game Server : Thank you mate, i have Equiped it, can you tell me my stats after Equip Game Server > Game Client : Yes, Sure thing . Here is your stats ……………. This Sentences between client and server is pack , and we will talk about Two Types of Packets in L2J ServerPackets and ClientPackets. Client Packets : Are the Packets that sent from Client to Server, which located at java/com/l2jserver/gameserver/network/clientpackets Server Packets : Are the Packets that sent from Server to Client, which located at java/com/l2jserver/gameserver/network/serverpackets At This two locations all the magic starts to happen, you can really explore them and see where the code starts at every in-game action for example when we right clicked on “Enhancement Extraction Scroll” it sends a Client Packets called UseItem, so server will try to process this packets and see if it’s allowed or not and what this item about, it will say “Oh i see in my XML files that this items is EnchantScroll so let’s Open Enchant Panel” , this response from server is also a packet which is ChooseInventoryItem Packet, Then Player try to put his weapon into enchant item slot but it needs a permission so it send to server a Client Packet called RequestExTryToPutEnchantTargetItem, saying “Hello i wanna select this weapon as the Target item to Enchant, is this allowed ?” , At this point we can think of this Packet Java file maybe is the one responsible for accepting or refusing , Let’s take a look and see if something useful , yes i found something interesting in this file : Looks like the Yellow Area is just a normal checks, Red Area is where Server Refuse an Item, Green Area is where Server Accept an Item … Try also to Explore more in the Packets Packages that i have mentioned their locations before, at least read files names, it’s very useful to know what in there. So Let’s Start ----------------------------------------------------------------------------------------------------------- – Handle Usage of Extraction item differently than enhance scroll to extract Enhancement instead of Enhancing I Guess you know where we can go .. Yes and we need to make it not refuse our Extraction Scroll since if we try now to add any item to enhance with this scroll it will just refuse it, since it’s refusing the scroll it self . so here is the modifications i made, replace : if ( (scrollTemplate == null) || !scrollTemplate.isValid(item, null)) with this : if ( ((scrollTemplate == null) || !scrollTemplate.isValid(item, null)) && scroll.getId() != 85850 ) and then we need to add this after the if statement block to check if the target item is good : //Extraction Scroll else if (scroll.getId() == 85850) { boolean validProcess = true; if(!item.isWeapon()) { activeChar.sendMessage("You Can only Extract Enhancement From a Weapon"); validProcess = false; } else if (item.getEnchantLevel() <= 0) { activeChar.sendMessage("There is no Enhancement on this Item to Extract."); validProcess = false; } //Finally if it's not valid for any Reason then Fail the process if(!validProcess) { activeChar.sendPacket(SystemMessageId.DOES_NOT_FIT_SCROLL_CONDITIONS); activeChar.setActiveEnchantItemId(L2PcInstance.ID_NONE); activeChar.sendPacket(new ExPutEnchantTargetItemResult(0)); return; } } So here what we have done : --------------------------------------------------------------------------------------------------- – Handle player’s Equip action with Transcendent Stone to be forbidden and instead open Enhancement Panel – Handle Enhance panel acceptance for our Transcendent Stone as Enhancement Scroll instead of Armor Part We will do those steps together so instead of equip we will send a different packet and to do this we gonna modify Client Packet, so after if (item == null) { return; } We gonna add this check if it’s our Transcendent Stone, then don’t Equip and instead start enchanting with it : //Forbidden to Equip Transcedent Stone if(item.getId() == 85851) { if (activeChar.isCastingNow()) { return; } if (activeChar.isEnchanting()) { activeChar.sendPacket(SystemMessageId.ENCHANTMENT_ALREADY_IN_PROGRESS); return; } activeChar.setActiveEnchantItemId(item.getObjectId()); activeChar.sendPacket(new ChooseInventoryItem(item.getId())); return; } Well it’s should pop up the Enchant Window, but it wont accept any item since it’s not an instance of EnchantScroll so we will need to make it able to accept weapons as target items like what we did with Extraction Scroll, so let’s Modify the code of RequestExTryToPutEnchantTargetItem Packet again and do another else if, and add the item id to the main if as we did before, so again we replace : if ( ((scrollTemplate == null) || !scrollTemplate.isValid(item, null)) && scroll.getId() != 85850 ) with if ( ((scrollTemplate == null) || !scrollTemplate.isValid(item, null)) && scroll.getId() != 85850 && scroll.getId() != 85851) now we need to add another Else if after the one we added before : //Transcendent Stone else if(scroll.getId() == 85851) { if(!item.isWeapon()) { activeChar.sendMessage("Transcendent Stones are available only to be used with Weapons"); activeChar.setActiveEnchantItemId(L2PcInstance.ID_NONE); activeChar.sendPacket(new ExPutEnchantTargetItemResult(0)); return; } } --------------------------------------------------------------------------------------- – Handle Player’s Request of Confirming Enhance Process with Transcendent Stone When a player use an Enchant item and then he add the Target item it’s time to press Start which will send the packet RequestEnchantItem, and since it’s sent by Client then it’s in ClientPackets , so let’s look at it’s code and see what trouble we can get through when we use this fake belt Transcendent Stone as Enchant Scroll : 1st : in this part it wont work since it’s not real scroll so wont have Template : // template for scroll final EnchantScroll scrollTemplate = EnchantItemData.getInstance().getEnchantScroll(scroll); // scroll not found in list if (scrollTemplate == null) { return; } So we need to modify the if statement to be : if (scrollTemplate == null && scroll.getId() != 85851) Also later down we will find this code which will make our fake scroll not work, and will cause an Null Pointer Exception Error since it will try to validate the target item against the scrollTemplate, and actually scrollTemplate is null since this is not a scroll and we skipped this check for being null before : // first validation check if (!scrollTemplate.isValid(item, supportTemplate)) So we need here to do this check only if it’s not Null, since it’s not null then it’s not our fake scroll, logically, so we replace it with : if (scrollTemplate != null &&!scrollTemplate.isValid(item, supportTemplate)) Later if we scroll down, we will see something like this : final EnchantResultType resultType = scrollTemplate.calculateSuccess(activeChar, item, supportTemplate); switch (resultType) Here we will notice few things as follow : – First it lands EnchantResultType into resultType, so we need to land something of same type incase it’s our scroll and if you Right Click on EnchantResultType and choose Go To Definition (i guess this is it in Eclipse) or as i use NetBeans it’s CTRL+B, you will find that EnchantResultType has possible 3 values as enum (ERROR, SUCCESS, FAILURE), so maybe we will need to add another value to that enum for example TRANSCENDENT to be like this : – Second it uses scrollTemplate and it maybe null so it will cause error so we need to check if it’s null or it’s our fake enchant item, and if it’s not null we do the regular procedure and if null and it’s our fake stone then we return TRANSCENDET value that we added , in this case i’ll use Ternary Operator : final EnchantResultType resultType = (scrollTemplate == null) ? EnchantResultType.TRANSCENDENT : scrollTemplate.calculateSuccess(activeChar, item, supportTemplate); – Thirdly there is a switch statement which iterate through possible EnchantResultType values and we just add our new one so we need to add at the begging of the switch the case of TRANSCENDENT , which in this part the magic happens and where we will move enchant from stone to the item , but Oops we forgot a little thing, by reaching this line it means that our stone already destroyed, so we dunno about the enchant level of it, so we need to save it anywhere before this line // attempting to destroy scroll scroll = activeChar.getInventory().destroyItem("Enchant", scroll.getObjectId(), 1, activeChar, item); we will add : int transcendentLevel = scroll.getEnchantLevel(); then we back to our switch statement and implement the enchant level replacement by adding another case at the beginning like this : case TRANSCENDENT: { if(transcendentLevel > 1 ) { item.setEnchantLevel(transcendentLevel); item.updateDatabase(); activeChar.sendMessage("Transcendent Stone Power can be felt now on your " + item.getName()); activeChar.sendPacket(new EnchantResult(0, 0, 0)); } else {activeChar.sendMessage("This is an Empty Stone, it's just useless to have it.");} break; } ----------------------------------------------------------------------------------------------- – Handle Usage of Extraction item differently than enhance scroll to extract Enhancement instead of Enhancing In this case we gonna do same of what we did with Transcendent Stone, so again we replace this : // scroll not found in list if (scrollTemplate == null && scroll.getId() != 85851) with this : if (scrollTemplate == null && scroll.getId() != 85851 && scroll.getId() != 85850) And we add another EnchantResultType to be like this : Then we gonna replace the resultType Ternary operator we made before with a nested ternary operator : final EnchantResultType resultType = (scrollTemplate == null) ? (scroll.getId() == 85850) ? EnchantResultType.EXTRACTION : EnchantResultType.TRANSCENDENT : scrollTemplate.calculateSuccess(activeChar, item, supportTemplate); Now we need EXTRACTION case into the Switch Statement : case EXTRACTION : { L2ItemInstance stone = new L2ItemInstance(85851); stone.setEnchantLevel(item.getEnchantLevel()); activeChar.getInventory().destroyItem("Extraction", item, activeChar, activeChar); activeChar.getInventory().addItem("Extraction", stone, activeChar, activeChar); activeChar.sendPacket(new EnchantResult(1, 85851, 1)); break; } ------------------------------------------------------------------------------------------------------ – Clean up and Estimate current Stage Progress to Check if all work as expected Let’s Build our Server and restart it and check if it’s working Oh it’s working !!!!!!!! ----------------------------------------------------------------------------------------------------------- Notes : - You can do it better by implementing a new Item Type, but as you can see the guide is already long so i tried to make it as simple as possible - With same Concept of Investigation and Planning you can implement almost any feature ------------------------------------------------------------------------------------------------------------ Conclusion : - Investigate more and more into sources - Have a Good Plan, never go Random - Start small and progress more - Don't Seek Perfection at the first time, make it work then make it work better ------------------------------------------------------------------------------------------------------------ I hope you like it and i wish it's useful to anyone, and if you have any questions or need help just let me know :)
  8. Hello once again, My Apologies for being away for sometime, at this tutorial we gonna discuss working with Linux as Hosting OS for your L2J Server an we will be talking about the advantages of using Linux. so let’s cut this off and get started. Table of Contents : – Who can use this tutorial ? – What is Linux ? – Which Distribution to use ? – Installing Linux on Personal PC or Virtual Machine – Getting familiar with Linux Command Line { Terminal } – Connect to Linux Server with through SSH Remotely – Learn to Manage Users, Group and Access Control – Repositories and Software – Installing and Configuring MySQL Server – Connect and Install Your Server Database – Installing and Configuring Oracle Java – Move and Setup your Server Files to Linux Server – Run and Stop Server – Installing and Configuring Apache2 – Host your Site and Domain - Ports and Firewall > To be Added – Manage Processes and Services > To Be Added – Advanced and Helpful Commands > To Be Added – What’s Next with Linux …. > To Be Added In the beginning i would like to answer some frequently asked questions . Who can use this Tutorial ? This Guide is meant to be for non System Administrators , so it basically will be a Step by Step guide to help those didn’t worked with Linux before, so if you have no experience at all with Linux then don’t worry you’ll get familiar with it today . What is Linux ? Well, Linux as a name refers to multiple things but mainly it refers to OS Kernel that spreading more and more everyday and guess what most likely you’re using Linux too , Huh ?? oh yes actually Android is based on Linux Kernel. For some people Linux is a monster, and actually it is a monster but a monster that fights you , or fighting in your side if you can deal with it Linux is not that thing you can go download and get like that (Ofc you can but this needs alot of advanced skills), instead it comes as packages called Linux Distributions and can be called Linux Distro, this distributions are usable packages for Linux packed with some tools and software and some of them comes with a GUI as well, and actually there are many Distributions out there, for example : Ubuntu, Fedora, CentOS, BackTrack, Kali …. etc Which Distribution to use ? Well there are actually many good distributes but as an advice if you good or moderate with Linux then use Ubuntu Server Distribute if you are not a command line guy/girl then use something with GUI like Ubuntu Desktop, Kubuntu, Fedora. Also you may need a UI to make changes and stuff , but if you’re an experienced or a command line lover then u wont need this GUI, since everything can be done via Terminal. Most likely when you buy your dedicated or VPS your hoster will ask your for which Distribute you want to be installed and this options are widely available in most if not all hosting providers like OVH which i recommend. In this Guide i’ll use Ubuntu Desktop and Kubuntu Installing Linux on Personal PC or Virtual Machine I don’t like to repeat what’s already done, since there are alot of good tutorials out there , here is one of the good guides, also i’ll add a detailed guide about this later – Getting familiar with Linux Command Line { Terminal } First i expect now you have a clean install of Linux, i have also a clean install of Ubuntu Desktop, so let’s login with your password created in installing process or provided by your host, Type your password and hit Enter Once you logged in Click on the Ubuntu Icon on left top corner then type “terminal” in search and click on terminal icon Now we have our terminal up and running so we can start playing around with commands Great, Let’s try same on another distribution ? Okay let’s go to Kubuntu Distribution Login with your username and password Then Click on Kubuntu Logo on the bottom left corner and type terminal in search then click on Konsole icon Here we go again with our terminal Now it’s the time to run some commands and get familiar with the new environment List files in current Directory : To see files in current working directory you can use command ls Here we can see all files and folders in current directory, but actually this is not all files and folders since by default the “ls” command wont show the hidden files, and to show all files including hidden files we can add options “-a” which stands for “list all” ls -a as you may notice in Linux hidden files and folders are those who starting with a dot “.”, any file starting with “.” will be considered as a hidden file See the current directory : To get the path of the current directory you’re working with you can use the command “pwd” which stands for “Print Working Directory” pwd Clear Screen : To Clear Terminal screen you can use the command clear Yes it’s as simple as that Make a new Folder : first of all in Linux Community it’s usually called Directory not Folder, so in order to make a new directory u can use the command “mkdir”, which stands for “Make Directory” followed by Directory name, normally this command will return nothing but this is normal so getting nothing back doesn’t mean it’s not working mkdir mxc_directory Note : Linux is a case sensitive system unlike windows, so for example mxc directory is not Mxc directory since “m” is not “M” so you can have two directories in same directory with same name but different letter case Change Current Directory : Well in order to move to another directory you can simply use command “cd” which stands for “Change Directory” followed by the patch to go or directory name cd mxc_directory Go to Upper / Parent Folder cd .. If you wanna go to to the very top directory use “cd” without any path, and if you wanna go quickly to user directory you can use that command cd ~ Create a new Empty file : Creating a new files in linux is very simple, let’s go to mxc_directory and make a file in it called hello.txt, i think you know how to go to mxc_directory and then create the file using touch command cd mxc_directory touch hello.txt Edit File Content in Terminal : To edit a text based files in terminal you can use nano (available on many distributions, some have vim instead), for example nano hello.txt You’ll get GNU nano Editor like this Now you can type or edit whatever you want and to Save Press CTRL+O then confirm file path and hit Enter, To Exist Nano Editor Press CTRL+X Show File Content into Terminal : If you wanna show a text based file contents into Terminal for a fast review you can use command “cat” followed by file name cat hello.txt Print Text to Terminal : To show text to a screen or to print out a message you can use command “echo” followed by message or text quoted echo "My Secret Message" Useless huh ? , Well just stay with me for next trick Send Terminal Output to a file : If you have any terminal output that you want to save to a file instead of printing it to screen, like a log or something which you may need this when working with L2J to quickly redirect out errors to a file for later review then you can use output redirect command which is used by appending “>” followed by output file after any command that you expect an output from echo "My Secret Message" > secret.txt Copy file : To copy a file you can use “cp” command followed by original file name/path followed by new file name/path, you have to provide path if it’s not in current working directory also you need to provide the name of the file on the new location cp secret.txt copied.txt But how to copy a folder instead of just a single file ? , well it’s simple you can still use “cp” command but this time followed by option “-R” which means Recursive , so let’s try to go to upper folder and copy mxc_directory cd .. cp -R mxc_directory copied_directory Move File : Moving files means it will be copied to another location and deleted from original one, and to do this we can use “mv” command followed by original file followed by new location along with the new file name, so for example to move copied.text to the upper directory we can do so mv copied.text ../moved.txt If you wanna move a directory we do as we did in coping directory by adding “-R” option Delete / Remove a File : To delete a file you can use command “rm” which stands for “remove” followed by file name rm secret.txt Same for Deleting Directory you can add -R option but take care since this operation can’t be undone Connect to Linux Server with through SSH Remotely Considering that you have a Linux VPS or Dedicated you will have what’s called SSH (Secure Shell) access in this case you’ll be able to login and control in terminal mode, and to do this there are many ways to connect through SSH but i prefer to use a small application called PuTTY which is free and easy to use. Download PuTTY : Click Here After downloading and installing (Really easy to install not a big deal) you can run this application, you’ll get something like this Enter you VPS or Dedicated Host name of IP on selected input and by default port will be 22 and then hit “Open”, you’ll get a black window like command line and will ask u for a username, put the username u use to login to your Linux then will ask for your password and now you are logged and can issue Linux commands remotely Learn to Manage Users, Group and Access Control Learning how to manage users and groups is very important when dealing with Linux since learning this will save you from a lot of troubles. I’ll try to simplify this as possible. In Linux in order to login into the system you must have a user credentials just like windows, so you can have multiple users into a Linux system also this users can be grouped into “Groups”, and whenever a user create a file or something this file will be “Owned” by this user and this is the user who has full permission on this file. Talking about Permissions there are 3 permission on each file : Read , Write and Execute, each one of this permission has something like a code as follow : Read (4), Write (2) and Execute (1). so for example full permission will be 4 + 2 + 1 = 7 => 7 is the code for Full Permission, 5 means you can Read and Execute but you can’t edit or modify the file, 0 means no permissions at all. When you wanna set a permission for a file you have to set it also for 3 things in order : Owner, Group and Others. Owner : Is the user who create the file. Group : Is users in same group as owner or the group owns the file Others : Is anyone else So for example Setting Permission for a file as 777 means everyone has all permissions, 775 means Owner user and Owner Group has full permissions while others can only Read and Execute but not Write or Modify It’s Always preferable to do your stuff using non-root user, since root user have full permission over system files which may cause problems because it’s a “Super User”, which in shortened called “su” Creating Users : So Let’s create our user that we will use to sort our server, to create a new user you have to be on a “Super User” / Root , and we gonna use command “useradd” and we can specify some options for example : -m : this will automatically create user home directory if not exist for example > /home/samdev/ -M : this option is used to tell Linux to no create user home directory even if system automatically create home directories for new users -d : this will allow us to specify custom user home directory location -U : will create a group with same name of username and add the new user to it automatically -e : will allow us to set expiring date which will make the account auto expire at a specific date There are many more options you can use but let’s Start small to keep thing as simple as possible, we gonna now create a user with a username of maxcheaters but issue this command useradd -m maxcheaters If you are not on a root user then prefix command with “sudo” then it will ask you for a root password, prefixing any command with “sudo” means that run this command as a “Super User” sudo useradd -m maxcheaters Well it’s created, we can confirm this by listing our users by cat the file /etc/passwd cat /etc/passwd Also here is a trick to show only usernames by cutting each line by delimiter “:” and print first one only cut -d : -f 1 /etc/passwd Well we have our new user create but actually we didn’t set a password for it , so how we can set a password for a user ? . Simple .. we can use the command “passwd” which stands for Password, and also this needs to be ran as “Super User” so you can prefix with “sudo” if you are not on root sudo passwd maxcheaters Nice, it’s not asking you for the new password, just enter a password and hit enter. then confirm it again Note : you wont see what you are typing so make sure you are typing it right Switch Accounts : Now we want to switch to our newly created account, which can be done using command “su” which stands for “Switch User”, don’t get confused about “su” when talking about “Super User” or “Switch User” , when we talk about commands it’s “Switch User” when talking about Terms in Linux Community it’s “Super User”, so here is how to switch to another user su - maxcheaters It may ask you for the password, so enter it and hit Enter Now if we check our current working directory using “pwd” command we will see that we automatically switched to maxcheaters user home directory About Groups : Each user has two different types of groups, Primary one and Secondary Groups, The primary group is usually a group with same name as username it’s created automatically when user created, this doesn’t mean it can’t be change .. no you can change this primary group but in most cases you wont need to do this. Secondary Groups are the groups that user subscribed to it after being created (ah it makes sense ) , so you can have your group and subscribe to other groups as well. So first let’s see what groups our new user has by issuing command “id” followed by username id maxcheaters Now we can start working with groups but to do this we need to be on “Super User” mode so we can do things on root which is not very good choice for security concerns or we can give permissions to our new user. Sudo Permissions : To give a user on a Linux system a permission to run “sudo” commands all we need to do is to switch to root access and add our user to the “sudo” group, so first let’s switch to root, and enter required password su - root Now we need to add our user “maxcheaters” to “sudo” group using command “usermod” followed by option -a which means “Append” followed by “G” then group name “sudo” followed by user to add “maxcheaters” usermod -aG sudo maxcheaters Now let’s Switch back to “maxcheaters” user, i guess you know how … right ? su - maxcheaters Create Groups : Creating is as simple as creating users with the command “groupadd” followed by new group name, note that this command is needs to be executed via a super user and since we switched to non-super user “maxcheaters” then we prefix it with “sudo” to do it as super user, not that it may ask you for the “maxcheaters password sudo groupadd cheaters To get list of all available groups you can cat the file “/etc/group” cat /etc/group Add a User to Group : Huh ?? we already did this , cant you remember ? … well anyway you can add user to a group by modifying user with “usermod” command followed by -aG, followed by group name then user name, and this is also a super user command so you need to prefix with sudo sudo usermod -aG cheaters maxcheaters Remove user from a Group : To remove user from a group you can use command “deluser” yes it means delete user but no worries if you use it correctly it wont affect user itself, only remove it from a group, also it needs to be used with “sudo” sudo deluser maxcheaters cheaters Delete a Group : Well we deleted the user from the group but we didn’t deleted the group it self , it still exist so if we wanna to delete the group “cheaters” we can use command “groupdel” followed by group name, also it will delete the group from all users subscribed to it automatically sudo groupdel cheaters Repositories and Software Repositories are some kind of online sources for downloading and getting software, Linux distributions comes with some default repositories that contains most and commonly used software, so it helps you to download software easy and fast and your system will search available or registered repositories for the software you want to install and download it for you. Note : this part of guide is for Distributions that uses “apt” as packages manager which is very common, some others like for example ArchLinux using “pacman” as packages manager, so if you have a different package manager lemme know the Distribution you use and i’ll try to assist you though it Update APT Database : It’s always good to update your repositories and this means let your system scan registered repositories and see if anything added or changed, and we do this using command “apt-get” followed by “update” sudo apt-get update Install a Software : To install a software you know first to know it’s name (logically ), then you can use command “apt-get” followed by “install” then application name, but actually in Linux community it’s usually called Package instead of application and things like this . so let’s try by installing “unzip” to be able to unzip .zip files sudo apt-get install unzip Very simple isn’t , it’s just like that, no annoying pop ups and dialogs … etc Note : Some Packages during installing will ask you about something needs confirm and you’ll be able to answer by typing “Y” for yes, and “n” for no Uninstall a Package : Maybe at some point you want to uninstall / remove a package installed before, and it’s not hard to do all u need is same “apt-get” command followed by “remove” instead of “install” followed by package name to remove sudo apt-get remove unzip But wait a moment cause this is not best way all the times, it can be good at sometimes and not in some other cases, since this way you removing only the package it self ,but sometimes a packages comes with another package and configuration files so to remove it all we can use another way by using “purge” instead of “remove” sudo apt-get purge unzip Installing and Configuring MySQL Server Now it’s time to install MySQL server on our Linux Server, but installing package named “mysql-server” sudo apt-get install mysql-server Congratulations it’s installed, but hold on … it’s not the time to celebrate … we still need to configure it Currently if we tried to log into our database it will be with username “root” and no password (by default) so it’s time to harden our database security a bit. MySQL Security Hardening : First thing after installing mysql server on Linux is to harden its default security configurations and this can be done by running the command that comes with mysql installation “mysql_secure_installation” as a super user sudo mysql_secure_installation At this part you need to enter the current password of root username (which is none by default ) so just hit enter, then it will ask you if you want to set a password for the “root” username (root of mysql server not system), just answer with “Y” for Yes Now it will ask you to set a new password for the “root” user, write a password (it wont show so just type it carefully) and Confirm it again Done, and it’s asking you if you wanna remove anonymous users, Of course “Y” we don’t want anonymous access to our database The Good Question is here … Do you want to “Disallow” root user to be logged remotely ? well maybe you need remote access to manage your database from your pc or from any where and i also want that but it’s really a bad idea to allow remote access for “root” so i would say “Y”es Disallow root login remotely and later i’ll tell you how to make a good remote access without root. Do you want to remove test database and access to it ?? Hell yeah who needs a test database .. do you ? Now Let’s Reload Privileges ?? YES Now our MySQL Server has a better security . Login to MySQL Server We have our Database Server now ,why not trying to login via Linux , Let’s go for it … Note : this method is applicable to all Operating Systems since it’s related to MySQL it self not OS. How we gonna do this ? Simple use command “mysql” followed by -h (to identify host default is localhost) followed by host “localhost” followed by -u ( to identify user) followed by username (root is the only one we got now) followed by -p to identify that this username has a password mysql -h localhost -u root -p and it will ask you to enter the password just type it and hit Enter Now we can run any MySQL Queries / Commands for example let’s see the databases we have so far SHOW DATABASES; Note : All MySQL Queries and Commands ends with ; (semi-colon) Create a Database : Since in this Guide i’m planning to demonstrate using aCis Server pack so i’ll create a database called acis_db, using mysql command “CREATE DATABASE” followed by database name CREATE DATABASE acis_db; Succeed . Create a Database User : Isn’t the time to use another user for MySQL instead of root ?, i guess it’s good idea to create a new user with limited access using this MySQL Command CREATE USER 'USERNAME'@'HOST' IDENTIFIED BY 'PASSWORD'; USERNAME : is the username you want to create HOST : This is really important since by default this is “localhost” but doing this wont allow you to connect remotely with this user, since connection from this user will be accepted only if it’s from “localhost” or same machine , so if you want to allow remote access from anywhere you can set it to (%), or even set it to a specific host if you wanna a very specific security layers PASSWORD : is where you put this user password Now just Hit Enter after you customize this command as you need … and your new user will be created Give Access on Database : You successfully create a database user, but actually this user by default will have no access on any database so it’s time to give this user access on our “acis_db” database, using “GRANT” command GRANT ALL ON acis_db.* TO 'maxcheaters'@'%' IDENTIFIED BY 'PASSWORD'; This line of MySQL command means : Give All Permission on the Database “acis_db” including All (*) Tables to the user “maxcheaters” that have remote access and password of “PASSWORD” Amazing , But to be honest with you this wont affect database instantly , we need to force MySQL server to reload permissions and access by issuing this command FLUSH PRIVILEGES; Maintain Remote Access : We Created our user with remote access , so let’s try to connect to the host with your favorite MySQL Database App, most L2 Admins uses Navicat but i hate that Application so i use an application called HeidiSQL , so just connect with whatever you want … Oh Come on, we created a user with remote access why it’s not working ? …… Actually we set this user to have remote access but MySQL Server it self is not yet configured to support remote access Support, so let’s Do this. but first quit MySQL Command Line by typing “exit” and hit Enter. First we need to modify MySQL configuration file which by default on location of /etc/mysql/my.cnf , so i’ll use nano editor for this, as we did before to edit files . sudo nano /etc/mysql/my.cnf Scroll down a lil bit using Keyboard Arrows til you find “bind-address” and set its value to your public ip or DNS Then Save it using CTRL+O, then Exit Editor using CTRL+X, and to make this changes has effect we need to restart MySQL Server or Service using this command sudo service mysql restart Now it should work if we test again … Yes it does …. Note : it you may can’t login to your database server remotely also if your firewall blocked 3306 port, if that’s the case, no worries we will take about Firewalls later. Connect and Install Your Server Database Well i guess you already connected not it’s time to export your database and import it into your new database server. To do so on HeidiSQL, right click on your local database and click on Export Database as SQL Now Select your Exporting Preferences and Export Location then click on Export After SQL File Exported Now back to your Remote MySQL Session and Select “acis_db” database and activate “Query” Tab On “Query” Tab Script Area Right Click and Choose “Load SQL File…” and check where you saved the exported SQL Script and then Hit Run Icon Now your Server Database Installed, Congratulations so far Installing and Configuring Oracle Java Since you have your database up and running we still need Java to be installed on our Linux System to be able to run GameServer and LoginServer, so let’s learn how to install “Oracle” Java successfully . First some Linux Distributions comes with java already but “Open”JDK not “Oracle” JDK and we need to install Oracle JDK to run without problems, so we can use “apt-get” command as before but the problem is Oracle JDK is not always available on Default Repositories so we may need to add that Repository contains Oracle Java. Adding a Repository : Adding a Repository is just a 1 line command that self explanatory using command “add-apt-repository” followed by repository identifier, and the repository that contains Oracle Java is “ppa:webupd8team/java” , so let’s add this sudo add-apt-repository ppa:webupd8team/java It May ask you for Confirming just Hit Enter Since we added a new Repository so we may need to update our APT database as we learned before sudo apt-get update Install Required Packages : Before Proceeding with installing java we need to install a required package to avoid further errors, this is the “python-software-properties” software sudo apt-get install python-software-properties Accept Oracle License : Usually if this is your first time installing Oracle Java then you’ll get Error with exit code of -1, and this is happens since you’re required to accept Oracle License before installing Java, and to do this via Terminal is very easy , i’ll give you the solution, just run this command once echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections Install Java 8 : Now we can Proceed with Installation normally with “apt-get” command to install the package “oracle-java8-installer” sudo apt-get install oracle-java8-installer It may ask you for some confirmations just answer with “Y” for Yes Well it’s Installed Successfully Set Default Java : By default Java 8 will set it self as default but if you have multiple java installation you can change default one using command “update-alternatives” followed by option “–config” to set what you wanna configure followed by “java” sudo update-alternatives --config java Here you can type the number of which installation to be default, or leave blank to keep settings as is, and i can see java 8 is selected by default so i’ll keep it as is. Also you can confirm this by running java version command java -version Move and Setup your Server Files Now things getting more excited .. so let’s stay focused til the end Uploading Files : Since you need to upload your server so let’s zip our “compiled” server, and now to upload it actually you have many ways it’s all about your taste 1st : Using Files Hosting This way is very simple all you need is just upload to a Files Hosting Service , i prefer , or you can use any Hosting you want and go to your Linux Desktop and download it with Firefox (Default Browser for many Linux Distributions) but this way considering that you have Remote Desktop Access to the Linux Server, and you can’t simply use “Windows Remote Desktop” directly since it’s for Windows Only. Note : You can make “Windows Remote Desktop” able to access a Linux Desktop but installing a package called “xrdp”, but actually it’s very bad and slow So if you have a way to remotely access your Linux Desktop go for it , if not then i’ll tell you how you can do this using VNC. Installing VNC Server : VNC Server is a good way to remotely connect to a Linux Desktop and it’s much faster than XRDP, so let’s start installing it sudo apt-get install tightvncserver Once installed let’s start it by issuing this command tightvncserver At First time it will ask you for a password, enter the password and hit Enter Note : VNC support only 8 characters length for password, so even if you entered more than 8 characters it will use only first 8 characters Then it will ask you if you want a view-only password which means with this view only password you can only see the desktop but not interact Now you need to download and install VNC Viewer on your machine to connect to VNC Server where you can Download Here . Once Downloaded and Install, Run it will you get this window, where you want to add your Linux IP or DNS followed by ( :: ) then default port of 590x then click Connect, where x is the id of your Session ID you got in your Linux when started VNC, for Example “SamDev:1” means port is 5901, SamDev:2 means port is 5902 . After Clicking Connect, it will ask you for the Password you set for this Session , Enter it and Click Ok Now you are finally Connected So lets start downloading our Server Zip file By Default it will be Downloaded to the Current Logged User Downloads Folder Note : More way will be added soon Let’s go to User Directory and Downloads Folder cd ~/Downloads Do you still have “unzip” installed ? np if you removed it install it again sudo apt-get install unzip Unzipping a Zipped File : To unzip a file using unzip package it’s really easy unzip Rename File/Directory : Do you need to rename this folder to L2Server for example ? no problem we didn’t mentioned this but it’s very simple since there is no direct command for renaming but instead we use the moving command “mv” mv Live L2Server Create Starting Shells [OPTIONAL] : Well this Step is optional but i prefer to do it like this since original Shell Scripts are running automatically running with no-hup ( No Hanging Up ), which is really good but actually i prefer to do this manually and to have default Shell Scripts beside the custom HUP Scripts specially in development Level. So let’s Create our Shell for GameServer, First head to “gameserver” directory cd ~/Downloads/L2Server/gameserver and then i’ll use nano to create and edit a new Shell Script file . Note : Shell Files should end with .sh extension nano Then Add this Script #!/bin/bash java -Xmx2G -cp ./libs/*:l2jserver.jar net.sf.l2j.gameserver.GameServer Now Save and Exit : CTRL + O > CTRL + X Let’s Head to login Directory and do almost same cd ../login And Create our Login Shell nano and Add this Script #!/bin/bash nice -n -2 java -Xmx512m -cp ./libs/*:l2jserver.jar net.sf.l2j.loginserver.L2LoginServer Save and Exit Again : CTRL+O > CTRL+X Configure Server : Now you need to Configure your server Database Information, which is located in Login : login/config/ GameServer : gameserver/config/ Configure Game Server : Change Directory to Game Server Config Folder cd ~/Downloads/L2Server/gameserver/config Then i’ll use Nano to Edit nano Locate this Configs and Change them with your database name , username and password When you done > CTRL + O to Save, CTRL + X to Exit Configure Login : Change Directory to Game Server Config Folder cd ~/Downloads/L2Server/login/config Then i’ll use Nano to Edit nano Locate this Configs and Change them with your database name , username and password When you done > CTRL + O to Save, CTRL + X to Exit Allow Shells to be Executable : Before you start server you need to know that in Linux you need to run .sh scripts instead of .bat, and by default .sh has no permission to run so we need to give those files permission to run using command “chmod” followed by permissions followed by file name, but changing each file would be time consuming so here is a trick to set a permission for all .sh files in one line by adding a wildcard in file name (*), so let’s first go to gameserver directory cd ~/Downloads/L2Server/gameserver Then we change permissions for .sh files sudo chmod -R a+x *.sh Now our .sh files turned Green which means it’s executable. So let’s do Same with login directory cd ../login sudo chmod -R a+x *.sh Congratulations i think your server now is well configured. Run and Stop Server Well let’s log to our server via VNC as we learned before , remember ? then open your terminal Note : if you wanna do this via SSH, you can use a package called Screen , Find more Run Login Server First we need to go to our login folder of the server cd ~/Downloads/L2Server/login Now we need to execute our Shell Script, you can execute original one or our created one depends on the situation and stability level of your server, so it’s all up to you sudo ./ Great, Login Server is Running, now time for Game Server. Run Game Server Open a New Terminal or a new Tab, File > new Tab or CTRL + SHIFT + T on the New Tab go to gameserver Directory location cd ../gameserver Now time to start gameserver sudo ./ You L2 Server is not up and running Close Game / Login Server : To Close either Login or Game Server just close the terminal or click CTRL+C to close but keep Terminal open. Installing and Configuring Apache2 To get Apache Server or a Web Hosting Server you can simply install LAMPP , it’s full package of Apache, PHP and MySQL together, but personally i don’t like to go this way, since i always prefer to go with non-preconfigured stuff to be able to have full control over every little detail, also it will be good for you to know how everything work and how they linked smoothly together. Install Apache2 : Installing Apache2 is same as installing any package we did before sudo apt-get install apache2 Apache2 Installed Successfully now let’s Install PHP as well . Install PHP 7 : In this Guide i’ll install PHP 7, but you can install older versions if you want, it’s just same procedures .. First we need to add the Repository that has what we need sudo add-apt-repository ppa:ondrej/php Now let’s Update our Repositories Database sudo apt-get update After that we gonna install PHP 7 along with some PHP Extensions needed commonly : sudo apt-get install php7.0 php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0-mysql php7.0-fpm php7.0-curl php7.0-gd php7.0-bz2 Here i’m installing PHP 7.0 with some extra PHP library all in one command, then we need to host our site… Host your Site and Domain First of all you need to have your domain which can be bought from any provider, i would suggest , very good services, skilled support team and really fast orders and problems processing. For this guide we will try to host the domain “” on our Linux Server, so first go to your domain provider panel , in this case it’s GoDaddy, so go to your domains and click “DNS” : Now we need to modify the “A” record When you get into edit mode, add your server IPv4 into Value/Points to. then save. Sometimes this modification takes time to propagate but in GoDaddy as i been using it for many years i found that it’s one of the fastest, most of times it takes less than 10 seconds to take effect. so let’s see if our domain working and connected to our server Yeah, as it says “It works!” … But why it show the main page of server, we need it to have a separate content … well then let’s do this Create Apache2 Host : To Create an Apache2 Host we need to follow few step, by creating the directory that will contain our site files, then we create a configuration file for this site to tell Apache how this site will work and where its files located, then we have to enable it. So First let’s create a directory that will host our site , by default Apache look in files inside Directory /var/www , so i’ll create a directory on the path of /var/www/ , and in this case we gonna use the command “mkdir” to make a directory with option “-p” to automatically create all parent directories required for us. sudo mkdir -p /var/www/ Maybe now we need to change Owner and Permission to avoid further problems sudo chown -R $USER:$USER /var/www/ sudo chmod -R 755 /var/www/ Now we need to create the configuration file, so let’s start by copy the default configuration file. sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/ We need now to edit that configuration file … sudo nano /etc/apache2/sites-available/ Note : All Lines starting with ( # ) is just a comments, so it wont affect anything, you can remove it or leave it , doesn’t matter At this moment we need to modify this file to look like this CTRL+O to Save, CTRL+X to Exit … One more step to go .. we need now to Enable our new site using command a2ensite (Apache2 Enable Site). sudo a2ensite To Take Effect we need to restart our Apache2 Server sudo service apache2 restart Let’s Create a simple php file to test … sudo echo "<?php echo 'Greetings from PHP';?>" > /var/www/ So time to test … Yes, it's working :) Thanks for taking a look into this guide and i hope it's useful for someone out there ... lemme know if you got question and i'll update this topic soon with more parts Thanks and Regard,
  9. Hello, We are looking for Java developer for our Lineage 2 Project. Qualifications Should have experience working with java and solving complicated problems using java or should be dedicated to learning java. Should be able to communicate in English. Should be able to work with task management systems. Will receive A part of revenue from project. Experience working on a real project. in case of interest register here: after registration our representative will contact you shortly.
  10. Hello Cheaters, It's my First Topic in this great forums, that's why i decided to try to help the community as i got help here before , by creating some tutorials specially for Backend (Java / C# if needed / PHP), and forgive me if this breaking any rules and let me know as soon as you notice that to correct :) . So let's cut that talk and get started. Table of Contents : What is Voiced Commands about ? For which Pack/Version is this tutorial ? Create your first Command Register your Command into GameServer What is Voiced Commands About : Well, Voiced Commands are that commands that Player can use into chat input and it's starting with a dot (.) , for example (.dressme, .join , .register ....... etc). and we usually add such commands to private servers to make life easier for players like adding a command which will convert player adena to Goldbars, another one for teleporting to custom location ..... and so on. For which Pack/Version is this Tutorial : Screenshot, Codes and the one i work on is a my private modified pack that's based on L2JServer for Hi5, but to be honest it should be working fine with all Packs if you can find some files locations like and , so if you have a search skills then you can apply it to any pack and any chronicle and we will discuss that, dun worry. Com'on this is too much talk why we i don't just shut up get started :gusta: . Create your first Voiced Command : We can create our command code in two places (Server Pack or Data Pack), personally i prefer add it to Data Pack Scripts, but for the sake of simplicity and to make it easy for you to implement it in different packs and older version of L2 i'll do it this time in Server Pack. Step 1 : So go to your Server Pack Java Source and fine a Package called com.l2jserver.gameserver.handler or you can create your own package if you can work with Java well. once you get to that location (or your own package), right click on that > New > Class Step 2 : - Choose a Name for your Voiced Command Handler File, i'll name it ServerInfoVoicedCommandHandler , since i will make this command show player the server info document , well it's not useful but this tutorial meant for educations purpose not a product, so you can use your imagination and make your amazing command :) - Clear what's inside Superclass text - Click on Add in front of Interfaces section and Search for IVoicedCommandHandler, and when u find it Click Ok Step 3 : Once our class Created we will notice that we have 2 important sections (methods), useVoicedCommand and getVoicedCommandList. useVoicedCommand : is the method of block of code that will execute when a player use our command, so this is where our code will be getVoicedCommandList : is where our server will look to know which command(s) this file/class can handle . Note : if you are not familiar with Java , here is a note .. we usually add the code of any method between the curly-braces ( { } ) and any thing between { } we call it code block, if any need a guide for Java let me know and see if i can help :) So inside getVoicedCommandList code block we need to add this code : return new String[] {"serverinfo"}; this line of code will tell Game Server that this class can handle voiced command .serverinfo Step 4 : Now we need to Implement the actual feature of this command, so we need to write the right code that do that job, in our case we need to show and html file to the player this file can contain server info, so we need first to create an html file into our data/html/custom folder and i'll name it serverinfo.html, and here is a simple code that we can test it with . <html><title>L2JSamDev Info</title> <body> <center> <br><br> <center> <img src="L2UI_CH3.herotower_deco" width=256 height=32><br> <font name="hs9" color="00aff0">Hello This is the Server Info</font><br> <img src="L2UI_CH3.herotower_deco" width=256 height=32><br> </center> </body> </html> Step 5 : We need to add the code to useVoicedCommand method that show this html document to user, and here is the simplest code for this task //Get Html Content String documentContent = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/custom/serverinfo.html"); //If not Found then Stop if(documentContent == null) {return false;} //If Document Found then Prepare a new Message to Send it to Player NpcHtmlMessage message = new NpcHtmlMessage(); message.setHtml(documentContent); //Send Document to Player activeChar.sendPacket(message); //Well it's Success return true; Note : if you get errors like HtmCache or NpcHtmlMessage cannot resolve, just hover over it and click Import HtmCache/NpcHtmlMessa So our final Code will look like : package com.l2jserver.gameserver.handler; import com.l2jserver.gameserver.cache.HtmCache; import; import; public class ServerInfoVoicedCommand implements IVoicedCommandHandler { @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) { //Get Html Content String documentContent = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/custom/serverinfo.html"); //If not Found then Stop if(documentContent == null) {return false;} //If Document Found then Prepare a new Message to Send it to Player NpcHtmlMessage message = new NpcHtmlMessage(); message.setHtml(documentContent); //Send Document to Player activeChar.sendPacket(message); //Well it's Success return true; } @Override public String[] getVoicedCommandList() { return new String[] {"serverinfo"}; } } Step 6 : - UPDATED as suggested By @meIron ( Thanks for Suggestion :) ) Just one more task to be good to go and test our new command, we need to register this command to the main VoicedCommandHandler, simple go to file which usually located at com.l2jserver.gameserver.handler or com.PACKNAME.gameserver.handler and in constructor which is the method called VoicedCommandHandler() add this like of code AFTER : _datatable = new HashMap<>(); Add this registerHandler(new ServerInfoVoicedCommand()); in the end it will look like Tip : you can register it in another way by adding it to in Datapack but we seek simplicity in this tutorial Step 7 : Let's Build that Project and Log in Game to test it Voila, Our Useless command Working :-beep- yeah: If you have any question or need another java tutorial or even have an idea to implement and wonder how it could be just lemme know, maybe i can help :)
  11. Hello guys, I'm new to this hobbie and I was wondering if It's possible to add a new cutscenes IG for Quests or anything you want... I searched everywhere but with not luck for informations, if you know any method please let me know!!! Thanks in advance.
  12. Hello, I've never used the board to ask. In Gracia Keucereus Alliance Base area the Quest 10272 Light Fragment is broken in the part where we speak to Npc Soldier Ginby ID 32566. Below, I took snapshots of the specific part of the quest which needs completion. Below, theres the code of the 32566-4.html file (with pay variable): Then, theres the Java condition handler of the enviaronment variable (file: This leads here (32566-05.html): Next step is 32566-06.html: And the probles lies right above here. There is no Java condition handler of the enviaronment variable enter and case 1 GINBY is an empty condition: Can someone help to fix this? I 've never seen this quest before so I don't know how it normally runs after Gimly NPC. Thanks MxC!!!!!!!!! !!
  13. hello guys i would like to know if there is a command like this //titlecolor that changes the color of a character's title so i can put it in my project thanks in advance
  14. hello guys once again i have run into a problem and more specificly in this one does someone know how to fix this :D D thanks in advance
  15. hi, i have a question about ( -> ) on java 8. this arrow is what code in java 7? Sorry for bad en, and thanks for who can help me.
  16. I have spent days on this forums, and others trying to find my answer but I can not find my answer. So, now I am putting up a thread to see if I can get some directions or pointers that will direct me the right directions. I am working on development of Lineage 1 server, the version is same as one is out in Korea atm. I am looking for a game launcher for Lineage1, I thought that maybe since L2 also is coded in Java, and they used to use .bin file to launch there game some of the one l2 launchers may work. I tried that, but I do not know it failed and I just keep getting all sorts of errors. BTW I am not a coding and just doing this to learn, no intention to make it a real private server or anything, as the I do not have the time management for that. Since all my options for creating a game launcher failed, I went on to look for dissembling the original .exe file and perhaps I could change the ip address of the launcher to match my needs. Well, I found the ip address on the launchers, and matter of fact there was so many of them. I tried to changed the ip address using CFF explorer, but the address didn't change. Then I tired to open it up with IDA PRO, and tired to change it in there. Also got an error, I believe it write error. So, now I am need of help on how to make the game launch with a good launcher. I do not need someone to make a guide for me, as I am capable of searching and trying things on my own. Just some pointer or what I should be doing would be grateful. Thank you for reading my concerns.
  17. Hello Mates, Here we back again with another Lineage Development Tutorial, this time we will learn how to work and create a Java NPC, Well what is this ? NPC is stands for Non-Playable Character, which is a Character in server that provide some help or services like Buffer, GateKeeper, Agumenter ….. etc, y’all know what NPC is i guess , so let’s get to the point. Table of Contents : Tools and Requirements Work With NPC XML Files Register your new NPC Type Create your Java NPC Type Class Build and Test Tools and Requirements : - Your favorite XML Editor (I Prefer Notepad++ / Download) or you can use Eclipse for that - Eclipse or Netbeans for Java Edits and Builds ( Eclipse Download – Netbeans Download ) - A Server Pack (for this tutorial i use Private Pack Based on L2JServer – Download) - Lineage 2 Client (I will use High Five Client, but you can Adapt it to any Chronicle Except for XML Part i guess) Work with NPC XML Files : Okay Before we go any further we need to let the server know that we have a new NPC and tell it’s type, id, stats …. etc, to do this you need to go to this path of game/data/stats/npcs inside your server files, there you’ll find some XML files, you can create your own XML file here or go to the folder custom/ and there you’ll find an XML file named custom.xml , i’ll put my new NPC there for the sake of simplicity . Open this File with your favorite Editor (Notepad++ in my case) and go to the end of the file, you’ll see something like </list> , Add this code just before it : <npc id="750002" displayId="32140" name="MxC Guide" usingServerSideName="true" title="Java NPC" usingServerSideTitle="true" type="L2MxCNPC"> <collision> <radius normal="11" /> <height normal="22.25" /> </collision> </npc> We will end up with something like this : Let’s Break it down and focus on few parts of this code : - (id=”750002″) : this is the ID of your new NPC that you will use it to spawn, so make sure it’s unique and try to find your unique numeric schema to avoid conflicts - (displayId=”32140″) : this indicated how your NPC will look like, it can be considered as Template Id, and of course you can change it to the template your want - (name=”MxC Guide”) : it’s the NPC name that will appear - (title=”Java NPC”) : is the NPC Title - (type=”L2MxCNPC”) : it’s the most important parameter since it’s declaring what type this NPC will be and will look for that Type in your java files, so that’s they type we will be Creating L2MxCNPC So you can manipulate this values according to your needs, but be away of displayId since the collision parameters are very vary based on the NPC Template you use. Register Your new NPC Type : Now we need to register our new Type as we said before our type for this tutorial will be L2MxCNPC, so we will register L2MxCNPCInstance as a type, and to do this you need to go to your server java files and find the package called com.l2jserver.gameserver.enums or could be com.PACKNAME.gameserver.enums , it doesn’t really matter since it can be vary from Pack to Pack but i use Official Structure. Inside this package you will find a Java File called . Open this Java File and find the Section named Custom, and add this code at the beginning of this section : L2MxCNPCInstance(L2Npc), So it will look like this : Now we have our new NPC Instance Type Registered, so lets move to the next step. Create Your Java NPC Type Class : Here we got to the fun part, to create your NPC Class find a package with name or , name can be vary from pack to pack but almost same structure. Step .1 : Right Click on this Package then choose >New > Class You’ll get a “New Java Class” window, we need to set some options there, First of all set name to L2MxCNPCInstance , second Click on Browse in front of Superclass input, you’ll get another window , search for L2Npc, and when you find it just click on it and hit Ok Step .2 : Now we need to add what’s called Constructor which is a block of code that Execute at the beginning of initialization of the Type, so just add this code inside your new class (between open and close curly braces of your class { } ) public L2MxCNPCInstance(L2NpcTemplate template) { super(template); setInstanceType(InstanceType.L2MxCNPCInstance); } So it will look like : as you can see here we set instance type to L2MxCNPCInstance which we registered in file. Step .3 : Now what we need to do is to override 1 or 2 methods depends on NPC functionality, by overriding we mean that we are replacing the main functionality of L2Npc (since our type extends L2Npc) with a new functionality or implementation, the first method we need to override is showChatWindow which responsible to show the chat window of the NPC to the player when interact with it. To override this method just go to below L2MxCNPCInstance method (Constructor) and add this code : @Override public void showChatWindow(L2PcInstance player, int val) { } Well, we need to add some java code inside this method to show our HTML Document, but guess what , we didn’t created our HTML Document yet, so we don’t we go and create it now …. Step .4 : Go to your game html folder (usually at game/data/html ) and create an HTML document there or in any sub folder, for me i’ll create mxcnpc.html in custom subfolder, and initially i’ll put that html code in : <html><title>L2JSamDev MxC NPC</title> <body> <center> <br><br> <img src="L2UI_CH3.herotower_deco" width=256 height=32><br> <font name="hs9" color="00aff0">Hello From MxC Java NPC</font><br> <button action="bypass -h npc_%objectId%_MyCommand" value="Click Me (ByPass)" width=130 height=30 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <br> <img src="L2UI_CH3.herotower_deco" width=256 height=32><br> </center> </body> </html> Of course you can do the HTML code / design you want, but this is just for demonstration, but in real life, you’re free to do any HTML design you want. Step .5 : Go back to your Java file and add this code to the showChatWindow method, that we overrided before : //Try to load the HTML document String content = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/custom/mxcnpc.html"); //If not found ? if(content == null) { //Set a Fallback Content content = "Sorry we cannot find your document for MxC NPC"; } //Create a new NPC Message and set Object ID NpcHtmlMessage message = new NpcHtmlMessage(getObjectId()); //Set Message Content message.setHtml(content); //Replace %objecId% in HTMl with Real Object ID message.replace("%objectId%", String.valueOf(getObjectId())); //Send HTML to Player player.sendPacket(message); Step .6 : Well I Guess we are ready to go, but our new NPC actually do nothing, just showing an HTML, so what we can do to give this npc some power ? …. What makes NPC much powerful and full of features is what called ByPass which means it’s the ability to let players able to click on some Buttons or link and with that click they will send a command to the server, and in Java side we implement the feature or the action that will be taken when the player bypass any command. If you look closely to the HTML Code we’ve created you will notice this line : <button action="bypass -h npc_%objectId%_MyCommand" value="Click Me (ByPass)" width=130 height=30 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> Focus on action parameter here it’s equal to ( bypass -h npc_%objectId%_MyCommand ) this means by clicking on this button player will pass a command of MyCommand to the Java NPC handler which has the valid Object ID . but how we can handle commands bypassed by player using our new NPC ? It’s simple, all we need is to override another method which is onBypassFeedback .. and to do so add this code below showChatWindow method : @Override public void onBypassFeedback(L2PcInstance player, String command) { } Here i’ll add some little simple code to implement the feature of trading 50KK Adena for 1K Clan Reputation if you are the clan leader, so add this code to on onBypassFeedback method : //Check for Player and Last NPC if Same if(player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != getObjectId()) { return; } if(command.startsWith("MyCommand")) { //Check if Player is the clan Leader if(player.isClanLeader()) { //Is he has 50kk Adena ? if(player.getAdena() >= 50000000) { L2Clan clan = player.getClan(); //Give Reputation clan.addReputationScore(1000, true); //Take Adena player.getInventory().reduceAdena("Clan Requtation", 50000000, player, this); player.sendMessage("Your Clan has Earned 1000 Rep for 50 Millions Adena"); } else {player.sendMessage("You don't have Enough Adena");} } else {player.sendMessage("You are not a Clan Leader");} } of course you can maintain and make the code much smarter, but we seek simplicity to be easy to any one to start creating amazing Java NPCs . Step .7 : Now our NPC Java class will look like : package; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.enums.InstanceType; import com.l2jserver.gameserver.model.L2Clan; import; import; import; public class L2MxCNPCInstance extends L2Npc { public L2MxCNPCInstance(L2NpcTemplate template) { super(template); setInstanceType(InstanceType.L2MxCNPCInstance); } @Override public void showChatWindow(L2PcInstance player, int val) { //Try to load the HTML document String content = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/custom/mxcnpc.html"); //If not found ? if(content == null) { //Set a Fallback Content content = "Sorry we cannot find your document for MxC NPC"; } //Create a new NPC Message and set Object ID NpcHtmlMessage message = new NpcHtmlMessage(getObjectId()); //Set Message Content message.setHtml(content); //Replace %objecId% in HTMl with Real Object ID message.replace("%objectId%", String.valueOf(getObjectId())); //Send HTML to Player player.sendPacket(message); } @Override public void onBypassFeedback(L2PcInstance player, String command) { //Check for Player and Last NPC if Same if(player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != getObjectId()) { return; } if(command.startsWith("MyCommand")) { //Check if Player is the clan Leader if(player.isClanLeader()) { //Is he has 50kk Adena ? if(player.getAdena() >= 50000000) { L2Clan clan = player.getClan(); //Give Reputation clan.addReputationScore(1000, true); //Take Adena player.getInventory().reduceAdena("Clan Requtation", 50000000, player, this); player.sendMessage("Your Clan has Earned 1000 Rep for 50 Millions Adena"); } else {player.sendMessage("You don't have Enough Adena");} } else {player.sendMessage("You are not a Clan Leader");} } } } So let’s Build our Project and Login into our server to check what we got … – Lets Spawn our NPC – and Try to interact with …. – Finally let’s Check if our command work Yeah, Finally it's working ... :) Sorry if any mistakes and if you got any question or need a specific Guide just let me know Thanks Everyone.
  18. Hello there, Spartan here. I am looking for step by step, guide by guide, point by point guide to make my own dream come true, my own dream of Lineage 2 Interlude server. I am absolutly newbie in these things, i am playing the game by C3, but never been interested in creation of my own server. I want to know where i must start, how i must start, what i must pay for and after all how i can input my dream inside the already running server. I want everything to be based on JAVA, because i know a little that is more customable and maybe easier...idk i hope you tell me those things. Please send me links, guides, ready project to buy (customable) and etc. Thank you and please do not trash talk on me, because of my topic or that i am newbie.
  19. Hello and welcome to our preview topic, L2-R is a c4 project that lacks from gameplay knowdays. Our goal is to bring back the old "Lineage2" meaning , with a little more relaxed features and not so intense farm combining some fancy appereance. So lets start about what the project offers: ========== Rates ========== Experience: 35 Skill Points : 35 Drop Items: 5 Adena : 200 Raid Drop : 1 Spoil : 5 ========== Enchant ========== Safe : 3 Max : Unlimited Chance of Normal : Retail (58%) Chance of Blessed : Retail (58%) ========== General ========== 24 Buff Slots + 10 Debuff slots Olympiad is retail like just classed based participation is 10 players and non classed 2 Auto Pickup Enabled No Dualbox rules Skill working decently 1st / 2nd / 3rd classes are free ========== NPCs ========== Player Shop - Anything you will need , Making S/A to your S grades, Unseal S grade Equipment etc. No worries or waiting for mammon spawns. Gatekeeper - Retail Gatekeeper with a small modification of a new option [Main Areas & Hunting Grounds ] Only the critical areas are imported like , home Towns and Boosted Exp - Farm Areas Jepetto - L2Revenge Special Trader Exchange your raid tokens for the almighty Titanium Armor or give your adenas for the Revenge weapons [see more details on custom section] Town Buffer [ Only basic buffs + Ressists Included ] - There is no cov/renewal/siren etc. ========== Custom ========== Titanium Armor : Heavy:CON+3, STR+3 ,P. Def. +22%, maximum HP +1000 ,Atk. Spd. / P.Atk. +6%, M. Def. +25% Light: Maximum HP +1500 Maximum MP +500 Atk. Spd. / P.Atk. +12% P. Def. +10% DEX +3 STR +3 Robe: Maximum MP +1000 Casting Spd. +20% M. Atk. + 20% P. Def. +18% M. Def. +15% INT +2 MEN -2 Each part will cost 2 Raid Tokens droppable from several bosses 76lvl+ on the map and Titanium Ores + Armor Tokens Titanium Ores can be found via Raids or Craft Epic - Dynasty Weapons: they are Kamael Weapons [Classic Dynasty with hero effect and color glow) and they have retail hellbound stats] Tattoo: Giving just some stats... For example Soul gives +20 Atk Speed and avadon +25 casting speed cost 5 million adena each ========== Boosted Areas ========== DVC - Boosted Exp and 25% to get Armor Token from Monsters [spoil will have 40% Chance for Armor Tokens] Varka - Ketra Boosted Adena Drop and 40% to get Armor Token from Monsters [spoil will have 50% Chance for Armor Tokens] Forge of the Gods only boosted Adena *Boosted Exp wont give you levels early that means you get a little more Experience than usual on that zone, that means that you can get better Exp on better zones ========== Raidbosses and Droplist ========== Ocean Flame Ashakiel [Retail like respawn ] x3 Raid Tokens Fire of Wrath Shuriel [Retail like respawn ] x3 Raid Tokens Last Lesser Giant Glaki [Retail like respawn] x4 Raid Tokens x2 Titanium Ore Hestia, Guardian of Deity of Hot Springs [Retail like respawn] x4 Raid Tokens x2 Titanium Ore Longhorn Golgoda [Retail like respawn] x6 Raid tokens x1 Titanium Ore Cherub Galaxia [Retail like respawn] x10 Raid Tokens x3 Titanium Ore All Ketra/Varka Raidbosses [Retail like respawn] x10 Raid Tokens x1 Titanium Ore ========== GrandBosses =========== All grandbosses time will be retail like [Giving only the Epics] ========= Subclass ========= Reagent pouch quest item on shop. ========== Nobless ========== Ring and necklace quest items on shop that is it for now. More to come... site will be , will be up in the upcoming weeks
  20. Hello people i am looking for a person who knows java and could help me with one small problem that our project people can't fix, is there anyone here who would be kind with helping to fix the problem that we have with multisell in shops? if there is please reply to this topic or privately message me i would really appreciate if we could find a person who knows java and would be willing to help us for free! PLEASE NEED HELP BADLY!
  21. Im looking for auto vote reward code hop/topzone for Gracia Final
  22. Hello,im selling L2J PvP Server files,based on l2jfrozen sources,live server was online with 300~ real online players. Server was stable without any "bug",everything working as it should for a pvp server,nothing to worry about. Server is also re-designed from the server that i was using. Based on No-Custom Gameplay Balance has been configured for retail class-items balance. It can be sold as: Pack-Patch-Backup Pack-Patch-Backup-Source Pack-Patch-Backup-Source,New unique website,never used Price will be not high as well. A small support can be given once buying the files,for installing the server (for example). Features/questions will be given at skype. Saruman210
  23. These tutorials will introduce you to Java programming Language. You'll compile and run your very own Java application, using Sun's JDK. It's extremely easy to learn java programming skills, and in these parts, you'll learn how to write, compile, and run Java applications. Before you can develop corejava applications, you'll need to download the Java Development Kit (JDK). Java If-Else Statement The if-else class of statements should have the following form: if (condition) { statements; } if (condition) { statements; } else { statements; } if (condition) { statements; } else if (condition) { statements; } else { statements; } All programming languages have some form of an if statement that allows you to test conditions. All arrays have lengths and we can access that length by referencing the variable arrayname.length. We test the length of the args array as follows: Source Code // This is the Hello program in Java class Hello { public static void main (String args[]) { /* Now let's say hello */ System.out.print("Hello "); if (args.length > 0) { System.out.println(args[0]); } } } Compile and run this program and toss different inputs at it. You should note that there's no longer an ArrayIndexOutOfBoundsException if you don't give it any command line arguments at all. What we did was wrap the System.out.println(args[0]) statement in a conditional test, if (args.length > 0) { }. The code inside the braces, System.out.println(args[0]), now gets executed if and only if the length of the args array is greater than zero. In Java numerical greater than and lesser than tests are done with the > and < characters respectively. We can test for a number being less than or equal to and greater than or equal to with <= and >= respectively. Testing for equality is a little trickier. We would expect to test if two numbers were equal by using the = sign. However we've already used the = sign to set the value of a variable. Therefore we need a new symbol to test for equality. Java borrows C's double equals sign, ==, to test for equality. Lets look at an example when there are more then 1 statement in a branch and how braces are used indefinitely. Source Code import*; class NumberTest { public static void main (String[] args) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader( ) ); String inS; int num; System.out.println("Enter an integer number"); inS = stdin.readLine(); num = Integer.parseInt( inS ); // convert inS to int using wrapper classes if ( num < 0 ) // true-branch { System.out.println("The number " + num + " is negative"); System.out.println("negative number are less than zero"); } else // false-branch { System.out.println("The number " + num + " is positive"); System.out.print ("positive numbers are greater "); System.out.println("or equal to zero "); } System.out.println("End of program"); // always executed } } All conditional statements in Java require boolean values, and that's what the ==, <, >, <=, and >= operators all return. A boolean is a value that is either true or false. Unlike in C booleans are not the same as ints, and ints and booleans cannot be cast back and forth. If you need to set a boolean variable in a Java program, you have to use the constants true and false. false is not 0 and true is not non-zero as in C. Boolean values are no more integers than are strings. Else Lets look at some examples of if-else: //Example 1 if(a == { c++; } if(a != { c--; } //Example 2 if(a == { c++; } else { c--; } We could add an else statement like so: Source Code // This is the Hello program in Java class Hello { public static void main (String args[]) { /* Now let's say hello */ System.out.print("Hello "); if (args.length > 0) { System.out.println(args[0]); } else { System.out.println("whoever you are"); } } } Source Code public class divisor { public static void main(String[] args) int a = 10; int b = 2; if ( a % b == 0 ) { System.out.println(a + " is divisible by "+ ; } else { System.out.println(a + " is not divisible by " + ; } } Now that Hello at least doesn't crash with an ArrayIndexOutOfBoundsException we're still not done. java Hello works and Java Hello Rusty works, but if we type java Hello Elliotte Rusty Harold, Java still only prints Hello Elliotte. Let's fix that. We're not just limited to two cases though. We can combine an else and an if to make an else if and use this to test a whole range of mutually exclusive possibilities. Lets look at some examples of if-else-if: //Example 1 if(color == BLUE)) { System.out.println("The color is blue."); } else if(color == GREEN) { System.out.println("The color is green."); } //Example 2 if(employee.isManager()) { System.out.println("Is a Manager"); } else if(employee.isVicePresident()) { System.out.println("Is a Vice-President"); } else { System.out.println("Is a Worker"); } Source Code // This is the Hello program in Java class Hello { public static void main (String args[]) { /* Now let's say hello */ System.out.print("Hello "); if (args.length == 0) { System.out.print("whoever you are"); } else if (args.length == 1) { System.out.println(args[0]); } else if (args.length == 2) { System.out.print(args[0]); System.out.print(" "); System.out.print(args[1]); } else if (args.length == 3) { System.out.print(args[0]); System.out.print(" "); System.out.print(args[1]); System.out.print(" "); System.out.print(args[2]); } System.out.println(); } } I wish you find this guide helpful, Thanks!
  24. Hey there if somebody is looking for some java dev work, I need some help. (pre compile real development, new code) should be fairly easy stuff, we can work together. Work will be paid via paypal or paysafe (if you want) add me on skype: sannehwat first job is simple and easy (for testing) there will be a lot more work opportunity in the future.