Jump to content

Search the Community

Showing results for tags 'Code'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • 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
  • Lineage II Bots & Tools
    • Bot Systems
    • Bot Scripts
    • Tools
  • Website Templates
  • DenArt Designs's Demo Updater

Forums

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

Product Groups

  • Advertisements
  • Special Groups

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 27 results

  1. Pretty self explanatory. This is a new Packet in order to open any url that you want to the user's pc. Can be used in vote rewards and shit like that. It is for Interlude. package net.sf.l2j.gameserver.network.serverpackets; /** * @author Elfocrash * */ public class OpenUrl extends L2GameServerPacket { private final String _url; public OpenUrl(String url) { _url = url; } @Override protected final void writeImpl() { writeC(0x70); writeS(_url); } } Usage: activeChar.sendPacket(new OpenUrl("https://www.google.co.uk/")); Client side: entry.dll Engine.dll in case just the entry file doens't work: engine.dll If the two things above don't work either here is the whole vanilla system: system Thanks to Szaka for helping me understand how this shit works btw.
  2. Hello, i was searching for this command but i didnt found it in our forum so i decided to share it, below you can preview the html's How to install it? EASY: 1. GameServer\data\html\mods (add here the repair FOLDER not only the files) 2. GameServer\data\scripts\handlers\voicedcommandhandlers (only the file Repair.java) (dont forget to edit your masterhandler.java script) [Hidden Content] Credits: Szponiasty
  3. Hello I'm sharing something that made some simple changes and build some parts of a clean and well written system of an event. Initial Messages: Search for commandname-e in your system and add at the end of it 115 114 register 116 115 unregister Code : https://pastebin.com/YRaCbU9T Author for the new event Williams Author of the original code DnR
  4. Hello guys, nothing special, just a guy ask me for that and maybe more peoples looking for it. You select enchant aura for all weapons on character selection. Diff Created on aCis 378: Index: config/server.properties =================================================================== --- config/server.properties (revision 9) +++ config/server.properties (working copy) @@ -59,6 +59,10 @@ # Clients related options # ================================================================ +# Visual Enchant for weapons on character selection +# Disable : 0 +VisualEnchant = 16 + # Allow delete chars after D days, 0 = feature disabled. DeleteCharAfterDays = 7 Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 9) +++ java/net/sf/l2j/Config.java (working copy) @@ -497,6 +497,7 @@ public static boolean SERVER_GMONLY; /** clients related */ + public static int VISUAL_ENCHANT; public static int DELETE_DAYS; public static int MAXIMUM_ONLINE_USERS; @@ -1210,6 +1211,7 @@ SERVER_LIST_TESTSERVER = server.getProperty("TestServer", false); SERVER_LIST_PVPSERVER = server.getProperty("PvpServer", true); + VISUAL_ENCHANT = server.getProperty("VisualEnchant", 0); DELETE_DAYS = server.getProperty("DeleteCharAfterDays", 7); MAXIMUM_ONLINE_USERS = server.getProperty("MaximumOnlineUsers", 100); Index: java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java (revision 9) +++ java/net/sf/l2j/gameserver/network/serverpackets/CharSelectInfo.java (working copy) @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.List; +import net.sf.l2j.Config; import net.sf.l2j.L2DatabaseFactory; import net.sf.l2j.gameserver.data.sql.ClanTable; import net.sf.l2j.gameserver.model.CharSelectSlot; @@ -149,7 +150,7 @@ writeD((slot.getAccessLevel() > -1) ? ((slot.getDeleteTimer() > 0) ? (int) ((slot.getDeleteTimer() - System.currentTimeMillis()) / 1000) : 0) : -1); writeD(slot.getClassId()); writeD((i == _activeId) ? 0x01 : 0x00); - writeC(Math.min(127, slot.getEnchantEffect())); + writeC(Config.VISUAL_ENCHANT > 0 ? Config.VISUAL_ENCHANT : Math.min(127, slot.getEnchantEffect())); writeD(slot.getAugmentationId()); } getClient().setCharSelectSlot(_slots);
  5. Hello, cheaters. - Nothing really new or unique, an simple panel that create list with pages for the droplist of Monster/Raidboss. - Simple addon : Player can choose to avoid specific item from the droplist. - Code not include part of "item.getIcon()" you can find many shared ways to get icon for each item. Preview : Code : [Hidden Content]
  6. Currently using L2j Acis and I saw ppl trying to find out how to put the starting adena code back in . So what i did was , take the code from an another project and put it back on L2jAcis . Simple , yet some ppl still searching for it ... so go to net.sf.l2j.gameserver.network.clientpackets open CharacterCreate.java Use crtl+F and search for the line without the + then paste the code and remove the +. newChar.setCurrentMp(newChar.getMaxMp()); + +// Starting Items +if (Config.STARTING_ADENA > 0) + newChar.addAdena("Init", Config.STARTING_ADENA, null, false); + Then Go to net.sf.l2j Open Config.java and as above , search for " public static int DEATH_PENALTY_CHANCE;" and add the Code with the + in front of it . Then remove the +. public static int DEATH_PENALTY_CHANCE; +public static int STARTING_ADENA; + Then in the Config.java again search for " DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20);" and as done above do the same. DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20); +STARTING_ADENA = players.getProperty("StartingAdena", 100); + We're done with the codes. Now go to Players.properties in the Configs and add the text as shown. Delevel = True # Death Penalty chance if killed by mob (in %), 20 by default DeathPenaltyChance = 20 +#Amount of adena that a new character is given +StartingAdena = 0 + #============================================================= # Inventory / Warehouse #============================================================= aaaand we are done! All you have to do is to put the value you want where it is now 0. That's it .
  7. Hello i want to share this ingame balancer its for acis 372 its useless for me now. Files/Code: https://www101.zippyshare.com/v/nMPZpOej/file.html
  8. Hello there.. Here is my Epic Boss Manager from my old server. Nothing special, but some of you may need it. What's inside? Works only with retail Grandbosses. [No retail zaken id] Inform you about the status of Grandboss. Inform you about respawn time. Date/Time. Enable/Disable it on configs. # Announce Grandboss status. # Ex: If status for Antharas/Valakas/Frintezza change to 2 player get announce: # Grandboss>name is engaged in battle. # If status changed to 3: Grandbossname has been killed. Type .epic for details! # For Baium if status change to 1 - Baium is awake and fighting. # All Grandboses respawned - Grandbossname is spawned in the world! AnnounceGrandBossStatus = True [Hidden Content]
  9. My first code 2 days work. so this is a L2Chaotic zone with change map, The maps is change random and he teleport players in town before change map he can't go or stay in old map becuase he teleport him in change map maybe need more work. but i try ;D So get it! @author L2jLuna Dev. Base: L2jFrozen http://pastebin.com/HdZFXE8b
  10. Hello chaters, - With currect code you can setup and event with spawning raidbosses on specific times. - You can use the @melron code to create easy that zones (Code Here ). Code (Updated 03/01/2019) : [Hidden Content] Credits : StinkyMadness
  11. Hello there.. Here is my buffer from my old server.. (Main html made by prwtoftw) What's inside? Mage | Fighter set [config] Buffs/Dance/Song/Extra etc one by one Special buffs + Malaria Vote buff [If you want it, you can enable it, config] Scheme Buffer Code Preview > [Hidden Content] Code/HTML/XML > [Hidden Content]
  12. https://pastebin.com/epSa6FQw credits : Williams
  13. Hello again cheaters. - An simple limit zone for the raidbosses. (Works as "Anti-Take-Away" the Raidbosses) - You can use the @melron code to create easy that zones (Code Here ). - I know can be done with just the boss spawn location and threadpool but i prefer use zone for it. Code : [Hidden Content]
  14. Version 1.0.0

    this is script for arabic chat in game like " السلام عليكم - اخبارك - يسلمو " it's for h5 only >> i think arabic ppl will try to find it .

    5.00 EUR

  15. As the title say i will share with you one password manager for Acis 370. Credits: Sweets( Ive just made the imports right and the necessary changes in case that someone didnt know and have problem). Go to : net.sf.l2j.gameserver.model.actor.instance and create a new class with name: L2PasswordInstance /* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.l2j.gameserver.model.actor.instance; import java.security.MessageDigest; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Base64; import java.util.StringTokenizer; import net.sf.l2j.commons.concurrent.ThreadPool; import net.sf.l2j.L2DatabaseFactory; import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; /** * @author SweeTs */ public class L2PasswordInstance extends Folk { public L2PasswordInstance(int objectId, NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(Player player, String command) { if (command.startsWith("change_password")) { StringTokenizer st = new StringTokenizer(command); st.nextToken(); String newPass = ""; String repeatNewPass = ""; try { if (st.hasMoreTokens()) { newPass = st.nextToken(); repeatNewPass = st.nextToken(); } } catch (Exception e) { player.sendMessage("Please fill all the blanks before requesting for a password change."); return; } if (!conditions(newPass, repeatNewPass, player)) return; changePassword(newPass, repeatNewPass, player); } } private static boolean conditions(String newPass, String repeatNewPass, Player player) { if (newPass.length() < 3) { player.sendMessage("The new password is too short!"); return false; } else if (newPass.length() > 45) { player.sendMessage("The new password is too long!"); return false; } else if (!newPass.equals(repeatNewPass)) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PASSWORD_ENTERED_INCORRECT2)); return false; } return true; } @Override public void showChatWindow(Player activeChar) { final NpcHtmlMessage html = new NpcHtmlMessage(0); final StringBuilder sb = new StringBuilder(); sb.append("<html><title>Account Manager</title>"); sb.append("<body><center>"); sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"); sb.append("New password: <edit var=\"new\" width=100 height=15><br>"); sb.append("Repeat: <edit var=\"repeatnew\" width=100 height=15><br>"); sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>"); sb.append("<a action=\"bypass -h npc_%objectId%_change_password $new $repeatnew\">Change password</a>"); sb.append("</center></body></html>"); html.setHtml(sb.toString()); html.replace("%objectId%", getObjectId()); activeChar.sendPacket(html); } private static void changePassword(String newPass, String repeatNewPass, Player activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?")) { byte[] newPassword = MessageDigest.getInstance("SHA").digest(newPass.getBytes("UTF-8")); ps.setString(1, Base64.getEncoder().encodeToString(newPassword)); ps.setString(2, activeChar.getAccountName()); ps.executeUpdate(); activeChar.sendMessage("Congratulations! Your password has been changed. You will now be disconnected for security reasons. Please login again."); ThreadPool.schedule(() -> activeChar.logout(false), 3000); } catch (Exception e) { _log.warning("There was an error while updating account:" + e); } } } After you are passing this the only thing that you have to do is create a new npc with type: L2Password. HAVE A NICE DAY GUYS :)
  16. Hello guys, Before 4-5 months i created a script for a new raid in order to avoid all classic raids that are really boring... It isn't something special, but i always like different and unusual things... Plagueseeker Raid Starting with some special cameras while all players are paralyzed. When the broadcast end, the following features stands there: action task every 2 seconds: There is 20% chance to 'debuff' a random player if is healer class Debuffs: 20% chance for 15% chance for 10% chance for 50% chance for There is 5% chance to 1) Spawn some minions when the hp of the raid is lower than 40% in order to protect the raid boss (can be happened unlimited times with chance 5%). Minions will suicide after 10 seconds after the spawn time if not get killed. 2) Pick a random target and kill him instant. When the hp of the raid is lower than 50% Broadcast again some special cameras (while players are paralyzed again), an earthquake for 5 seconds and instant kill 10 random players around the raid in 700 radius (can be happened only 1 time). inactivity task If the raid boss not attacked for more than 15 minutes, all players are going back and raid will be deleted. * All the above features are meant to be used in a boss zone ( i used 150000 as a custom one in my pack). Any feature wont work outside of the zone, I wont share any thing like that since its just c/p. * Its your responsibility to use the necessary checks in order to avoid bugs like move the raid out of zone. I coded for me at coliseum with doors closed. Also you have to set by urself how the raid will be spawned (i was about to code the spawn thing but i dont remember why i didnt). I used //spawn just for the video . Code: [Hidden Content] Coded (if i remember well) in acis 370. Note: If you want to expand it or understand how a script can be coded, check this topic (if any other post is related to scripts and have informations post it)
  17. Color name - title system + Skill Reward coded on 374 acis , im not author of this , i decompiled and adapted . cheers package net.sf.l2j.gameserver.datatables; import net.sf.l2j.gameserver.templates.L2Pvp; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; import net.sf.l2j.gameserver.model.holder.IntIntHolder; import net.sf.l2j.gameserver.templates.StatsSet; import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory; import org.w3c.dom.*; public class PvpTable { public PvpTable() { } public static void load() { try { File f = new File("./data/xml/pvp.xml"); Document doc = XMLDocumentFactory.getInstance().loadDocument(f); Node n = doc.getFirstChild(); for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) if(d.getNodeName().equalsIgnoreCase("template")) { NamedNodeMap attrs = d.getAttributes(); int pvpAmount = Integer.valueOf(attrs.getNamedItem("pvp_amount").getNodeValue()).intValue(); int nameColor = Integer.decode((new StringBuilder()).append("0x").append(attrs.getNamedItem("name_color").getNodeValue()).toString()).intValue(); int titleColor = Integer.decode((new StringBuilder()).append("0x").append(attrs.getNamedItem("title_color").getNodeValue()).toString()).intValue(); String learnSkill = attrs.getNamedItem("learn_skill").getNodeValue().trim(); StatsSet set = new StatsSet(); set.set("pvp_amount", pvpAmount); set.set("name_color", nameColor); set.set("title_color", titleColor); L2Pvp template = new L2Pvp(set); if(learnSkill != null) { String property[] = learnSkill.split(";"); String as[] = property; int i = as.length; for(int j = 0; j < i; j++) { String data = as[j]; String holder[] = data.split(","); template.addLearnSkill(new IntIntHolder(Integer.parseInt(holder[0]), Integer.parseInt(holder[1]))); } } _templates.add(template); } } catch(Exception e) { _log.severe((new StringBuilder()).append("Exception: PvpTable load: ").append(e).toString()); } _log.info((new StringBuilder()).append("PvpTable: Loaded ").append(_templates.size()).append(" template(s).").toString()); } public static List<L2Pvp> getTemplate() { return _templates; } private static final Logger _log = Logger.getLogger(PvpTable.class.getName()); private static final List<L2Pvp> _templates = new ArrayList<>(); } package net.sf.l2j.gameserver.templates; import java.util.ArrayList; import java.util.List; import net.sf.l2j.gameserver.model.holder.IntIntHolder; import net.sf.l2j.gameserver.templates.StatsSet; public class L2Pvp { public L2Pvp(StatsSet set) { _pvpAmount = set.getInteger("pvp_amount"); _nameColor = set.getInteger("name_color"); _titleColor = set.getInteger("title_color"); } public int getPvpAmount() { return _pvpAmount; } public int getNameColor() { return _nameColor; } public int getTitleColor() { return _titleColor; } public List<IntIntHolder> getLearnSkills() { return _learnSkill; } public void addLearnSkill(IntIntHolder holder) { _learnSkill.add(holder); } private final int _pvpAmount; private final int _nameColor; private final int _titleColor; private final List<IntIntHolder> _learnSkill = new ArrayList<>(); } Open : Gameserver.java add somewhere this : PvpTable.load(); Open : Player.java add somewhere this : public static void updatePvp(Player player) { for(Iterator<L2Pvp> iterator = PvpTable.getTemplate().iterator(); iterator.hasNext();) { L2Pvp template = iterator.next(); if(template.getPvpAmount() <= player.getPvpKills()) { player.getAppearance().setNameColor(template.getNameColor()); player.getAppearance().setTitleColor(template.getTitleColor()); Iterator<IntIntHolder> iterator1 = template.getLearnSkills().iterator(); while(iterator1.hasNext()) { IntIntHolder holder = iterator1.next(); net.sf.l2j.gameserver.model.L2Skill skill = SkillTable.getInstance().getInfo(holder.getId(), holder.getValue()); if(skill != null) player.addSkill(skill, false); } } } player.broadcastUserInfo(); } find in Player.java below this line setPvpKills(getPvpKills() + 1); add -> updatePvp(this); find : public boolean setActiveClass(int classIndex) under this line restoreSkills(); add - > updatePvp(this); find : public void onPlayerEnter() add somewhere under : updatePvp(this); XML : loc : data/xml/pvp.xml <?xml version='1.0' encoding='utf-8'?> <list> <!-- <template pvp_amount="100" name_color="FFAA00" title_color="FFFF77" learn_skill="0,0;" /> --> <template pvp_amount="5" name_color="FFAA00" title_color="FFFF77" learn_skill="0,0;" /> </list>
  18. Hello forum, i was searching around and i saw on many forum's peoples selling this code for gold. (30-40 euro) rolf... That's who we are, sad... So this is one "Gift" from me for the new year. On this code you have the listed options: You can add as many zones you want. You can setup for each zone the running time. (On the current diff i have make Giran Arena and Gludin Arena). Gatekeeper command : <a action="bypass -h npc_%objectId%_pvp">Random Zone</a> The codes required more then 1 zone. Ofc you can add your own configs like "Auto Flag" "Auto Nobles" and whatever you want.. take this share like platform and work on it. DIFF is coded on aCis 381 revision - Feel free to adapt it in whatever revision or project you need. Credits : StinkyMadness Code r381: Here
  19. hello..i have made this right now and i will share it..tested and works... but you have to restart to change the sex of the Character Have a nice Day.. ps.add a New item and register you handler and like this <set name="handler" val="ChangeSexItem" /> ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/handler/ItemHandler.java =================================================================== --- java/net/sf/l2j/gameserver/handler/ItemHandler.java (revision 4) +++ java/net/sf/l2j/gameserver/handler/ItemHandler.java (working copy) @@ -24,6 +24,7 @@ import net.sf.l2j.gameserver.handler.itemhandlers.BlessedSpiritShot; import net.sf.l2j.gameserver.handler.itemhandlers.Book; import net.sf.l2j.gameserver.handler.itemhandlers.Calculator; +import net.sf.l2j.gameserver.handler.itemhandlers.ChangeSexItem; import net.sf.l2j.gameserver.handler.itemhandlers.ClanFullSkill; import net.sf.l2j.gameserver.handler.itemhandlers.ClanLevel; import net.sf.l2j.gameserver.handler.itemhandlers.ClanReputation; @@ -96,6 +97,7 @@ registerItemHandler(new NobleItem()); registerItemHandler(new VipItem()); registerItemHandler(new AioItem()); + registerItemHandler(new ChangeSexItem()); } public void registerItemHandler(IItemHandler handler) Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 13) +++ java/net/sf/l2j/Config.java (working copy) @@ -388,6 +388,9 @@ public static int VIP_REWARD_ITEM; public static int VIP_ITEM_AMOUNT; public static int VIP_SET_DAYS; + public static boolean ENABLE_CHANGESEX_COIN; + public static int CHANGESEX_COIN_ID; + public static int CHANGESEX_COIN_AMOUNT; /** Balance Settings */ public static long CLASS_BALANCER_UPDATE_DELAY; @@ -1389,6 +1392,9 @@ VIP_REWARD_ITEM = reborn12.getProperty("VipRewardItem", 0); VIP_ITEM_AMOUNT = reborn12.getProperty("VipItemAmount", 0); VIP_SET_DAYS = reborn12.getProperty("VipSetDays", 1); + ENABLE_CHANGESEX_COIN = reborn12.getProperty("EnableChangeSexItem", false); + CHANGESEX_COIN_ID = reborn12.getProperty("ChangeSexCoinId", 1); + CHANGESEX_COIN_AMOUNT = reborn12.getProperty("ChangeSexCoinAmount", 1); CLASS_BALANCER_UPDATE_DELAY = reborn12.getProperty("ClassBalancerUpdateDelay", 300) * 1000; CLASS_BALANCER_AFFECTS_SECOND_PROFFESION = reborn12.getProperty("ClassBalancerAffectSecondProffesion", false); CLASS_BALANCER_AFFECTS_MONSTERS = reborn12.getProperty("ClassBalancerAffectMonsters", false); Index: java/net/sf/l2j/gameserver/handler/itemhandlers/ChangeSexItem.java =================================================================== --- java/net/sf/l2j/gameserver/handler/itemhandlers/ChangeSexItem.java (revision 0) +++ java/net/sf/l2j/gameserver/handler/itemhandlers/ChangeSexItem.java (working copy) @@ -0,0 +1,62 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <http://www.gnu.org/licenses/>. + */ +package net.sf.l2j.gameserver.handler.itemhandlers; + +import net.sf.l2j.commons.concurrent.ThreadPool; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.handler.IItemHandler; +import net.sf.l2j.gameserver.model.actor.L2Playable; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.base.Sex; +import net.sf.l2j.gameserver.model.item.instance.ItemInstance; +import net.sf.l2j.gameserver.model.olympiad.OlympiadManager; +import net.sf.l2j.gameserver.network.SystemMessageId; + +/** + * @author Reborn12 + */ +public class ChangeSexItem implements IItemHandler +{ + @Override + public void useItem(L2Playable playable, ItemInstance item, boolean forceUse) + { + if (Config.ENABLE_CHANGESEX_COIN) + { + if (!(playable instanceof L2PcInstance)) + { + L2PcInstance player = (L2PcInstance) playable; + if (player.isInCombat()) + { + player.sendMessage("you Can't Use Item Because You Are in Combat"); + return; + } + else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegisteredInComp(player)) + { + player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT); + return; + } + if (!player.destroyItemByItemId("ChangeSex", Config.CHANGESEX_COIN_ID, Config.CHANGESEX_COIN_AMOUNT, null, true)) + return; + + player.getAppearance().setSex(player.getAppearance().getSex() == Sex.MALE ? Sex.FEMALE : Sex.MALE); + player.sendMessage("Your gender has been changed,You will Be Disconected in 3 Seconds!"); + player.broadcastUserInfo(); + player.decayMe(); + player.spawnMe(); + ThreadPool.schedule(() -> player.logout(false), 3000); + } + } + } + } \ No newline at end of file Index: config/reborn12.properties =================================================================== --- config/reborn12.properties (revision 13) +++ config/reborn12.properties (working copy) @@ -665,6 +665,19 @@ #Set Days For Vip chars From Npc VipSetDays = 15 +# -------------------- +# ChangeSex Settings +# -------------------- + +#Enable/Disable ChangeSex Item +EnableChangeSexItem = True + +#ChangeSex Item ID +ChangeSexCoinId = 57 + +#ChangeSex Item Amount +ChangeSexCoinAmount = 1 + \ No newline at end of file
  20. Well, one friend asked to me to help him coding a simple "pvp zone" and then asked to me to add an item checker... etc So I coded a "MultiFunction", "AIO"... whatever... zone. Easy to modify, with configs... and I wanted to share it with you. Simply if you don't like it or you don't like me, don't spam here. We know that some of this features could be already shared over the net... blabla... But here are all together, are configurable and I think that it's 90% without bugs. Note: Default zone: Crystal Caverns Quickly enumeration of which configs it has: -Enable/Disable pvp flag on enter -Enable/Disable revive delay & set the time -Specify (unlimited) random respawns if revive enabled -Specify random respawn radius -Enable/Disable noblesse blessing on enter -Enable/Disable remove buffs on enter -Enable/Disable remove pets on enter -Specify special reward when hunting inside -Specify items that will be unequiped & blocked to use inside the zone -Specify items by grades that will be unequiped & blocked to use inside the zone -Specify an enchant level. Items with that level or more, will be unequiped & blocked to use inside the zone -Specify classes id's that won't be able to enter to this zone V.1.3 - 14/02/2013 Coded for l2jserver Freya. - Wyatt L2jServer Freya patch Addapted to l2jfrozen Interlude. - Wyatt L2jFrozen Interlude patch. Addapted to l2jserver H5 Beta, rev core:5639 datapack:9185. - Valanths L2jServer H5 Beta patch Addapted to l2jserver H5 Beta, rev core:6165 datapack:9909. - Valanths L2jServer H5 Beta patch Addapted to Acis, Changeset 309. - Tяαnce Acis patch Addapted to Acis, rev:299. - Dεbian Acis patch Credits: Wyatt
  21. How does it works? our system automatically pop-up validation window to characters oscillating around specified number of killed monsters, in order to verify possible bots use. player have to match randomly generated colours within <also> randomly chosen patterns (time is limited). forgive me guys, but since now any instant changes or system updates will be available only for acis customers. authors: credits: @Agent @Rootware @Caparso @Hasha @SweeTs @Tryskell our main provisions: does not require to be fluent in a foreign language, as simple as possible. insurmountable by nowadays programs used to inject bots. does not affecting existing source (just few necessary lines), no external libs are needed. punishment selection (move to nearest town, kick from the server, put to the jail or ban character). configurable validation time. code preview? check it out on pastebin. bots_prevention_v1.1.diff html/mods/necessary images How does software see content? <html><title>Bots prevention</title><body><center><br><br><img src="L2UI_CH3.herotower_deco" width="256" height="32"><br><br><font color="a2a0a2">in order to prove you are a human being<br1>you've to</font> <font color="b09979">match colours within generated pattern:</font><br><br><img src="Crest.crest_1_9903795" width="32" height="32"></td></tr><br><br><font color=b09979>click-on pattern of your choice beneath:</font><table><tr><td><button action="bypass -h report_0" width=32 height=32 back="Crest.crest_1_1978" fore="Crest.crest_1_1978"></td><td><button action="bypass -h report_1" width=32 height=32 back="Crest.crest_1_1970" fore="Crest.crest_1_1970"></td><td><button action="bypass -h report_2" width=32 height=32 back="Crest.crest_1_1975" fore="Crest.crest_1_1975"></td><td><button action="bypass -h report_3" width=32 height=32 back="Crest.crest_1_1971" fore="Crest.crest_1_1971"></td></tr></table></center></body></html>
  22. I think it not worth any money, when I bought it I was unskilled and too lazy, now everything changed, so I share some codes with you community, if you like it, every 1-2 weeks I will share unique codes, but I'm a little bit scary, because every server will have it, but nevermind. Download link: http://www58.zippyshare.com/v/IsY3qhhl/file.html Author and seller: Devlin Topic: http://www.maxcheaters.com/topic/181513-l2j-automatic-potions
  23. I saw a guy trying to sell this code for 20E.... I thing you get what it is right? You have a chance to craft items with enchant. the only thing you have to do is to add 2 values in recipes.xml. example: <recipe alias="mk_leather_boots" id="69" material="1931-4;1882-8;1885-1;2130-1" product="40-1" itemId="2176" level="2" mpConsume="84" successRate="100" isDwarven="true"/> You can add enchant by adding enchantChance="70" enchant="4-19" (means you have 70% chance to get a random value from 4 - 19 as enchant) in case you want a constant value you can put it like "10-10" <recipe alias="mk_leather_boots" id="69" material="1931-4;1882-8;1885-1;2130-1" enchantChance="70" enchant="4-19" product="40-1" itemId="2176" level="2" mpConsume="84" successRate="100" isDwarven="true"/> rev 375 here is the code: [Hidden Content]
  24. Hey, correct me if i am wrong, but what i have noticed that 99% interlude packs still have this bug. I saw this in Acis, Frozen, Mobius and actually in all older packs. DIFF: Index: java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (revision 5) +++ java/net/sf/l2j/gameserver/network/serverpackets/CharInfo.java (working copy) @@ -34,7 +34,7 @@ writeD(_activeChar.getX()); writeD(_activeChar.getY()); writeD(_activeChar.getZ()); - writeD(_activeChar.getHeading()); + writeD(0); writeD(_activeChar.getObjectId()); writeS(_activeChar.getName()); writeD(_activeChar.getRace().ordinal()); @@ -180,7 +180,7 @@ writeD(_activeChar.getAppearance().getNameColor()); - writeD(0x00); // isRunning() as in UserInfo? + writeD(_activeChar.getHeading()); writeD(_activeChar.getPledgeClass()); writeD(_activeChar.getPledgeType());
  25. Hello, I created this vote manager when I needed it for my server.Basically,you have to type /vote go get this html window: Then by clicking on any of the buttons will give you 60seconds to vote for the server. /* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.l2j.gameserver.handler.usercommandhandlers; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.EnumMap; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import net.sf.l2j.Config; import net.sf.l2j.L2DatabaseFactory; import net.sf.l2j.gameserver.ThreadPoolManager; import net.sf.l2j.gameserver.handler.IUserCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; /** * @author Eimantas */ public class VotingReward implements IUserCommandHandler { // Queries private static final String DELETE_QUERY = "DELETE FROM mods_voting_reward WHERE time < ?"; private static final String SELECT_QUERY = "SELECT * FROM mods_voting_reward"; private static final String INSERT_QUERY = "INSERT INTO mods_voting_reward (data, scope, time, top) VALUES (?, ?, ?, ?)"; private static final Logger _log = Logger.getLogger(VotingReward.class.getName()); private static final long VOTING_INTERVAL = TimeUnit.HOURS.toMillis(12); private static final Map<UserScope, ScopeContainer> VOTTERS_CACHE = new EnumMap<>(UserScope.class); public static long TimeToVote = TimeUnit.SECONDS.toMillis(60); static boolean isVotingHopzone = false; static boolean isVotingTopzone = false; public static String TopzoneURL = Config.TOPZONE_SERVER_LINK; public static String HopZoneURL = Config.HOPZONE_SERVER_LINK; static final int[] COMMANDS = { 115 }; public VotingReward() { load(); } @Override public boolean useUserCommand(int id, L2PcInstance activeChar) { if (id == COMMANDS[0]) { showVoteHtml(activeChar); } return false; } @Override public int[] getUserCommandList() { return COMMANDS; } public static void showVoteHtml(L2PcInstance player) { NpcHtmlMessage html = new NpcHtmlMessage(0); html.setFile("data/html/managers/vote.htm"); player.sendPacket(html); } public static void voteHopzone(L2PcInstance player) { final L2PcInstance player2 = player; showVoteHtml(player2); long time = getLastVotedTime(player, "hopzone"); if (player2.isVoting()) { player2.sendMessage("You are already voting!"); return; } if (time > 0) { sendReEnterMessage(time, player); return; } if (isVotingHopzone) { player2.sendMessage("Someone is already voting.Please wait!"); return; } final int currVotes = getHopzoneCurrentVotes(); isVotingHopzone = true; player2.sendMessage("You have " + TimeToVote / 1000 + " seconds to vote for us on HopZone!"); player2.setVoting(true); ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { @Override public void run() { if (getHopzoneCurrentVotes() > currVotes) { player2.sendMessage("Thank You for voting!"); markAsVotted(player2, "hopzone"); giveReward(player2); } else { player2.sendMessage("You did not vote for server!"); } isVotingHopzone = false; player2.setVoting(false); } }, TimeToVote); } public static void voteTopzone(L2PcInstance player) { final L2PcInstance player2 = player; showVoteHtml(player2); long time = getLastVotedTime(player, "topzone"); if (player2.isVoting()) { player2.sendMessage("You are already voting!"); return; } if (time > 0) { sendReEnterMessage(time, player); return; } if (isVotingTopzone) { player2.sendMessage("Someone is already voting.Please wait!"); return; } final int currVotes = getTopzoneCurrentVotes(); isVotingTopzone = true; player2.sendMessage("You have " + TimeToVote / 1000 + " seconds to vote for us on Topzone!"); player2.setVoting(true); ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { @Override public void run() { if (getTopzoneCurrentVotes() > currVotes) { player2.sendMessage("Thank You for voting!"); markAsVotted(player2, "topzone"); giveReward(player2); } else { player2.sendMessage("You did not vote for server!"); } isVotingTopzone = false; player2.setVoting(false); } }, TimeToVote); } public static int getHopzoneCurrentVotes() { InputStreamReader isr = null; BufferedReader br = null; try { if (!HopZoneURL.endsWith(".html")) HopZoneURL += ".html"; URLConnection con = new URL(HopZoneURL).openConnection(); con.addRequestProperty("User-L2Hopzone", "Mozilla/4.76"); isr = new InputStreamReader(con.getInputStream()); br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { if (line.contains("no steal make love") || line.contains("no votes here") || line.contains("bang, you don't have votes") || line.contains("la vita e bella")) { int votes = Integer.valueOf(line.split(">")[2].replace("</span", "")); return votes; } } br.close(); isr.close(); } catch (Exception e) { System.out.println(e); System.out.println("Error while getting server vote count on HopZone."); _log.log(Level.WARNING, "Error while getting server vote count on HopZone!"); } return -1; } public static int getTopzoneCurrentVotes() { InputStreamReader isr = null; BufferedReader br = null; try { URLConnection con = new URL(TopzoneURL).openConnection(); con.addRequestProperty("User-Agent", "L2TopZone"); isr = new InputStreamReader(con.getInputStream()); br = new BufferedReader(isr); boolean got = false; String line; while ((line = br.readLine()) != null) { if (line.contains("<div class=\"rank\"><div class=\"votes2\">Votes:<br>") && !got) { got = true; int votes = Integer.valueOf(line.split("<div class=\"rank\"><div class=\"votes2\">Votes:<br>")[1].replace("</div></div>", "")); return votes; } } br.close(); isr.close(); } catch (Exception e) { System.out.println(e); System.out.println("Error while getting server vote count on Topzone."); _log.log(Level.WARNING, "Error while getting server vote count on Topzone!"); } return -1; } private static final long getLastVotedTime(L2PcInstance activeChar, String top) { for (Entry<UserScope, ScopeContainer> entry : VOTTERS_CACHE.entrySet()) { final String data = entry.getKey().getData(activeChar); final long reuse = entry.getValue().getReuse(data, top); if (reuse > 0) { return reuse; } } return 0; } private static void sendReEnterMessage(long time, L2PcInstance player) { if (time > System.currentTimeMillis()) { final long remainingTime = (time - System.currentTimeMillis()) / 1000; final int hours = (int) (remainingTime / 3600); final int minutes = (int) ((remainingTime % 3600) / 60); final int seconds = (int) ((remainingTime % 3600) % 60); String msg = "You have received your reward already try again in: " + hours + " hours"; if (minutes > 0) { msg += " " + minutes + " minutes"; } if (seconds > 0) { msg += " " + seconds + " seconds"; } player.sendMessage(msg); } } private static final void load() { // Initialize the cache for (UserScope scope : UserScope.values()) { VOTTERS_CACHE.put(scope, new ScopeContainer()); } // Cleanup old entries and load the data for votters try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement(DELETE_QUERY); Statement st = con.createStatement()) { ps.setLong(1, System.currentTimeMillis()); ps.execute(); // Load the data try (ResultSet rset = st.executeQuery(SELECT_QUERY)) { while (rset.next()) { final String data = rset.getString("data"); final UserScope scope = UserScope.findByName(rset.getString("scope")); final Long time = rset.getLong("time"); final String top = rset.getString("top"); if (scope != null) { VOTTERS_CACHE.get(scope).registerVotter(data, time, top); } } } } catch (SQLException e) { _log.log(Level.WARNING, VotingReward.class.getSimpleName() + ": " + e.getMessage(), e); } } private enum UserScope { ACCOUNT { @Override public String getData(L2PcInstance player) { return player.getAccountName(); } }, IP { @Override public String getData(L2PcInstance player) { return player.getClient().getConnection().getInetAddress().getHostAddress(); } }, //@formatter:off /*HWID { @Override public String getData(L2PcInstance player) { return player.getHWID(); } }*/ //@formatter:on ; public abstract String getData(L2PcInstance player); public static UserScope findByName(String name) { for (UserScope scope : values()) { if (scope.name().equals(name)) { return scope; } } return null; } } private static class ScopeContainer { private final Map<String, Long> _HopzoneVotters = new ConcurrentHashMap<>(); private final Map<String, Long> _TopzoneVotters = new ConcurrentHashMap<>(); public ScopeContainer() { } public void registerVotter(String data, long reuse, String top) { if (top.equalsIgnoreCase("hopzone")) { _HopzoneVotters.put(data, reuse); } if (top.equalsIgnoreCase("topzone")) { _TopzoneVotters.put(data, reuse); } } public long getReuse(String data, String top) { if (top.equalsIgnoreCase("hopzone")) { if (_HopzoneVotters.containsKey(data)) { long time = _HopzoneVotters.get(data); if (time > System.currentTimeMillis()) { return time; } } } if (top.equalsIgnoreCase("topzone")) { if (_TopzoneVotters.containsKey(data)) { long time = _TopzoneVotters.get(data); if (time > System.currentTimeMillis()) { return time; } } } return 0; } } static void markAsVotted(L2PcInstance player, String top) { final long reuse = System.currentTimeMillis() + VOTING_INTERVAL; try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement(INSERT_QUERY)) { for (UserScope scope : UserScope.values()) { final String data = scope.getData(player); final ScopeContainer container = VOTTERS_CACHE.get(scope); container.registerVotter(data, reuse, top); ps.setString(1, data); ps.setString(2, scope.name()); ps.setLong(3, reuse); ps.setString(4, top); ps.addBatch(); } ps.executeBatch(); } catch (SQLException e) { _log.log(Level.WARNING, VotingReward.class.getSimpleName() + ": " + e.getMessage(), e); } } static void giveReward(L2PcInstance player) { player.addItem("Reward", 6673, 1, player, true); } } Add those to net.sf.l2j.Config: public static String TOPZONE_SERVER_LINK; public static String HOPZONE_SERVER_LINK; HOPZONE_SERVER_LINK = votemanager.getProperty("HopzoneServerLink", "http://l2.hopzone.net/lineage2/details/98632/L2-cyrex/"); TOPZONE_SERVER_LINK = votemanager.getProperty("TopzoneServerLink", "http://l2topzone.com/lineage2/server-info/11321/L2Cyrex.html/"); and to net.sf.l2j.gameserver.handler.UserCommandHandler this: registerUserCommandHandler(new VotingReward()); SQL: DROP TABLE IF EXISTS `mods_voting_reward`; CREATE TABLE `mods_voting_reward` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` varchar(255) NOT NULL, `scope` varchar(255) NOT NULL, `time` bigint(20) unsigned NOT NULL, `top` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8; Changing reward(Last lines of VotingReward): static void giveReward(L2PcInstance player) { player.addItem("Reward", ITEM ID , ITEM COUNT , player, true); } Config(votemanager.properties): HopzoneServerLink = http://l2.hopzone.net/lineage2/details/98632/L2-cyrex/ TopzoneServerLink = http://l2topzone.com/lineage2/server-info/11321/L2Cyrex.html/ This is probably poorly coded,just wanted to share,some pieces are taken from An4rchy vote manager. Also Client side(commandname-e.dat): 116 115 vote EDIT:Vote.html <html> <body> <center> <p>Vote Manager:</p> <br><br><br><br><br><br><br><br><br><br><br><br> <button value="Vote for us on HopZone" action="bypass -h vote-hopzone" width=180 height=20 back="YourTexture" fore="YourTexture"/> <img src=L2UI_CH3.herotower_deco width=256 height=32> <button value="Vote for us on Topzone" action="bypass -h vote-topzone" width=180 height=20 back="YourTexture" fore="YourTexture"/> </center> </body> </html> Ofc,you have to change YourTexture to.... L2PcInstance.java boolean isVoting = false; public boolean isVoting() { return isVoting; } public void setVoting(boolean voting) { isVoting = voting; } Good luck!
×