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 Server Packs [Java]
  • Lineage II Server Packs [PTS]
  • Lineage II Server Scripts
  • Lineage II Client Scripts
  • Lineage II Items & Chars
  • Website Templates
  • DenArt Designs's Demo Updater

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
    • L2 elixir comes back with an Interlude server x3 on May, 31st
    • Private Servers
    • L2Zariche Custom PvP | FRESH START 25th of May 2019
    • [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. 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
  2. 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]
  3. 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]
  4. 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
  5. 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
  6. 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]
  7. 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());
  8. . Update link for any problem send me PM tnx!
  9. 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!
  10. 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)
  11. Hi guys, I created a vote reminder that remind players if they can vote every X minutes. Its working with this vote manager, but its easy to add your own vote manager. http://pastebin.com/VbhkfHVD It is for acis Config/VoteReminder.properties Image: ============================================================ Reminder with command: .votes http://pastebin.com/8m0qe3hB img:
  12. Hello, i wanna ask someone got this captcha code?
  13. Deleted all my shares a while ago but wanted to leave this one here because there are people selling this stupidly simple code. It's command based individual vote reward for Hopzone, Topzone and Network. Commands are .votehope, .votetop and .votenet. It is secured on both the account level and the IP level so it's as protected as it gets without adding HWID. It can be easily converted to a NPC based one. Code: https://gist.github.com/Elfocrash/a5ba37666dd9c4d3f9a9ec022301930c Link for gson 2.6.2 https://repo1.maven.org/maven2/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar
  14. ### Eclipse Workspace Patch 1.0 #P L2J_Server Index: Dist/game/data/handlers\voicedcommandhandler\PvP.java =================================================================== --- Dist/game/data/handlers\voicedcommandhandler\PvP.java (revision 0) +++ Dist/game/data/handlers\voicedcommandhandler\PvP.java (working copy) @@ -0,0 +1,48 @@ +/* +*This program is free software; you can redistribute it and/or modify +*it under the terms of the GNU General Public License as published by +*the Free Software Foundation; either version 2, or (at your option) +*any later version. +* +*This program is distributed in the hope that it will be useful, +*but WITHOUT ANY WARRANTY; without even the implied warranty of +*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +*GNU General Public License for more details. +* +*You should have received a copy of the GNU General Public License +*along with this program; if not, write to the Free Software +*Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +*02111-1307, USA. +* +*http://www.gnu.org/copyleft/gpl.html +*/ +package handlers.voicedcommandhandlers; + +import org.l2jdevs.gameserver.handler.IVoicedCommandHandler; +import org.l2jdevs.gameserver.model.actor.instance.L2PcInstance; + +/** +* PvP info +* @author Zestu, +*/ +public class PvP implements IVoicedCommandHandler { +private static final String[] VOICED_COMMANDS = { + "pvp" + }; + + @Override + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) { + if (command.equalsIgnoreCase("pvp")) { + if (activeChar.getTarget() == null) { + activeChar.sendMessage("You have no one targeted."); + return false; + } + if (!(activeChar.getTarget() instanceof L2PcInstance)) { + activeChar.sendMessage("You can only get the info of a player."); + + return false; + } + + L2PcInstance targetp = (L2PcInstance) activeChar.getTarget(); + + activeChar.sendMessage("=========<NameServer>========="); + activeChar.sendMessage("" + targetp.getName() + ""); + activeChar.sendMessage("PvP Kills: " + targetp.getPvpKills()); + activeChar.sendMessage("PvP Flags: " + targetp.getPvpFlag()); + activeChar.sendMessage("PK Kills: " + targetp.getPkKills()); + activeChar.sendMessage("=========<>========="); + + } + return true; + } + + @Override + public String[] getVoicedCommandList() { + return VOICED_COMMANDS; + } + } \ No newline at end of file Index: Dist/game/data/handlers\MasterHandler.java =================================================================== --- Dist/game/data/handlers\MasterHandler.java (revision 0) +++ Dist/game/data/handlers\MasterHandler.java (working copy) @@ -65,6 +65,7 @@ +import handlers.voicedcommandhandlers.PvP; private static final Class<?>[] VOICED_COMMAND_HANDLERS = { StatsVCmd.class, // TODO: Add configuration options for this voiced commands: // CastleVCmd.class, // SetVCmd.class, (Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null), (Config.BANKING_SYSTEM_ENABLED ? Banking.class : null), (Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null), (Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null), (Config.L2JMOD_ENABLE_ONLINE_STATUS ? OnlineStatus.class : null), (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null), (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null), + PvP.class,
  15. ### Eclipse Workspace Patch 1.0 #P L2J_DataPack Index: dist/game/data/scripts/custom/QuizEvent/QuizEvent.java =================================================================== --- dist/game/data/scripts/custom/QuizEvent/QuizEvent.java (revision 0) +++ dist/game/data/scripts/custom/QuizEvent/QuizEvent.java (working copy) package custom.QuizEvent; import java.io.File; import java.util.HashMap; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.util.Broadcast; import com.l2jserver.util.Rnd; /** * * @author Bellatrix * */ public class QuizEvent { public static boolean _quizRunning; private static String _question; private static String _answer1; private static String _answer2; private static String _answer3; private static int _rightanswer; private static Map<L2PcInstance,Integer> _players; private static int status; private static int announced; private static ThreadPoolManager tpm; private static AutoEventTask task; private static String[][] _questions; private static int i = 0; private static final int STATUS_NOT_IN_PROGRESS = 0; private static final int STATUS_ASK = 1; private static final int STATUS_ANSWER = 2; private static final int STATUS_END = 3; //---------------------------------------------------------------------------- //------------------------------ CONFIG -------------------------------------- //---------------------------------------------------------------------------- //Number of questions per event private static int _questionNumber = 3; //The Item ID of the reward private static int _rewardID = 57; //The ammount of the reward private static int _rewardCount = 1000; //Wait for the first event after the server start (in seconds) private static int _initWait = 3600; //Time for answer the question (in seconds) private static int _answerTime = 60; //Time between two event (in seconds) private static int _betweenTime = 18000; public QuizEvent() { tpm = ThreadPoolManager.getInstance(); status = STATUS_NOT_IN_PROGRESS; task = new AutoEventTask(); announced = 0; _quizRunning = false; _question = ""; _answer1 = ""; _answer2 = ""; _answer3 = ""; _rightanswer = 0; _players = new HashMap<>(100); _questions = new String[20][]; includeQuestions(); tpm.scheduleGeneral(task, _initWait*1000); } private void includeQuestions() { File questionFile = new File(Config.DATAPACK_ROOT, "data/scripts/custom/QuizEvent/QuizEvent.xml"); Document doc = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setIgnoringComments(true); dbf.setValidating(false); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(questionFile); for (Node root = doc.getFirstChild(); root != null; root = root.getNextSibling()) { if ("list".equalsIgnoreCase(root.getNodeName())) { for (Node child = root.getFirstChild(); child != null; child = child.getNextSibling()) { if ("question".equalsIgnoreCase(child.getNodeName())) { int id, correct; String ask, answer1, answer2, answer3; NamedNodeMap attrs = child.getAttributes(); id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue()); correct = Integer.parseInt(attrs.getNamedItem("correct").getNodeValue()); ask = attrs.getNamedItem("ask").getNodeValue(); answer1 = attrs.getNamedItem("answer1").getNodeValue(); answer2 = attrs.getNamedItem("answer2").getNodeValue(); answer3 = attrs.getNamedItem("answer3").getNodeValue(); _questions[id] = new String[]{ ask, answer1, answer2, answer3, ""+correct }; i++; } } } } } catch (Exception e) { } } private class AutoEventTask implements Runnable { @Override public void run() { switch (status) { case STATUS_NOT_IN_PROGRESS: announceStart(); break; case STATUS_ASK: if (announced < _questionNumber) { announceQuestion(); } else { status = STATUS_END; tpm.scheduleGeneral(task, 3000); } break; case STATUS_ANSWER: announceCorrect(); break; case STATUS_END: endEvent(); break; default: break; } } } //Get a random question from the quiz_event table private static void selectQuestion() { int id = Rnd.get(i)+1; _question = _questions[id][0]; _answer1 = _questions[id][1]; _answer2 = _questions[id][2]; _answer3 = _questions[id][3]; _rightanswer = Integer.parseInt(""+_questions[id][4]); } //Announce the question private static void announceQuestion() { selectQuestion(); Broadcast.toAllOnlinePlayers("-----------------"); Broadcast.toAllOnlinePlayers("Question: "+_question); Broadcast.toAllOnlinePlayers("-----------------"); Broadcast.toAllOnlinePlayers("1: "+_answer1); Broadcast.toAllOnlinePlayers("2: "+_answer2); Broadcast.toAllOnlinePlayers("3: "+_answer3); Broadcast.toAllOnlinePlayers("-----------------"); status = STATUS_ANSWER; tpm.scheduleGeneral(task, _answerTime*1000); } //Announce the correct answer private static void announceCorrect() { Broadcast.toAllOnlinePlayers("-----------------"); Broadcast.toAllOnlinePlayers("The correct answer was: "+_rightanswer); Broadcast.toAllOnlinePlayers("-----------------"); announced++; giveReward(); status = STATUS_ASK; tpm.scheduleGeneral(task, 5000); } private static void announceStart() { _quizRunning = true; _players.clear(); Broadcast.toAllOnlinePlayers("Quiz Event begins! "+_questionNumber+" questions. "+_answerTime+" secs for answer each. "); Broadcast.toAllOnlinePlayers("Type . and the number of the correct answer to the chat. (Like: .1)"); Broadcast.toAllOnlinePlayers("Get Ready!"); status = STATUS_ASK; tpm.scheduleGeneral(task, 5000); } //Add a player and its answer public static void setAnswer(L2PcInstance player, int answer) { if( _players.containsKey(player) ) player.sendMessage("You already choosen an aswer!: "+_players.get(player)); else _players.put(player, answer); } private static void endEvent() { _quizRunning = false; Broadcast.toAllOnlinePlayers("The Quiz Event is over!"); announced = 0; status = STATUS_NOT_IN_PROGRESS; tpm.scheduleGeneral(task, _betweenTime*1000); } private static void giveReward() { for( L2PcInstance p: _players.keySet()) { if(_players.get(p) == _rightanswer) { p.sendMessage("Your answer was correct!"); p.addItem("Quiz", _rewardID, _rewardCount, p, true); } else { p.sendMessage("Your answer was not correct!"); } } _players.clear(); } } \ No newline at end of file Index: dist/game/data/scripts/Custom/QuizEvent/QuizEvent.xml =================================================================== --- dist/game/data/scripts/custom/QuizEvent/QuizEvent.xml (revision 8768) +++ dist/game/data/scripts/custom/QuizEvent/QuizEvent.xml (working copy) <?xml version="1.0" encoding="UTF-8"?> <list> <question id = "1" ask = "Quel type Bijoux Drop Baium" answer1 = "Necklace" answer2 = "Ring" answer3 = "Earring" correct = "2" /> <question id = "2" ask = "Comment s'appel l'admin" answer1 = "Bellatrix" answer2 = "Roberta" answer3 = "Jo" correct = "1" /> <question id = "3" ask = "Quel Recompense donne le tvt" answer1 = "Codex" answer2 = "Coin" answer3 = "EventCoin" correct = "3" /> </list> Index: dist/game/data/scripts/handlers/voicedcommandhandlers/Quiz.java =================================================================== --- dist/game/data/scripts/handlers/voicedcommandhandlers/Quiz.java (revision 0) +++ dist/game/data/scripts/handlers/voicedcommandhandlers/Quiz.java (working copy) package handlers.voicedcommandhandlers; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import custom.QuizEvent.QuizEvent; /** * @author Bellatrix */ public class Quiz implements IVoicedCommandHandler { private static final String[] _voicedCommands = { "quiz", "1", "2", "3" }; /** * @see Bellatrix */ @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) { if (command.equalsIgnoreCase("1") && QuizEvent._quizRunning) { QuizEvent.setAnswer(activeChar, 1); } if (command.equalsIgnoreCase("2") && QuizEvent._quizRunning) { QuizEvent.setAnswer(activeChar, 2); } if (command.equalsIgnoreCase("3") && QuizEvent._quizRunning) { QuizEvent.setAnswer(activeChar, 3); } return true; } /** * @see Bellatrix */ @Override public String[] getVoicedCommandList() { new QuizEvent(); return _voicedCommands; } } Index: dist/game/data/scripts/handlers/MasterHandlers.java =================================================================== --- dist/game/data/scripts/handlers/MasterHandlerjava (revision 0) +++ dist/game/data/scripts/handlers/Masterhandlers.java (working copy) import handlers.voicedcommandhandlers.Quiz; private static final Class<?>[] VOICED_COMMAND_HANDLERS = { StatsVCmd.class, // TODO: Add configuration options for this voiced commands: // CastleVCmd.class, // SetVCmd.class, (Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null), (Config.BANKING_SYSTEM_ENABLED ? Banking.class : null), (Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null), (Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null), (Config.L2JMOD_ENABLE_ONLINE_STATUS ? OnlineStatus.class : null), (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null), (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null), Quiz.class,
  16. Hello if you need any code/help about your server you can request here.
  17. 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);
  18. Well i found this event shared in acis forum long ago and i saw that someone is selling it for 15 euros and i just giggled. Here is the code reworked for aCis bugless and clean. Code: http://pastebin.com/zyBhenYm
  19. This little code will shows the real diff range of async between server and client position. By default, this code was maked for aCis but can be use for any L2J forks. ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java (revision 1133) +++ java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java (working copy) @@ -2,6 +2,8 @@ import java.nio.BufferUnderflowException; +import net.sf.l2j.commons.math.MathUtil; + import net.sf.l2j.Config; import net.sf.l2j.gameserver.model.actor.ai.CtrlIntention; import net.sf.l2j.gameserver.model.actor.instance.Player; @@ -95,6 +97,18 @@ activeChar.sendPacket(ActionFailed.STATIC_PACKET); return; } + + // Check async range. + dx = _originX - activeChar.getX(); + dy = _originY - activeChar.getY(); + double dz1 = _originZ - activeChar.getZ(); + float diff = (float) Math.sqrt(dx * dx + dy * dy + dz1 * dz1); + int heading = MathUtil.calculateHeadingFrom(_originX, _originY, activeChar.getX(), activeChar.getY()); + if (Math.abs(activeChar.getHeading() - heading) > 16000) + diff = diff * -1; + + activeChar.sendMessage("Async distance: " + diff); + activeChar.getAI().setIntention(CtrlIntention.MOVE_TO, new Location(_targetX, _targetY, _targetZ)); } } \ No newline at end of file Index: java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java (revision 1133) +++ java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java (working copy) @@ -1,5 +1,7 @@ package net.sf.l2j.gameserver.network.clientpackets; +import net.sf.l2j.commons.math.MathUtil; + import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.model.zone.ZoneId; import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle; @@ -88,5 +90,17 @@ player.setClientY(_y); player.setClientZ(_z); player.setClientHeading(_heading); // No real need to validate heading. + + // Check async range. + dx = _x - player.getX(); + dy = _y - player.getY(); + dz = _z - player.getZ(); + float diff = (float) Math.sqrt(dx * dx + dy * dy + dz * dz); + + int heading = MathUtil.calculateHeadingFrom(_x, _y, player.getX(), player.getY()); + if (Math.abs(player.getHeading() - heading) > 16000) + diff = diff * -1; + + player.sendMessage("[4] Async distance: " + diff); } } \ No newline at end of file Have fun, so!
  20. So i coded this like 2 years ago or something and people try to pull of stuff like claiming they had the ideas and shit. And the code: http://pastebin.com/DPWMYwuy Enjoy I know its shit coded but i don't have time to recode it.
  21. Hello guys! I use this TvT Event and I have add/fix/remove some things. If you have already this event you will understand what I mean. Removed useless lines/methods. Isn't something special but I wanted to share with you. Mana potions/Escape scrolls,skills fixed. Problems with NPC respawn/spawn. Added Respawn delay on die, Noblesse on die, Do not lose buffs (with config), Reward after 5/8/12/15/20 kills without die & announce the name of player with the count of kills without die. (if you die, kills goes 0 again). You can find the option of the kills count on TvTEvent.java [Watch the lines]. Players can't be healed on event (with config). .tvtjoin / .tvtleave / .tvtstatus Config/Npc [http://pastebin.com/xUd4bJhN] Core [http://pastebin.com/vkGuh57i] Core FOR 360+ rev [http://pastebin.com/ZF85SVBk] Systextures-html [https://dir50.com/6kww37s9u3dy/Systextures-html.rar.html] LINK 2 [if you find problem]
  22. 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 :)
  23. 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
  24. 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
  25. Short version : upon L2PHX (or any packet manipulation tool) use, the manual or automatic send of EnterWorld packet creates issues (for example, if the config spawn protection is activated, it sends anew the spawn protection, making you immune everytime you send back the packet). Simply select EnterWorld packet from "Packet Sniffer" tab, "Add packet to send..." and check "send every 100 ms". Issue : packet manipulation spam, calling multiple times the same subroutines (spawn protection custom and whatever custom you added in EnterWorld). Potentially fix other exploits based on your spawnMe() content. Fix : generate a new GameClientState (personally called ENTERING), isolate EnterWorld on it (RequestManorList being called automatically, it must be part of ENTERING too). Any subsequent calls of EnterWorld will call onUnknownPacket, because it will be considered out of ENTERING scope, since we're already at IN_GAME scope once the Player instance is fully loaded (such stuff already exists for all packets : login packets can't be called during ingame state, etc. It's just than EnterWorld is a transition packet between lobby and ingame, but it is considered an ingame packet while it shouldn't). Since chronicle got different opcodes, you have to adapt using your own chronicle opcodes. I can't and won't deliver a unique version for all chronicles. Since I'm an IL guy, I share for IL. The diff patch can help you to guess what to edit. Possible improvements : If you know more packets which should be sent only during that translation time between AUTHED and IN_GAME, you can answer here (notably for higher chronicles than IL) with your own version for your own chronicle. I will refresh the initial topic with the different versions. Not sure if RequestManorList can be called anywhere else (manor panel, etc). I preferred to keep it on IN_GAME. If you know the answer, consider to reply :) ! aCis version, based on latest (GameClient is generally called L2GameClient) : ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (revision 1146) +++ java/net/sf/l2j/gameserver/network/clientpackets/CharacterSelected.java (working copy) @@ -62,7 +62,7 @@ sendPacket(SSQInfo.sendSky()); - client.setState(GameClientState.IN_GAME); + client.setState(GameClientState.ENTERING); sendPacket(new CharSelected(cha, client.getSessionId().playOkID1)); } Index: java/net/sf/l2j/gameserver/network/GameClient.java =================================================================== --- java/net/sf/l2j/gameserver/network/GameClient.java (revision 1157) +++ java/net/sf/l2j/gameserver/network/GameClient.java (working copy) @@ -64,6 +64,7 @@ { CONNECTED, // client has just connected AUTHED, // client has authed but doesnt has character attached to it yet + ENTERING, // client is currently loading his Player instance, but didn't end IN_GAME // client has selected a char and is in game } @@ -168,6 +168,7 @@ case AUTHED: return "[Account: " + getAccountName() + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]"; + case ENTERING: case IN_GAME: return "[Character: " + (getPlayer() == null ? "disconnected" : getPlayer().getName()) + " - Account: " + getAccountName() + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]"; Index: java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java =================================================================== --- java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (revision 1145) +++ java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (working copy) @@ -51,6 +51,7 @@ break; } break; + case AUTHED: switch (opcode) { @@ -80,6 +81,43 @@ break; } break; + + case ENTERING: + switch (opcode) + { + case 0x03: + msg = new EnterWorld(); + break; + + case 0xd0: + int id2 = -1; + if (buf.remaining() >= 2) + { + id2 = buf.getShort() & 0xffff; + } + else + { + _log.warning("Client: " + client.toString() + " sent a 0xd0 without the second opcode."); + break; + } + + switch (id2) + { + case 8: + msg = new RequestManorList(); + break; + default: + printDebugDoubleOpcode(opcode, id2, buf, state, client); + break; + } + break; + + default: + printDebug(opcode, buf, state, client); + break; + } + break; + case IN_GAME: switch (opcode) { @@ -89,9 +127,6 @@ // case 0x02: // // Say ... not used any more ?? // break; - case 0x03: - msg = new EnterWorld(); - break; case 0x04: msg = new Action(); break; Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 1150) +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -35,6 +35,7 @@ import net.sf.l2j.gameserver.model.pledge.SubPledge; import net.sf.l2j.gameserver.model.zone.ZoneId; import net.sf.l2j.gameserver.network.SystemMessageId; +import net.sf.l2j.gameserver.network.GameClient.GameClientState; import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.Die; import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate; @@ -77,6 +78,8 @@ return; } + getClient().setState(GameClientState.IN_GAME); + final int objectId = player.getObjectId(); if (player.isGM())
×