-
Posts
94 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by L2Reon
-
Vortex Vote Reward NPC
L2Reon replied to L2Reon's question in Request Server Development Help [Greek]
egw to perasa file eine auto edw tou elfocrash http://maxcheaters.com/forum/index.php?topic=244712.0 -
Ti ennoeis allo?zitise account manager gia l2jfrozen kai tou ton edosa.auto eine ena npc pou allazei to password tou.ti allo 8elei diladi?
-
Account Manager L2JFrozen: l2jfrozen.gameserver.model.actor.instance Create java file with name L2PasswordChangerInstance make one npc with type:L2PasswordChanger /* 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 com.l2jfrozen.gameserver.model.actor.instance; import com.l2jfrozen.crypt.Base64; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.LeaveWorld; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.util.database.L2DatabaseFactory; import java.security.MessageDigest; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.StringTokenizer; import javolution.text.TextBuilder; public class L2PasswordChangerInstance extends L2FolkInstance { public L2PasswordChangerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } public void onBypassFeedback(L2PcInstance player, String command) { if (command.startsWith("change_password")) { StringTokenizer st = new StringTokenizer(command); st.nextToken(); String currPass = null; String newPass = null; String repeatNewPass = null; try { if (st.hasMoreTokens()) { currPass = st.nextToken(); newPass = st.nextToken(); repeatNewPass = st.nextToken(); } else { player.sendMessage("Please fill in all the blanks before requesting for a password change."); return; } changePassword(currPass, newPass, repeatNewPass, player); } catch (StringIndexOutOfBoundsException e) { } } } public void onAction(L2PcInstance player) { if (!canTarget(player)) { return; } if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), 0)); player.sendPacket(new ValidateLocation(this)); } else if (!canInteract(player)) { player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); } else { showHtmlWindow(player); } player.sendPacket(new ActionFailed()); } private void showHtmlWindow(L2PcInstance activeChar) { NpcHtmlMessage nhm = new NpcHtmlMessage(5); TextBuilder replyMSG = new TextBuilder(""); replyMSG.append("<html><title>L2 Test Account Manager</title>"); replyMSG.append("<body><center>"); replyMSG.append("To change your password:<br1> First fill in your current password and then your new!</font><br>"); replyMSG.append("Current Password: <edit var=\"cur\" width=100 height=15><br>"); replyMSG.append("New Password: <edit var=\"new\" width=100 height=15><br>"); replyMSG.append("Repeat New Password: <edit var=\"repeatnew\" width=100 height=15><br><br>"); replyMSG.append("<button value=\"Change Password\" action=\"bypass -h npc_" + getObjectId() + "_change_password $cur $new $repeatnew\" width=204 height=20 back=\"sek.cbui75\" fore=\"sek.cbui75\">"); replyMSG.append("</center></body></html>"); nhm.setHtml(replyMSG.toString()); activeChar.sendPacket(nhm); activeChar.sendPacket(new ActionFailed()); } public static boolean changePassword(String currPass, String newPass, String repeatNewPass, L2PcInstance activeChar) { if (newPass.length() < 5) { activeChar.sendMessage("The new password is too short!"); return false; } if (newPass.length() > 20) { activeChar.sendMessage("The new password is too long!"); return false; } if (!newPass.equals(repeatNewPass)) { activeChar.sendMessage("Repeated password doesn't match the new password."); return false; } Connection con = null; String password = null; try { MessageDigest md = MessageDigest.getInstance("SHA"); byte[] raw = currPass.getBytes("UTF-8"); raw = md.digest(raw); String currPassEncoded = Base64.encodeBytes(raw); con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT password FROM accounts WHERE login=?"); statement.setString(1, activeChar.getAccountName()); ResultSet rset = statement.executeQuery(); while (rset.next()) { password = rset.getString("password"); } rset.close(); statement.close(); byte[] password2 = null; if (currPassEncoded.equals(password)) { password2 = newPass.getBytes("UTF-8"); password2 = md.digest(password2); PreparedStatement statement2 = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?"); statement2.setString(1, Base64.encodeBytes(password2)); statement2.setString(2, activeChar.getAccountName()); statement2.executeUpdate(); statement2.close(); activeChar.sendMessage("Congratulations! Your password has been changed succesfully. You will now be disconnected for security reasons. Please login again!"); try { Thread.sleep(3000L); } catch (Exception e) { } activeChar.deleteMe(); activeChar.sendPacket(new LeaveWorld()); } else { activeChar.sendMessage("The current password you've inserted is incorrect! Please try again!"); return password2 != null; } } catch (Exception e) { _log.warning("could not update the password of account: " + activeChar.getAccountName()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { _log.warning("Failed to close database connection!"); } } return true; } }
-
Kanw compile to build kai mou vgazei error.kai grafei auta edw. [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6 [javac] C:\Users\user\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\vortextengine\VoteMain.java:21: error: diamond operator is not supported in -source 1.6 [javac] public static FastList<String> voterList = new FastList<>(); [javac] ^ [javac] (use -source 7 or higher to enable diamond operator) [javac] C:\Users\user\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\vortextengine\datatables\PlayerTable.java:20: error: try-with-resources is not supported in -source 1.6 [javac] try (Connection con = L2DatabaseFactory.getInstance().getConnection()) [javac] ^ [javac] (use -source 7 or higher to enable try-with-resources) [javac] C:\Users\user\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\vortextengine\tasks\TriesResetTask.java:24: error: try-with-resources is not supported in -source 1.6 [javac] try (Connection con = L2DatabaseFactory.getInstance().getConnection()) [javac] ^
-
Diskolia me ta Imports
L2Reon replied to Cronia's question in Request Server Development Help [Greek]
Για δοκιμασε αυτο. import sys from java.util import Iterator from com.l2jfrozen.util.random import Rnd from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jfrozen.gameserver.network.serverpackets import CreatureSay from com.l2jfrozen.util.database import L2DatabaseFactory -
Ok to eftia3a euxaristw gia to help Devlin.Lock the topic.
-
to thema eine to pws...stin navicat alla pou?
-
Evala san farm zone to antharas lair kanw teleport me enan test player dn me pigenei sto farm zone kai me 3anagurizei giran. Project:L2JFrozen
-
Enchant Failed Scrolls
L2Reon replied to L2Reon's question in Request Server Development Help [Greek]
Ok to dokimasa kai doulevei na se kala.Lock The Topic -
Enchant Failed Scrolls
L2Reon replied to L2Reon's question in Request Server Development Help [Greek]
file mou euxaristw -
nai auto ennoousa.ara3e dn se eipa oti to eklepses
-
Nomizw eixe gunei share apla esu ala3es ta html?
-
Enchant Failed Scrolls
L2Reon replied to L2Reon's question in Request Server Development Help [Greek]
re file ti na katalavw dn exoume tis idies gnoseis panw stin java giauto psaxnw kapion na mporesei na mou to kanei. -
Enchant Failed Scrolls
L2Reon replied to L2Reon's question in Request Server Development Help [Greek]
l2jfrozen pack exw nai to 8ema eine oti dn 3erw ton custom code... -
Kalispera Magkes pos mporo na kanw to idio gia ta crystall scrolls? Project:L2JFrozen # Enchant after break with blessed scroll. BreakEnchant = 0
-
Problem with crystal scroll
L2Reon replied to L2Reon's question in Request Server Development Help [Greek]
Lock the topic thanks for help! -
Lock the topic thanks for help!
-
gia na doume tha apantisei kaneis...euxaristw pantos...
-
magkes?....
-
ok file euxaristw pou mou to eipes.mipos gnorizeis kati gia to provlima?
-
bump.
-
nai l2jfrozen
-
nai giati egw ta exw vgalei :P
-
swsta :P
-
Kalispera...exw ena provlima to opoio eine oti ston server mou exw kanei safe 3 max 16 ta weapon kai safe 3 max 12 armor kai jewel. kai epeidh evala ta crystall scroll 100% ekana enchant to s grade crystal scroll kai ta weapon pigenoun mexri +16 komple alla h armor dn stamataei sto +12 kai pigenei kai auti mexri +16 me ta scrolls. na kai to config arxeio.Kai episis thelw na valw 1 crystall gia ola ta grade twn weapons kai 1 crystall gia ola ta grade twn armors pos to kanw auto?doulevw se l2jfrozen project. #============================================================# # Enchant Settings # #============================================================# # Pack: l2jfrozen Site: [url=http://www.l2jfrozen.com]www.l2jfrozen.com[/url] # #============================================================# # ---------------------------------------------- # Special Enchanting System - # ---------------------------------------------- # Chance enchanting presented as a series of pairs of numbers where the first # Indicates the number of levels, and the second chance of successful enchanting. # Also have the option of limiting the maximum level of echanting # For weapons / armor / jewelry. # If you have a maximum level of grinding 50 and you do not want # Give all the chances for each level (from 1 to 50) then # You can specify for example: # NormalWeaponEnchantLevel = 1,100; 2,100; 3,100; 4,75; 5,50; # Example: 5,92; = if you enchant weapon to +5 you have 92% to success. # ---------------------------------------------- # Chance For Normal Scrolls - # ---------------------------------------------- # Weapon NormalWeaponEnchantLevel = 1,100;2,100;3,100;4,60;5,60;6,60;7,60;8,60;9,60;10,60;11,60;12,60;13,60;14,60;15,60;16,60; # Armor NormalArmorEnchantLevel = 1,100;2,100;3,100;4,60;5,60;6,60;7,60;8,60;9,60;10,60;11,60;12,60; # Jewel NormalJewelryEnchantLevel = 1,100;2,100;3,100;4,60;5,60;6,60;7,60;8,60;9,60;10,60;11,60;12,60; # ---------------------------------------------- # Chance For Blessed Scrolls - # ---------------------------------------------- # Weapon BlessWeaponEnchantLevel = 1,100;2,100;3,100;4,85;5,85;6,85;7,85;8,85;9,85;10,85;11,85;12,85;13,85;14,85;15,85;16,85; # Armor BlessArmorEnchantLevel = 1,100;2,100;3,100;4,85;5,85;6,85;7,85;8,85;9,85;10,85;11,85;12,85; # Jewel BlessJewelryEnchantLevel = 1,100;2,100;3,100;4,85;5,85;6,85;7,85;8,85;9,85;10,85;11,85;12,85; # --------------------------------------------- # Chance For Crystal Scrolls - # --------------------------------------------- # Weapon CrystalWeaponEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100; # Armor CrystalArmorEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100; # Jewel CrystalJewelryEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100; # Safe enchant EnchantSafeMax = 3 EnchantSafeMaxFull = 3 # Crystal Limits CrystalEnchantMin = 1 CrystalEnchantMax = 16 # Max enchant Settings by scrolls. EnchantWeaponMax=16 EnchantArmorMax=12 EnchantJewelryMax=12 # On / off bonuses at enchant dwarfs # Custom Patch, Dwarf have a bonus on Enchant! # Default: False EnableDwarfEnchantBonus = False # Minimun level for enchant DwarfEnchantMinLevel = 80 # bonus enchant DwarfEnchantBonus = 15 # On / off enchant hero weapons EnableEnchantHeroWeapons = False # The value of enchanting # For example: If CustomEnchantValue = 5 Sharpening will: # From 0 till the +5, with +5 to +10, from +10 to +15, etc. # Total: 15 for three to scroll # Default: 1 CustomEnchantValue = 1 # -------------------------- # Augmentation - # -------------------------- # Chance to get a skill # Default: 15, 30, 45, 60 AugmentationNGSkillChance = 2 AugmentationMidSkillChance = 3 AugmentationHighSkillChance = 8 AugmentationTopSkillChance = 25 # Chance to get a base stat # Default: 1 AugmentationBaseStatChance = 1 # Chance to get the glow # Note: # No Grade / Mid Grade not have emission # Default: 0, 40, 70, 100 AugmentationNGGlowChance = 0 AugmentationMidGlowChance = 40 AugmentationHighGlowChance = 100 AugmentationTopGlowChance = 100 # Augments Active and Passive skills delete on change weapon DeleteAgmentPassiveEffectOnChangeWep=true DeleteAgmentActiveEffectOnChangeWep=true # ---------------------- # Soul Crystal - # ---------------------- # The chance that the crystal breaks SoulCrystalBreakChance = 10 # Chance to improve Cristal SoulCrystalLevelChance = 32 # Chance to improve Cristal SoulCrystalMaxLevel = 13 #---------------------- # Enchant limit for Olympiad battles. # (Maximum enchant level allowed for an item to be equipped, -1 to disable) AltOlyMaxEnchant = -1 # Enchant after break with blessed scroll. BreakEnchant = 3 # Limit enchant GM players (// setew and others) (0 disabled) GMOverEnchant = 17 # IMPORTANT: anti Over Enchant system # HOW WORKS: if you set it to 16, and player have an item > 16 # he will be kicked and the item will disappear! # Enchant amount at which a player gets punished (0 disabled) EnchantKick = 18
