Search the Community

Showing results for tags 'Code'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Articles

Forums

  • General Zone
    • Announcements and News
    • Newbies Introduce Urself
    • Maxcheaters Competitions & Events
    • Votes/Polls Area
    • Report Section
  • Lineage II General Section
    • General Discussion [English]
    • Request Support [English]
  • Lineage II Hacks,Cheats and Bots
    • Hacks & Cheats [English]
    • Request Hacks & Cheats [English]
    • Botting [English]
    • Request Botting [English]
  • Lineage II Private Servers
    • L2MAD.WS - Classic Interlude x1200
    • Private Servers
    • [Previews] L2 Private Servers
    • Clans and Alliances
  • Lineage II Marketplace
    • Marketplace [Items & Chars]
    • Marketplace [L2Packs & Files]
    • Marketplace [Powerlvl & Support]
  • Lineage II OFF Server Development
    • Server Development Discussion [L2OFF]
    • Request Server Development Help [L2OFF]
    • Server Shares & Files [L2OFF]
  • Lineage II Java Server Development
    • Server Development Discussion [L2J]
    • Request Server Development Help [L2J]
    • Server Shares & Files [L2J]
    • Private Projects [L2J]
  • Lineage II Client Development
    • Client Development Discussion
  • MMO Games
    • League of Legends
    • World Of Warcraft Area
    • Other Multiplayer Games
  • General Section
    • General Marketplace
    • Consoles/Mobiles/PDA Gaming Zone
    • Webmasters Zone
    • Hacking/Coding Zone
  • Graphics/GFX Zone
    • Graphics/GFX General Discussion
    • Graphics/GFX Showcase
    • Graphics/GFX Resources/Tools
  • VIP/SVIP/Donators Zone
    • VIPs/Donators Discussion
    • VIPs Lineage II
    • VIPs [GFX] Zone
    • VIPs Download Area
  • MaxCheaters Corner
    • Tech/World News
    • Off-Topics
    • Spam Topics

