Jump to content

davidBm

Members
  • Posts

    197
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by davidBm

  1. Some 1 have vote reward whhit npc html? for l2jfreya share it whit me plz. and happy new year!!!!!!!!
  2. Fixed. Error whas in:: gameserver/data/scripts/handler/skillhandler/mDam Thx for suport.!!!!
  3. i remake all PcInstance and the same... can you tell me where is the error
  4. i try to add one but i don.t remeber which one nad now i dont have one on only if i lost to remove some parts ....and i don.t know where is the wrong one
  5. i use l2j freya V. 6307 and i dont know from what is the error,, :(
  6. http://l2eraofpvp.uv.ro/ Join US Enchant - Max enchant: +18 Weaponds - Max enchant: +20 Armor - Normal Scroll: 60%. - Blessed Scroll: 80% Armor and 70 Weaponds - Attribute: up to lvl 7, rate 70%. Custom npc - Scheme Buffer: 3 hours duration. Buff slot: 35/16. - Gm Shop: you can find all the necessary items here, everything for Adena & Gold Bar - Gatekeeper. - Raid Boss Manager, with the respawn/info of grand bosses. - Bug Raport Manager, - Party Farm rb zone, - And more, Phoenix - Our server have installed phoenix event engine with all features, a lot of good events, no bugs and good reward. Server Feature - Auto Create Account - Drop protection based on damage - No Sub-class Quest - Max Sub-class: 3 - Auto Learn Skills - Auto Learn Loot - Off-Line Shop - Unstuck - 60 sec - Buff Time: 3h - Mana potions available - Olympiad Enchant Limit: +6 - 1 Week Olympiad Period - Starting points: 18 - Castle Sieges: every week - Territory Wars: every week - Dressme System - PvP Items can be enchanted, augmented, and elemented - Overbuff protection - PvP & Farm Zone - Raid Zones - PvP Reward - PvP Class Balance - Custom Community Board - Rbs have 5/6h Respawn, - ANTI BOOT PROTECTION!!! - No Custom - No Lag - And more. http://l2eraofpvp.uv.ro/
  7. some 1 share it whit no password????cuz this pass donse worck.thx I Crack the password. lock here free for all whit no password. have a nice day http://www.4shared.com/rar/AYAtTSLm/DavidBm.html?
  8. Problems with startup creating character. Quote
  9. ............ i chan't find java 7 up 21 pffffff FOUND :X:X:X:X
  10. HIII .I am looking for vote reward system whit comand like .reward or how can i make my vote reward to be in npc HTML? to worck? Individual vote reward:) Some help here plz thx all. And sory if you lost your time.
  11. Some help. i add all in my server and what npc i must create? or i must creat html? or what... cuz i don't now how to make him worck
  12. i Add it agan and again.. and is the same, code is correctly. lock. /* * Copyright © 2004-2013 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack 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 custom.Services; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.logging.Logger; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.datatables.CharNameTable; import com.l2jserver.gameserver.datatables.ClanTable; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.olympiad.OlympiadManager; import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; /** * @author Colet */ public class Services extends Quest { public static final Logger _log = Logger.getLogger(Services.class.getName()); // NPC Id int servicesNpc = 9013; // Noble Items int nobleItemId = 57; long nobleItemCount = 1; // PK Reduce Items int pkReduceItemId = 57; long pkReduceItemCount = 1000; // Change Name Items int changeNameItemId = 57; long changeNameItemCount = 1000000; boolean logNameChanges = true; // Change Clan Name Items int changeClanNameItemId = 57; long changeClanNameItemCount = 50000; boolean logClanNameChanges = true; int clanMinLevel = 5; // Clan Level Items int[] clanLevelItemsId = { 57, // Level 5 to 6 57, // Level 6 to 7 57, // Level 7 to 8 57, // Level 8 to 9 57, // Level 9 to 10 57 // Level 10 to 11 }; long[] clanLevelItemsCount = { 6, // Level 5 to 6 7, // Level 6 to 7 8, // Level 7 to 8 9, // Level 8 to 9 10, // Level 9 to 10 11 // Level 10 to 11 }; // Clan Reputation Points Items int clanReputationPointsItemId = 57; long clanReputationPointsItemCount = 5; // Change Gender Items int changeGenderItemId = 57; long changeGenderItemCount = 50; public Services(int questId, String name, String descr) { super(questId, name, descr); addStartNpc(servicesNpc); addFirstTalkId(servicesNpc); addTalkId(servicesNpc); } public static void main(String[] args) { new Services(-1, Services.class.getSimpleName(), "custom"); } public String onFirstTalk(L2Npc npc, L2PcInstance player) { if (player.getQuestState(getName()) == null) { newQuestState(player); } else if (player.isInCombat()) { return "Services-Blocked.htm"; } else if (player.getPvpFlag() == 1) { return "Services-Blocked.htm"; } else if (player.getKarma() != 0) { return "Services-Blocked.htm"; } else if (OlympiadManager.getInstance().isRegistered(player)) { return "Services-Blocked.htm"; } return "Services.htm"; } public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmlText = event; QuestState st = player.getQuestState(getName()); if (event.equals("setNoble")) { if (!player.isNoble()) { if (st.getQuestItemsCount(nobleItemId) >= nobleItemCount) { st.takeItems(nobleItemId, nobleItemCount); player.setNoble(true); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); player.broadcastUserInfo(); return "NoblesseServices-Success.htm"; } else { return "NoblesseServices-NoItems.htm"; } } else { return "NoblesseServices-AlredyNoble.htm"; } } else if (event.equals("levelUpClan")) { if (!player.isClanLeader()) { return "ClanLevelUp-NoLeader.htm"; } else { if (player.getClan().getLevel() == 11) { return "ClanLevelUp-MaxLevel.htm"; } else { if (((player.getClan().getLevel() <= 1) || (player.getClan().getLevel() == 2) || (player.getClan().getLevel() == 3) || (player.getClan().getLevel() == 4))) { player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else if (player.getClan().getLevel() == 5) { if (st.getQuestItemsCount(clanLevelItemsId[0]) >= clanLevelItemsCount[0]) { st.takeItems(clanLevelItemsId[0], clanLevelItemsCount[0]); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else { return "ClanLevelUp-NoItems.htm"; } } else if (player.getClan().getLevel() == 6) { if (st.getQuestItemsCount(clanLevelItemsId[1]) >= clanLevelItemsCount[1]) { st.takeItems(clanLevelItemsId[1], clanLevelItemsCount[1]); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else { return "ClanLevelUp-NoItems.htm"; } } else if (player.getClan().getLevel() == 7) { if (st.getQuestItemsCount(clanLevelItemsId[2]) >= clanLevelItemsCount[2]) { st.takeItems(clanLevelItemsId[2], clanLevelItemsCount[2]); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else { return "ClanLevelUp-NoItems.htm"; } } else if (player.getClan().getLevel() == 8) { if (st.getQuestItemsCount(clanLevelItemsId[3]) >= clanLevelItemsCount[3]) { st.takeItems(clanLevelItemsId[3], clanLevelItemsCount[3]); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else { return "ClanLevelUp-NoItems.htm"; } } else if (player.getClan().getLevel() == 9) { if (st.getQuestItemsCount(clanLevelItemsId[4]) >= clanLevelItemsCount[4]) { st.takeItems(clanLevelItemsId[4], clanLevelItemsCount[4]); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else { return "ClanLevelUp-NoItems.htm"; } } else if (player.getClan().getLevel() == 10) { if (st.getQuestItemsCount(clanLevelItemsId[5]) >= clanLevelItemsCount[5]) { st.takeItems(clanLevelItemsId[5], clanLevelItemsCount[5]); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); return "ClanLevelUp.htm"; } else { return "ClanLevelUp-NoItems.htm"; } } try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_level=? WHERE clan_id=?")) { statement.setInt(1, player.getClan().getLevel()); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { _log.info("Error updating clan level for player " + player.getName() + ". Error: " + e); } player.getClan().broadcastClanStatus(); return "ClanLevelUp.htm"; } } } else if (event.equals("changeGender")) { if (st.getQuestItemsCount(changeGenderItemId) >= changeGenderItemCount) { st.takeItems(changeGenderItemId, changeGenderItemCount); player.getAppearance().setSex(player.getAppearance().getSex() ? false : true); player.setTarget(player); player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0)); player.broadcastUserInfo(); return "ChangeGender-Success.htm"; } else { return "ChangeGender-NoItems.htm"; } } else if (event.startsWith("changeName")) { try { String newName = event.substring(11); if (st.getQuestItemsCount(changeNameItemId) >= changeNameItemCount) { if (newName == null) { return "ChangeName.htm"; } else { if (!newName.matches("^[a-zA-Z0-9]+$")) { player.sendMessage("Incorrect name. Please try again."); return "ChangeName.htm"; } else if (newName.equals(player.getName())) { player.sendMessage("Please, choose a different name."); return "ChangeName.htm"; } else if (CharNameTable.getInstance().doesCharNameExist(newName)) { player.sendMessage("The name " + newName + " already exists."); return "ChangeName.htm"; } else { if (logNameChanges) { String fileName = "log/Services/Name Change - " + player.getName() + ".txt"; new File(fileName); FileWriter fileText = new FileWriter(fileName); BufferedWriter fileContent = new BufferedWriter(fileText); fileContent.write("Character name change info:\r\n\r\nCharacter original name: " + player.getName() + "\r\nCharacter new name: " + newName); fileContent.close(); } st.takeItems(changeNameItemId, changeNameItemCount); player.setName(newName); player.store(); player.sendMessage("Your new character name is " + newName); player.broadcastUserInfo(); return "ChangeName-Success.htm"; } } } else { return "ChangeName-NoItems.htm"; } } catch (Exception e) { player.sendMessage("Please, insert a correct name."); return "ChangeName.htm"; } } else if (event.startsWith("reducePks")) { try { String pkReduceString = event.substring(10); int pkReduceCount = Integer.parseInt(pkReduceString); if (player.getPkKills() != 0) { if (pkReduceCount == 0) { player.sendMessage("Please, put a higher value."); return "PkServices.htm"; } else { if (st.getQuestItemsCount(pkReduceItemId) >= pkReduceItemCount) { st.takeItems(pkReduceItemId, pkReduceItemCount * pkReduceCount); player.setPkKills(player.getPkKills() - pkReduceCount); player.sendMessage("You have successfuly cleaned " + pkReduceCount + " PKs."); player.broadcastUserInfo(); return "PkServices-Success.htm"; } else { return "PkServices-NoItems.htm"; } } } else { return "PkServices-NoPks.htm"; } } catch (Exception e) { player.sendMessage("Incorrect value. Please try again."); return "PkServices.htm"; } } else if (event.startsWith("changeClanName")) { if (player.getClan() == null) { return "ChangeClanName-NoClan.htm"; } else { try { String newClanName = event.substring(15); if (st.getQuestItemsCount(changeClanNameItemId) >= changeClanNameItemCount) { if (newClanName == null) { return "ChangeClanName.htm"; } else { if (!player.isClanLeader()) { player.sendMessage("Only the clan leader can change the clan name."); return "ChangeClanName.htm"; } else if (player.getClan().getLevel() < clanMinLevel) { player.sendMessage("Your clan must be at least level " + clanMinLevel + " to change the name."); return "ChangeClanName.htm"; } else if (!newClanName.matches("^[a-zA-Z0-9]+$")) { player.sendMessage("Incorrect name. Please try again."); return "ChangeClanName.htm"; } else if (newClanName.equals(player.getClan().getName())) { player.sendMessage("Please, choose a different name."); return "ChangeClanName.htm"; } else if (null != ClanTable.getInstance().getClanByName(newClanName)) { player.sendMessage("The name " + newClanName + " already exists."); return "ChangeClanName.htm"; } else { if (logClanNameChanges) { String fileName = "log/Services/Clan Name Change - " + player.getClan().getName() + ".txt"; new File(fileName); FileWriter fileText = new FileWriter(fileName); BufferedWriter fileContent = new BufferedWriter(fileText); fileContent.write("Clan name change info:\r\n\r\nClan original name: " + player.getClan().getName() + "\r\nClan new name: " + newClanName + "\r\nClan Leader: " + player.getName()); fileContent.close(); } st.takeItems(changeNameItemId, changeNameItemCount); player.getClan().setName(newClanName); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_name=? WHERE clan_id=?")) { statement.setString(1, newClanName); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { _log.info("Error updating clan name for player " + player.getName() + ". Error: " + e); } player.sendMessage("Your new clan name is " + newClanName); player.getClan().broadcastClanStatus(); return "ChangeClanName-Success.htm"; } } } else { return "ChangeClanName-NoItems.htm"; } } catch (Exception e) { player.sendMessage("Please, insert a correct name."); return "ChangeClanName.htm"; } } } else if (event.startsWith("setReputationPoints")) { try { String reputationPointsString = event.substring(20); int reputationPointsCount = Integer.parseInt(reputationPointsString); if (player.getClan() == null) { return "ClanReputationPoints-NoClan.htm"; } else if (!player.isClanLeader()) { return "ClanReputationPoints-NoLeader.htm"; } else { if (reputationPointsCount == 0) { player.sendMessage("Please, put a higher value."); return "ClanReputationPoints.htm"; } else { if (st.getQuestItemsCount(clanReputationPointsItemId) >= clanReputationPointsItemCount) { st.takeItems(clanReputationPointsItemId, clanReputationPointsItemCount * reputationPointsCount); player.getClan().addReputationScore(player.getClan().getReputationScore() + reputationPointsCount, true); player.getClan().broadcastClanStatus(); return "ClanReputationPoints-Success.htm"; } else { return "ClanReputationPoints-NoItems.htm"; } } } } catch (Exception e) { player.sendMessage("Incorrect value. Please try again."); return "ClanReputationPoints.htm"; } } return htmlText; } }
  13. Hi all some help there ar the error!!!! http://postimg.org/image/yig1nnyv1/
  14. SOme 1 adept it to freya"??? :D plz Sory for spawn
  15. When you will adept it for freya? plz thx.:)
  16. Fixed. Thx for suport.
  17. how.... i must add in Buff_list... like Rezist Fire is lvl 3 to add him lvl 4? or now..
  18. Hi all. How Can i make Rin4A's Scheme Buffer whit buffs +30.????
  19. Error. Help. http://postimg.org/image/r28k0kbw1/ For all items he say is no't encantable!!! Here is the code what i make for freya. Some help plz thx package custom.Enchant; import java.util.logging.Logger; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.itemcontainer.Inventory; import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.olympiad.OlympiadManager; import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.network.serverpackets.CharInfo; import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo; import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate; import com.l2jserver.gameserver.network.serverpackets.UserInfo; public class Enchant extends Quest { public static final Logger _log = Logger.getLogger(Enchant.class.getName()); private final static int npcId = 9994; // Item required to enchant armor +1 private final static int itemRequiredArmor = 6393; private final static int itemRequiredArmorCount = 50; // Item required to enchant jewels +1 private final static int itemRequiredJewels = 6393; private final static int itemRequiredJewelsCount = 50; // Item required to enchant weapon +1 private final static int itemRequiredWeapon = 6393; private final static int itemRequiredWeaponCount = 150; // Item required to enchant belt/shirt +1 private final static int itemRequiredBeltShirt = 6393; private final static int itemRequiredBeltShirtCount = 100; public Enchant(int questId, String name, String descr) { super(questId, name, descr); addStartNpc(npcId); addFirstTalkId(npcId); addTalkId(npcId); } public static void main(String[] args) { new Enchant(-1, Enchant.class.getSimpleName(), "custom"); } public String onFirstTalk(L2Npc npc, L2PcInstance player) { String enchantType = "Enchant.htm"; if (player.getQuestState(getName()) == null) { newQuestState(player); } else if (player.isInCombat()) { return drawHtml("You are in combat", "Don't fight if you want to talk with me!", enchantType); } else if (player.getPvpFlag() == 1) { return drawHtml("You are flagged", "Don't fight if you want to talk with me!", enchantType); } else if (player.getKarma() != 0) { return drawHtml("You are in chaotic state", "Don't fight if you want to talk with me!", enchantType); } else if (OlympiadManager.getInstance().isRegistered(player)) { return drawHtml("You are registered for Olympiad", "You can't use my services<br1>while playing the Olympiad.", enchantType); } return "Enchant.htm"; } public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmlText = event; String enchantType = "Enchant.htm"; int armorType = -1; // Armor parts if (event.equals("enchantHelmet")) { armorType = Inventory.PAPERDOLL_HEAD; enchantType = "EnchantArmor.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredArmor, itemRequiredArmorCount); } else if (event.equals("enchantChest")) { armorType = Inventory.PAPERDOLL_CHEST; enchantType = "EnchantArmor.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredArmor, itemRequiredArmorCount); } else if (event.equals("enchantLeggings")) { armorType = Inventory.PAPERDOLL_LEGS; enchantType = "EnchantArmor.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredArmor, itemRequiredArmorCount); } else if (event.equals("enchantGloves")) { armorType = Inventory.PAPERDOLL_GLOVES; enchantType = "EnchantArmor.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredArmor, itemRequiredArmorCount); } else if (event.equals("enchantBoots")) { armorType = Inventory.PAPERDOLL_FEET; enchantType = "EnchantArmor.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredArmor, itemRequiredArmorCount); } else if (event.equals("enchantShieldOrSigil")) { armorType = Inventory.PAPERDOLL_LHAND; enchantType = "EnchantArmor.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredArmor, itemRequiredArmorCount); } // Jewels else if (event.equals("enchantUpperEarring")) { armorType = Inventory.PAPERDOLL_LEAR; enchantType = "EnchantJewels.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredJewels, itemRequiredJewelsCount); } else if (event.equals("enchantLowerEarring")) { armorType = Inventory.PAPERDOLL_REAR; enchantType = "EnchantJewels.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredJewels, itemRequiredJewelsCount); } else if (event.equals("enchantNecklace")) { armorType = Inventory.PAPERDOLL_NECK; enchantType = "EnchantJewels.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredJewels, itemRequiredJewelsCount); } else if (event.equals("enchantUpperRing")) { armorType = Inventory.PAPERDOLL_LFINGER; enchantType = "EnchantJewels.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredJewels, itemRequiredJewelsCount); } else if (event.equals("enchantLowerRing")) { armorType = Inventory.PAPERDOLL_RFINGER; enchantType = "EnchantJewels.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredJewels, itemRequiredJewelsCount); } // Belt/Shirt else if (event.equals("enchantBelt")) { armorType = Inventory.PAPERDOLL_BELT; enchantType = "EnchantBeltShirt.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredBeltShirt, itemRequiredBeltShirtCount); } else if (event.equals("enchantShirt")) { armorType = Inventory.PAPERDOLL_UNDER; enchantType = "EnchantBeltShirt.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredBeltShirt, itemRequiredBeltShirtCount); } // Weapon else if (event.equals("enchantWeapon")) { armorType = Inventory.PAPERDOLL_RHAND; enchantType = "EnchantWeapon.htm"; htmlText = enchant(enchantType, player, armorType, itemRequiredWeapon, itemRequiredWeaponCount); } return htmlText; } private String enchant(String enchantType, L2PcInstance player, int armorType, int itemRequired, int itemRequiredCount) { QuestState st = player.getQuestState(getName()); int currentEnchant = 0; int newEnchantLevel = 0; if (st.getQuestItemsCount(itemRequired) >= itemRequiredCount) { try { L2ItemInstance item = getItemToEnchant(player, armorType); if (item != null) { if ( item.isCommonItem() && item.isEquipable() && !item.isConsumable() && !item.isCommonItem() && !item.isOlyRestrictedItem() && !item.isShadowItem() && !item.isQuestItem() ) { currentEnchant = item.getEnchantLevel(); if ( currentEnchant < 20 ) { newEnchantLevel = setEnchant(player, item, currentEnchant+1, armorType); if ( newEnchantLevel > 0 ) { st.takeItems(itemRequired, itemRequiredCount); player.sendMessage("You successfully enchanted your " + item.getItem().getName() +" from +" + currentEnchant + " to +" + newEnchantLevel + "!"); String htmlContent = "<center>You successfully enchanted your:<br>"+ "<font color=\"FF7200\">" + item.getItem().getName() + "</font><br>"+ "From: <font color=\"AEFF00\">+" + currentEnchant + "</font> to <font color=\"AEFF00\">+" + newEnchantLevel + "</font>"+ "</center>"; return drawHtml("Congratulations!", htmlContent, enchantType); } } else { player.sendMessage("Your " + item.getItem().getName() + " is already +20!"); return drawHtml("It's already +20", "<center>Your <font color=\"FF7200\">" + item.getItem().getName() +"</font> is already +20!</center>", enchantType); } } else { player.sendMessage("Your " + item.getItem().getName() + " is not enchantable!"); return drawHtml("Not enchantable item!", "<center>Your <font color=\"FF7200\">" + item.getItem().getName() +"</font> is not enchantable!</center>", enchantType); } } } catch (StringIndexOutOfBoundsException e) { player.sendMessage("Something went wrong. Are equiped with the item?"); return drawHtml("Error Enchant", "<center>Something went wrong.<br>Are equiped with the item?</center>", enchantType); } catch (NumberFormatException e) { player.sendMessage("Something went wrong. Are equiped with the item?"); return drawHtml("Error Enchant", "<center>Something went wrong.<br>Are equiped with the item?</center>", enchantType); } player.sendMessage("Something went wrong. Are equiped with the item?"); return drawHtml("Error Enchant", "<center>Something went wrong.<br>Are equiped with the item?</center>", enchantType); } else { String content = "<center>"+ "Not enough <font color=\"FF7200\">Event - Glitering Medals</font>!<br>"; if ( st.getQuestItemsCount(itemRequired) > 0 ) { content += "You have " + st.getQuestItemsCount(itemRequired) + " Glittering Medals,<br1>"+ "Need " + (itemRequiredCount - st.getQuestItemsCount(itemRequired)) + " more."; } else { content += "You need <font color=\"FF7200\">" + itemRequiredCount + " Event - Glitering Medals</font>!"; } content += "</center>"; return drawHtml("Not Enough Items", content, enchantType); } } private L2ItemInstance getItemToEnchant(L2PcInstance player, int armorType) { L2ItemInstance itemInstance = null; L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType); if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType)) { itemInstance = parmorInstance; if (itemInstance != null) { return itemInstance; } } return null; } private int setEnchant(L2PcInstance player, L2ItemInstance item, int newEnchantLevel, int armorType) { if (item != null) { // set enchant value player.getInventory().unEquipItemInSlot(armorType); item.setEnchantLevel(newEnchantLevel); player.getInventory().equipItem(item); // send packets InventoryUpdate iu = new InventoryUpdate(); iu.addModifiedItem(item); player.sendPacket(iu); player.broadcastPacket(new CharInfo(player)); player.sendPacket(new UserInfo(player)); player.broadcastPacket(new ExBrExtraUserInfo(player)); return newEnchantLevel; } return -1; } public String drawHtml(String title, String content, String enchantType) { String html = "<html>"+ "<title>L2Mondial Enchanter</title>"+ "<body>"+ "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"+ "<font color=\"FF9900\">" + title + "</font></center><br>"+ content + "<br><br>"+ "<center><a action=\"bypass -h Quest Enchant " + enchantType + "\">Go Back</a></center>"+ "</body>"+ "</html>"; return html; } }
  20. Thx.. Close topic plz.
  21. hi all. sory for my english. if you want to do an Custom item to be worn only by a class. How do I do this? <and> <using kind="Tank"/> </and> </mul> </for> Some help plz. thx
  22. Thx... for Share man i like your worck GL. and thx again. In my Server worck fine.
×
×
  • Create New...