xAddytzu Posted March 31, 2010 Share Posted March 31, 2010 Well, I decided to do such a thing because I find it beautiful and useful ... I will make a diff and I will post it ... Also You can put menu when an player become killing spree, I mean consecutive kills or You can make handler with custom items .. Feedback, please? ============================================ @@ L2PcInstance.java ============================================ + public void showEnchantHtml() + { + TextBuilder text = new TextBuilder(); + text.append("<html>"); + text.append("<body>"); + text.append("<title>Enchant Menu</title>"); + text.append("<center>"); + text.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32>"); + text.append("</center>"); + text.append("<br><br>"); + text.append("<table width=\"85%\"><tr><td>Hello, "+getName()+", You can choose your item to enchant!</td></tr></table><br>"); + text.append("<table>"); + text.append("<tr>"); + text.append("<td><button value=\"\" action=\"\" width=32 height=32 back=\"icon.NOIMAGE\" fore=\"icon.NOIMAGE\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_headItem\" width=32 height=32 back=\"icon.armor_leather_helmet_i00\" fore=\"icon.armor_leather_helmet_i00\"></td>"); + text.append("<td><button value=\"\" action=\"\" width=32 height=32 back=\"icon.NOIMAGE\" fore=\"icon.NOIMAGE\"></td>"); + text.append("<td><button value=\"\" action=\"\" width=32 height=32 back=\"icon.NOIMAGE\" fore=\"icon.NOIMAGE\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_neck\" width=32 height=32 back=\"icon.accessary_another_worlds_necklace_i00\" fore=\"icon.accessary_another_worlds_necklace_i00\"></td>"); + text.append("</tr>"); + text.append("<tr>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_rhand\" width=32 height=32 back=\"Icon.weapon_sword_of_priest_i00\" fore=\"Icon.weapon_sword_of_priest_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_chestItem\" width=32 height=32 back=\"Icon.armor_t89_ul_i00\" fore=\"Icon.armor_t89_ul_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_lhand\" width=32 height=32 back=\"Icon.shield_doom_shield_i00\" fore=\"Icon.shield_doom_shield_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_rfinger\" width=32 height=32 back=\"Icon.accessary_another_worlds_earing_i00\" fore=\"Icon.accessary_another_worlds_earing_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_lfinger\" width=32 height=32 back=\"Icon.accessary_another_worlds_earing_i00\" fore=\"Icon.accessary_another_worlds_earing_i00\"></td>"); + text.append("</tr>"); + text.append("<tr>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_rhand\" width=32 height=32 back=\"Icon.armor_t89_g_i00\" fore=\"Icon.armor_t89_g_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_chestItem\" width=32 height=32 back=\"Icon.armor_t89_l_i00\" fore=\"Icon.armor_t89_l_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_lhand\" width=32 height=32 back=\"Icon.armor_t89_b_i00\" fore=\"Icon.armor_t89_b_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_rfinger\" width=32 height=32 back=\"Icon.accessary_another_worlds_ring_i00\" fore=\"Icon.accessary_another_worlds_ring_i00\"></td>"); + text.append("<td><button value=\"\" action=\"bypass -h enchant_lfinger\" width=32 height=32 back=\"Icon.accessary_another_worlds_ring_i00\" fore=\"Icon.accessary_another_worlds_ring_i00\"></td>"); + text.append("</tr>"); + text.append("</table>"); + text.append("<center><img src=\"L2UI.SquareWhite\" width=\"280\" height=\"1\"></center><br>"); + text.append("<table width=\"85%\"><tr><td>Thanks xAddytzu</td></tr></table>"); + text.append("</body>"); + text.append("</html>"); + NpcHtmlMessage html = new NpcHtmlMessage(1); + html.setHtml(text.toString()); + sendPacket(html); + } ============================================ @@ RequestBypassToServer.java ============================================ + else if (_command.startsWith("enchant_")) + { + SystemMessage sm; + int maxEnchantLevelw = 0; + int maxEnchantLevela = 0; + int maxEnchantLevelj = 0; + maxEnchantLevelw = Config.ENCHANT_MAX_WEAPON; + maxEnchantLevela = Config.ENCHANT_MAX_ARMOR; + maxEnchantLevelj = Config.ENCHANT_MAX_JEWELRY; + Inventory inv = activeChar.getInventory(); + L2ItemInstance rhand = inv.getPaperdollItem(Inventory.PAPERDOLL_RHAND); + L2ItemInstance lhand = inv.getPaperdollItem(Inventory.PAPERDOLL_LHAND); + L2ItemInstance lrhand = inv.getPaperdollItem(Inventory.PAPERDOLL_LRHAND); + + L2ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST); + L2ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS); + L2ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD); + L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES); + L2ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET); + + L2ItemInstance neck = inv.getPaperdollItem(Inventory.PAPERDOLL_NECK); + L2ItemInstance rfinger = inv.getPaperdollItem(Inventory.PAPERDOLL_RFINGER); + L2ItemInstance lfinger = inv.getPaperdollItem(Inventory.PAPERDOLL_LFINGER); + L2ItemInstance rear = inv.getPaperdollItem(Inventory.PAPERDOLL_REAR); + L2ItemInstance lear = inv.getPaperdollItem(Inventory.PAPERDOLL_LEAR); + + if(!activeChar.validateBypass(_command)) + return; + + int endOfId = _command.indexOf('_', 5); + String id; + if (endOfId > 0) + id = _command.substring(4, endOfId); + else + id = _command.substring(4); + try + { + if (_command.substring(endOfId+1).startsWith("rhand")) + { + + if (rhand.getOwnerId() != activeChar.getObjectId() || (rhand.getEnchantLevel() >= maxEnchantLevelw && maxEnchantLevelw != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (rhand == null) + return; + if (rhand.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(rhand.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(rhand.getEnchantLevel()); + sm.addItemName(rhand.getItemId()); + activeChar.sendPacket(sm); + } + rhand.setEnchantLevel(rhand.getEnchantLevel() + 1); + rhand.updateDatabase(); + //spreeKills = 0; + } + else if (_command.substring(endOfId+1).startsWith("lhand")) + { + if (lhand.getOwnerId() != activeChar.getObjectId() || (lhand.getEnchantLevel() >= maxEnchantLevelw && maxEnchantLevelw != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (lhand == null) + return; + if (lhand.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(lhand.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(lhand.getEnchantLevel()); + sm.addItemName(lhand.getItemId()); + activeChar.sendPacket(sm); + } + lhand.setEnchantLevel(lhand.getEnchantLevel() + 1); + lhand.updateDatabase(); + //spreeKills = 0; + } + else if (_command.substring(endOfId+1).startsWith("lrhand")) + { + if (lrhand.getOwnerId() != activeChar.getObjectId() || (lrhand.getEnchantLevel() >= maxEnchantLevelw && maxEnchantLevelw != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (lrhand == null) + return; + if (lrhand.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(lrhand.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(lrhand.getEnchantLevel()); + sm.addItemName(lrhand.getItemId()); + activeChar.sendPacket(sm); + } + lrhand.setEnchantLevel(lrhand.getEnchantLevel() + 1); + lrhand.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("chestItem")) + { + if (chestItem.getOwnerId() != activeChar.getObjectId() || (chestItem.getEnchantLevel() >= maxEnchantLevela && maxEnchantLevela != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (chestItem == null) + return; + if (chestItem.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(chestItem.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(chestItem.getEnchantLevel()); + sm.addItemName(chestItem.getItemId()); + activeChar.sendPacket(sm); + } + chestItem.setEnchantLevel(chestItem.getEnchantLevel() + 1); + chestItem.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("legsItem")) + { + if (legsItem.getOwnerId() != activeChar.getObjectId() || (legsItem.getEnchantLevel() >= maxEnchantLevela && maxEnchantLevela != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (legsItem == null) + return; + if (legsItem.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(legsItem.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(legsItem.getEnchantLevel()); + sm.addItemName(legsItem.getItemId()); + activeChar.sendPacket(sm); + } + legsItem.setEnchantLevel(legsItem.getEnchantLevel() + 1); + legsItem.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("headItem")) + { + if (headItem.getOwnerId() != activeChar.getObjectId() || (headItem.getEnchantLevel() >= maxEnchantLevela && maxEnchantLevela != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (headItem == null) + return; + if (headItem.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(headItem.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(headItem.getEnchantLevel()); + sm.addItemName(headItem.getItemId()); + activeChar.sendPacket(sm); + } + headItem.setEnchantLevel(headItem.getEnchantLevel() + 1); + headItem.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("glovesItem")) + { + if (glovesItem.getOwnerId() != activeChar.getObjectId() || (glovesItem.getEnchantLevel() >= maxEnchantLevela && maxEnchantLevela != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (glovesItem == null) + return; + if (glovesItem.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(glovesItem.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(glovesItem.getEnchantLevel()); + sm.addItemName(glovesItem.getItemId()); + activeChar.sendPacket(sm); + } + glovesItem.setEnchantLevel(glovesItem.getEnchantLevel() + 1); + glovesItem.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("feetItem")) + { + if (feetItem.getOwnerId() != activeChar.getObjectId() || (feetItem.getEnchantLevel() >= maxEnchantLevela && maxEnchantLevela != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (feetItem == null) + return; + if (feetItem.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(feetItem.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(feetItem.getEnchantLevel()); + sm.addItemName(feetItem.getItemId()); + activeChar.sendPacket(sm); + } + feetItem.setEnchantLevel(feetItem.getEnchantLevel() + 1); + feetItem.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("neck")) + { + if (neck.getOwnerId() != activeChar.getObjectId() || (neck.getEnchantLevel() >= maxEnchantLevelj && maxEnchantLevelj != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (neck == null) + return; + if (neck.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(neck.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(neck.getEnchantLevel()); + sm.addItemName(neck.getItemId()); + activeChar.sendPacket(sm); + } + neck.setEnchantLevel(neck.getEnchantLevel() + 1); + neck.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("rfinger")) + { + if (rfinger.getOwnerId() != activeChar.getObjectId() || (rfinger.getEnchantLevel() >= maxEnchantLevelj && maxEnchantLevelj != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (rfinger == null) + return; + if (rfinger.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(rfinger.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(rfinger.getEnchantLevel()); + sm.addItemName(rfinger.getItemId()); + activeChar.sendPacket(sm); + } + rfinger.setEnchantLevel(rfinger.getEnchantLevel() + 1); + rfinger.updateDatabase(); + //spreeKills = 0; + } + else if (_command.substring(endOfId+1).startsWith("lfinger")) + { + if (lfinger.getOwnerId() != activeChar.getObjectId() || (lfinger.getEnchantLevel() >= maxEnchantLevelj && maxEnchantLevelj != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (lfinger == null) + return; + if (lfinger.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(lfinger.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(lfinger.getEnchantLevel()); + sm.addItemName(lfinger.getItemId()); + activeChar.sendPacket(sm); + } + lfinger.setEnchantLevel(lfinger.getEnchantLevel() + 1); + lfinger.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("rear")) + { + if (rear.getOwnerId() != activeChar.getObjectId() || (rear.getEnchantLevel() >= maxEnchantLevelj && maxEnchantLevelj != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (rear == null) + return; + if (rear.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(rear.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(rear.getEnchantLevel()); + sm.addItemName(rear.getItemId()); + activeChar.sendPacket(sm); + } + rear.setEnchantLevel(rear.getEnchantLevel() + 1); + rear.updateDatabase(); + //spreeKills = 0; + + } + else if (_command.substring(endOfId+1).startsWith("lear")) + { + if (lear.getOwnerId() != activeChar.getObjectId() || (lear.getEnchantLevel() >= maxEnchantLevelw && maxEnchantLevelw != 0)) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + return; + } + if (lear == null) + return; + if (lear.getEnchantLevel() == 0) + { + sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); + sm.addItemName(lear.getItemId()); + activeChar.sendPacket(sm); + } + else + { + sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED); + sm.addNumber(lear.getEnchantLevel()); + sm.addItemName(lear.getItemId()); + activeChar.sendPacket(sm); + } + lear.setEnchantLevel(lear.getEnchantLevel() + 1); + lear.updateDatabase(); + //spreeKills = 0; + } + activeChar.sendPacket(new ActionFailed()); + } + catch (NumberFormatException nfe) {} + } Quote Link to comment Share on other sites More sharing options...
Devangell™ Posted March 31, 2010 Share Posted March 31, 2010 you choose your item and this enchated? Quote Link to comment Share on other sites More sharing options...
xAddytzu Posted March 31, 2010 Author Share Posted March 31, 2010 you choose your item and this enchated? Yep This will be message " Hello, "+getName()+", You can choose your item to enchant! " Quote Link to comment Share on other sites More sharing options...
Jimaras22 Posted March 31, 2010 Share Posted March 31, 2010 Yep This will be message " Hello, "+getName()+", You can choose your item to enchant! " Wow.Rox. Quote Link to comment Share on other sites More sharing options...
MasterDisaster Posted March 31, 2010 Share Posted March 31, 2010 Good one but I prefer the retail one. Quote Link to comment Share on other sites More sharing options...
xTheVioLaToR Posted March 31, 2010 Share Posted March 31, 2010 Well, I decided to do such a thing because I find it beautiful and useful ... I will make a diff and I will post it ... Also You can put menu when an player become killing spree, I mean consecutive kills or You can make handler with custom items .. Suggestions ? if this is yours and its not taken from other as your signatures then i have to say that ITS FUCKING AWESOME! Quote Link to comment Share on other sites More sharing options...
xAddytzu Posted March 31, 2010 Author Share Posted March 31, 2010 Update. Check first post if this is yours and its not taken from other as your signatures then i have to say that ITS -beep-ING AWESOME! It's a long story with signatures .. nvm .. Edit: It's a bit unclean the code but ... Quote Link to comment Share on other sites More sharing options...
xTheVioLaToR Posted March 31, 2010 Share Posted March 31, 2010 Update. Check first post It's a long story with signatures .. nvm .. Ι just saw a post with you ripping or doing something like this...but yes its another story if you made it by yourself i will repeat its fucking awesome :) Quote Link to comment Share on other sites More sharing options...
Devangell™ Posted March 31, 2010 Share Posted March 31, 2010 i like it very much Quote Link to comment Share on other sites More sharing options...
disast3r Posted March 31, 2010 Share Posted March 31, 2010 retail is better but as u said u can make custom enchant with killing spree or something so its very useful , Nice job ;) Quote Link to comment Share on other sites More sharing options...
xAddytzu Posted March 31, 2010 Author Share Posted March 31, 2010 i like it very much Thanks retail is better but as u said u can make custom enchant with killing spree or something so its very useful , Nice job ;) Yes who want can use http://www.maxcheaters.com/forum/index.php?topic=133025.0 + case 15: + ExShowScreenMessage case15 = new ExShowScreenMessage("You reached 15 killing spree!", 10000); + activeChar.sendPacket(case15); + Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 15 kill in a row!"); + activeChar.showEnchantHtml(); + break; @@ + public void showEnchantHtml() + { + impro = 0; + + .... code ... :D Quote Link to comment Share on other sites More sharing options...
PiKKa Posted March 31, 2010 Share Posted March 31, 2010 Oke again you do it , so i like you'r sharing mode , keep sharing Quote Link to comment Share on other sites More sharing options...
Gxz Posted March 31, 2010 Share Posted March 31, 2010 very good share keep up addytzu :) it would be better if you could enchant all items but like this you cant do this, its fine :) Quote Link to comment Share on other sites More sharing options...
`Rοmeο Posted March 31, 2010 Share Posted March 31, 2010 amaizing share addy looool ! :) Thanks alot for it and keep the great shares :) Quote Link to comment Share on other sites More sharing options...
Belzebul Posted March 31, 2010 Share Posted March 31, 2010 a-m-a-z-i-n-g. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.