Found 11 results

  1. Hey guys i have 1 problem, when i add 1code or i change something in eclipse dosnt change in main pack any help? :/. i have jfrozen 1132 (i change the jfrozen-core on libs but nothing).
  2. Kalispera, exw provlima meta java codes ta pernaw ta kano build pernw to jfrozen-core-jar apto zip pou mou ftiaxni to pernaw sto pack mou alla oi alages den ginonte :S mporei kapios na voithisi meto ti kano lathos? xrisimopio tin teleytaia ekdosi jfrozen 1132 (revision=1132 builddate=08-11-2017 04:47:13 μμ)
  3. Kalispera, psaxnw kwdika gia na mporo na exw alo enchant se kapia sigekrimena items epsaksa sto forum alla den vrika kati paromio gia jfrozen pack opws episis kai giaton maximilian nane ola ta sub vrika mono gia alla client-packs mipos exei dei kapios kati?.euxaristw ek ton proteron
  4. As title say.. Source 4Shared Direct Link for DP Direct Link for Core Enjoy fuckers..
  5. Hello members, Since this section is rly dead and i always like to share things here is another one.. How is this working? First of all you have to create your personal l2 page in facebook. After that search in facebook settings to change the url-name of your page to www.facebook.com/L2Tests and not www.facebook.com/HAW#$A#@ Create your personal Access Token here It will be generated as short-lived token (means that it will expire in about an hour). change it to long-lived here (means that it will expire after 2 months ,maybe more) Download facebook api restfb-1.46.0 Add it in your sources (i will not provide how to...) Implement the code i'm giving Source / Files Source Code Htmls/Database Config Dont forget to add the new admin commands in adminCommands.xml <aCar name="admin_fbreload" accessLevel="7"/> <aCar name="admin_facebook" accessLevel="7"/> <aCar name="admin_showPosts" accessLevel="7"/> <aCar name="admin_delPost" accessLevel="7"/> <aCar name="admin_addPost" accessLevel="7"/> <aCar name="admin_turnFb" accessLevel="7"/> <aCar name="admin_clean_facebook_database" accessLevel="7"/> <aCar name="admin_fb_auto_announce" accessLevel="7"/> (these commands are used for all actions , you can use these actions direcly by writing the command with the necessary tokens) Videos Admin view User view More explaination? If you successfully passed all the above moves: Set your facebook page name in FacebookPageName in facebook.properties Set your Access Token in FacebookApiToken //facebook command will display the panel you just saw /facebook command for users You can add/remove any of the posts that are inside of your page. You can set an automatic reward: You set the number of likes you want to collect from the sum of all the pages you have set, item id, item count. When the likes will be >= the num you set, then all the online players will get the reward you set. The players have to like All the posts you added to take the reward. I am mostly using usercommand handlers , if you will too, then don't forget to add one more line in your commandname-e.dat and edit the id of the command (in FaceBook.java) to your id if you have voiced you can add it there. ================================================================================== This code is made for aCis 371 rev. Note: I havent check it in live server , i just made it in localhost so you have to give a try in my shitty code and check if any bug will appear. If anyone wants the buttons (the blue ones) you can get the utx from here (Thanks Sinister Smile) If someone finds any bug please let me know, i can help. Thank you!
  6. Hello i found a code in another forum and i post here. working fine in acis 365 Gameserver: http://pastebin.com/Pc2ZxS1L gameserver http://pastebin.com/ArftpRKH DataPck some pictures
  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="http://www.w3.org/2001/XMLSchema-instance" 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 RequestExTryToPutEnchantTargetItem.java 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 UseItem.java 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. I come to share a package that I can not finish so I do not have much information I ask for your help to finish. All events start normally TvT does not want to register for the event then the event is canceled CTF when clicking on npc the char hangs DM did not test It's not phoenix engine https://pastebin.com/v30gpeLW
  9. - long milliToEnd; - if (_period == 0) - milliToEnd = getMillisToOlympiadEnd(); - else - milliToEnd = getMillisToValidationEnd(); - - LOGGER.info("Olympiad System: " + Math.round(milliToEnd / 60000) + " minutes until period ends"); - - if (_period == 0) - { - milliToEnd = getMillisToWeekChange(); - - LOGGER.info("Olympiad System: Next weekly change is in " + Math.round(milliToEnd / 60000) + " minutes"); - } + long milliToEnd; + if (_period == 0) + milliToEnd = getMillisToOlympiadEnd(); + else + milliToEnd = getMillisToValidationEnd(); + + double numSecs = (milliToEnd / 1000) % 60; + double countDown = ((milliToEnd / 1000) - numSecs) / 60; + final int numMins = (int) Math.floor(countDown % 60); + countDown = (countDown - numMins) / 60; + int numHours = (int) Math.floor(countDown % 24); + int numDays = (int) Math.floor((countDown - numHours) / 24); + + LOGGER.info("Olympiad System: " + numDays + " days, " + numHours + " hours and " + numMins + " mins. until period ends"); + + if (_period == 0) + { + long milliToEnd2 = getMillisToWeekChange(); + + double numSecs1 = (milliToEnd2 / 1000) % 60; + double countDown1 = ((milliToEnd2 / 1000) - numSecs1) / 60; + final int numMins1 = (int) Math.floor(countDown1 % 60); + countDown1 = (countDown - numMins1) / 60; + int numHours1 = (int) Math.floor(countDown1 % 24); + int numDays1 = (int) Math.floor((countDown1 - numHours1) / 24); + + LOGGER.info("Olympiad System: Next weekly change in " + numDays1 + " days, " + numHours1 + " hours and " + numMins1 + " mins."); }
  10. Hello here is a gode for this http://postimg.org/image/gk2nw63l3/ #P L2jFrozen_GameServer Index: head-src/com/l2jfrozen/Config.java =================================================================== --- head-src/com/l2jfrozen/Config.java (revision 986) +++ head-src/com/l2jfrozen/Config.java (working copy) @@ -2891,6 +2891,8 @@ public static int GM_OVER_ENCHANT; public static int MAX_ITEM_ENCHANT_KICK; + public static boolean ENABLE_ENCHANT_ANNOUNCE; + public static int ENCHANT_ANNOUNCE_LEVEL; //============================================================ public static void loadEnchantConfig() @@ -3196,6 +3198,8 @@ MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0")); GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0")); + ENABLE_ENCHANT_ANNOUNCE = Boolean.parseBoolean(ENCHANTSetting.getProperty("EnableEnchantAnnounce", "False")); + ENCHANT_ANNOUNCE_LEVEL = Integer.parseInt(ENCHANTSetting.getProperty("EnchantAnnounceLevel", "16")); } catch(Exception e) { Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 986) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy) @@ -25,6 +25,7 @@ import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.base.Race; +import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.EnchantResult; import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate; @@ -301,6 +302,7 @@ int chance = 0; int maxEnchantLevel = 0; int minEnchantLevel = 0; + int nextEnchantLevel = item.getEnchantLevel() + 1; if(item.getItem().getType2() == L2Item.TYPE2_WEAPON) { @@ -565,6 +567,9 @@ sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); sm.addItemName(item.getItemId()); activeChar.sendPacket(sm); + + if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0) + Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel); } else { @@ -572,6 +577,9 @@ sm.addNumber(item.getEnchantLevel()); sm.addItemName(item.getItemId()); activeChar.sendPacket(sm); + + if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel()) + Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel); } item.setEnchantLevel(item.getEnchantLevel() + Config.CUSTOM_ENCHANT_VALUE); Index: config/head/enchant.properties =================================================================== --- config/head/enchant.properties (revision 986) +++ config/head/enchant.properties (working copy) @@ -131,4 +131,14 @@ # HOW WORKS: if you set it to 20, and player have an item > 20 # he will be kicked and the item will disappear! # Enchant amount at which a player gets punished (0 disabled) -EnchantKick = 0 \ No newline at end of file +EnchantKick = 0 + +# ---------------------- +# Enchant Announce - +# ---------------------- +# Announce when a player successfully enchant an item to x +# Default: False +EnableEnchantAnnounce = False + +# The value of x is... set it here (No have default value) +EnchantAnnounceLevel = 16 credits: RedHot