Jump to content

disorder25

Members
  • Posts

    451
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by disorder25

  1. Oh Yeah thank you, I was right I did change the etcitemgrp part but I forgot to make it stackable on database, that's why it wasn't working.
  2. How do we fix the crystal scrolls to be stacked on the inventory?
  3. Didn't work. I made all the changes you show me but still not working. Now when I enter the name and click on the button I get the message from: catch (StringIndexOutOfBoundsException e)
  4. I think I kind of understood what you were saying. I did the changes and now look like the code is working but I still have one problem, if I use this bypass: bypass -h _bbsservice;Name $newName I get this error on the community board. the command: _bbsservice;Name Paul is not implemented yet. If I use this bypass bypass -h _bbsservice;Name;$newName I get the char named $newName Do I need to create a bypass on CommunityBoard.java for the command for the first bypass to work? Thank you.
  5. Hello I have I section on my community board that have Services, like Change Gender, Pk Cleaner, Noblesse, etc. I want to add a option to change the name. I add the code but when I enter the name on the box, instead of change the name to what I enter in the box I get the bypass as my name like: ;Name;$newName How can I fix that? Here is my code. package com.l2jserver.gameserver.communitybbs.Managers; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.StringTokenizer; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.communitybbs.Manager.BaseBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jserver.gameserver.datatables.CharNameTable; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.PartySmallWindowAll; import com.l2jserver.gameserver.network.serverpackets.PartySmallWindowDeleteAll; import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAll; import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListUpdate; import com.l2jserver.gameserver.network.serverpackets.ShowBoard; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.network.serverpackets.UserInfo; import com.l2jserver.gameserver.util.Util; public class ServiceBBSManager extends BaseBBSManager { public static final Logger _log = Logger.getLogger(ServiceBBSManager.class.getName()); public ServiceBBSManager() { } @Override public void parsecmd(String command, L2PcInstance activeChar) { if (command.equals("_bbsservice")) { sendHtm(activeChar, "data/html/CommunityBoard/42.htm"); } else if (command.startsWith("_bbsservice;")) { StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); String param = st.nextToken(); if (param.equalsIgnoreCase("Noobles")) { if (activeChar.getInventory().getItemByItemId(Config.NoblItemId) == null) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS)); return; } if (activeChar.getInventory().getItemByItemId(Config.NoblItemId).getCount() < Config.NoblItemCount) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS)); return; } if (activeChar.getClassId().level() < 3) { activeChar.sendMessage("You must have third class."); return; } if (activeChar.isNoble()) { activeChar.sendMessage("You already have nobless."); return; } activeChar.destroyItemByItemId("ShopBBS", Config.NoblItemId, Config.NoblItemCount, activeChar, true); activeChar.setNoble(true); activeChar.setTarget(activeChar); activeChar.broadcastPacket(new MagicSkillUse(activeChar, 5103, 1, 1000, 0)); activeChar.broadcastUserInfo(); activeChar.sendMessage("You are now a Noblesse Character."); } else if (param.equalsIgnoreCase("Gender")) { if (activeChar.getInventory().getItemByItemId(Config.GenderItemId) == null) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS)); return; } if (activeChar.getInventory().getItemByItemId(Config.GenderItemId).getCount() < Config.GenderItemCount) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS)); return; } activeChar.destroyItemByItemId("ShopBBS", Config.GenderItemId, Config.GenderItemCount, activeChar, true); activeChar.getAppearance().setSex(activeChar.getAppearance().getSex() ? false : true); activeChar.setTarget(activeChar); activeChar.broadcastPacket(new MagicSkillUse(activeChar, 5103, 1, 1000, 0)); activeChar.broadcastUserInfo(); activeChar.sendMessage("You have change your Gender successfully."); } else if (param.equalsIgnoreCase("RecoveryPK")) { if (activeChar.getInventory().getItemByItemId(Config.RecoveryPKItemId) == null) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS)); return; } if (activeChar.getInventory().getItemByItemId(Config.RecoveryPKItemId).getCount() < Config.RecoveryPKItemCount) { activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS)); return; } activeChar.destroyItemByItemId("ShopBBS", Config.RecoveryPKItemId, Config.RecoveryPKItemCount, activeChar, true); activeChar.setKarma(0); activeChar.setPkKills(0); activeChar.broadcastUserInfo(); activeChar.sendPacket(new UserInfo(activeChar)); activeChar.sendPacket(new ExBrExtraUserInfo(activeChar)); activeChar.sendMessage("You have clean your Pks."); } else if (command.equalsIgnoreCase("Name")) { try { String _name = command.substring(11); String errorMsg = null; boolean proceed = true; if (_name.length() <= 2) { errorMsg = "Names have to be at least 3 characters"; activeChar.sendMessage("Names have to be at least 3 characters"); proceed = false; } if (_name.length() >= 17) { errorMsg = "Names cannot be longer than 16 characters"; activeChar.sendMessage("Names cannot be longer than 16 characters"); proceed = false; } if ((!Util.isAlphaNumeric(_name)) || (!isValidName(_name))) { errorMsg = "Invalid name"; activeChar.sendMessage("Names can Only have letters and numbers"); proceed = false; } if (CharNameTable.getInstance().getIdByName(_name) > 0) { errorMsg = "Name already exists"; activeChar.sendMessage((new StringBuilder()).append("Warning, name ").append(_name).append(" already exists.").toString()); proceed = false; } if (!proceed) { activeChar.sendMessage(errorMsg); } activeChar.destroyItemByItemId("ShopBBS", Config.NameItemId, Config.NameItemCount, activeChar, true); L2World.getInstance().removeFromAllPlayers(activeChar); activeChar.setName(_name); activeChar.store(); L2World.getInstance().addToAllPlayers(activeChar); activeChar.sendMessage("Your new character name is " + _name); activeChar.broadcastUserInfo(); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE characters SET char_name=? WHERE charId=?")) { statement.setString(1, _name); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { _log.info("Error updating name for player " + activeChar.getName() + ". Error: " + e); } if (activeChar.isInParty()) { // Delete party window for other party members activeChar.getParty().broadcastToPartyMembers(activeChar, new PartySmallWindowDeleteAll()); for (final L2PcInstance member : activeChar.getParty().getMembers()) { // And re-add if (member != activeChar) { member.sendPacket(new PartySmallWindowAll(activeChar, activeChar.getParty())); } } } if (activeChar.getClan() != null) { activeChar.getClan().updateClanMember(activeChar); activeChar.getClan().broadcastToOnlineMembers(new PledgeShowMemberListUpdate(activeChar)); activeChar.sendPacket(new PledgeShowMemberListAll(activeChar.getClan(), activeChar)); } RegionBBSManager.getInstance().changeCommunityBoard(); } catch (StringIndexOutOfBoundsException e) { // Case of empty character name activeChar.sendMessage("error: Something went wrong"); } } else { ShowBoard sb = new ShowBoard((new StringBuilder()).append("<html><body><br><br><center>the command: ").append(command).append(" is not implemented yet</center><br><br></body></html>").toString(), "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } } } private boolean sendHtm(L2PcInstance player, String path) { String oriPath = path; if ((player.getLang() != null) && !player.getLang().equalsIgnoreCase("en") && path.contains("html/")) { path = path.replace("html/", (new StringBuilder()).append("html-").append(player.getLang()).append("/").toString()); } String content = HtmCache.getInstance().getHtm(path); if ((content == null) && !oriPath.equals(path)) { content = HtmCache.getInstance().getHtm(oriPath); } if (content == null) { return false; } separateAndSend(content, player); return true; } private boolean isValidName(final String text) { boolean result = true; final String test = text; Pattern pattern; try { pattern = Pattern.compile(Config.CNAME_TEMPLATE); } catch (final PatternSyntaxException e) // case of illegal pattern { e.printStackTrace(); pattern = Pattern.compile(".*"); } final Matcher regexp = pattern.matcher(test); if (!regexp.matches()) { result = false; } return result; } @Override public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar) { } public static ServiceBBSManager getInstance() { return SingletonHolder._instance; } public static class SingletonHolder { protected static final ServiceBBSManager _instance = new ServiceBBSManager(); } } and the bypass <td align=center width=130><edit var="newName" width=100><button value="Change Name" action="bypass -h _bbsservice;Name;$newName" width=120 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
  6. Ok I got it, it was just a matter of space between each thing. Thank you Sinister Smile.
  7. Did that already but all the text come out white, the part I want in yellow is white also. and also I forgot to mention that I'm using L2j H5 server.
  8. I want to add after the scroll name the scroll chance in yellow, I was able to edit the description and add what I want but the font is white and I want it yellow. Can someone tell me how to do it like the example underneath? Thank you. Scroll: Enchant Armor (S Grade) 70% Chance, Safe +6 (2)
  9. Thank you.I got it working Appreciate your help.
  10. Thank you for your reply. I did what you said but the window did not refresh, when I click on the button the window closed and I got an error on gameserver. Here is what I did. public void onBypassFeedback(final L2PcInstance activeChar, String command) { if (activeChar == null) { return; } if (command.startsWith("showMainWindow")) { getVoteHtml(activeChar); } } public static String getVoteHtml(L2PcInstance player) { Here I got the working html and I added this bypass to it sb.append("<center><button value=\"Refresh\" action=\"bypass -h showMainWindow\" back=\"L2UI_CT1.Button_DF.Gauge_DF_Attribute_Dark\" fore=\"L2UI_CT1.Button_DF.Gauge_DF_Attribute_Dark_bg\" width=95 height=26></center>"); } This is the error I got on gameserver [Character: whatever[000000000] - Account: whatever - IP: 000.0.0.0] sent not h andled RequestBypassToServer: [showMainWindow]
  11. Hello I made a command that open a hardcode html window, I would like to add a button to refresh that window, what is the bypass I have to use on the html to refresh it? Thank you>
  12. Hello Maxcheaters I'm using this code on my Service Npc and it is working just fine but I have one problem, it have no check for skills, so if you keep clicking on it it will keep taking the coins from you and telling you no skills added. I need it to check if the clan already have the skills and if yes return a html saying that the clan have the skills alredy. Can anyone help? Btw I'm using a L2j H5 server> Thank you. else if (event.startsWith("clanSkills")) { final L2Clan clan = player.getClan(); if (clan == null) { player.sendPacket(SystemMessageId.TARGET_MUST_BE_IN_CLAN); return "ClanSkills-NoClan.htm"; } if (!player.isClanLeader()) { final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.TARGET_MUST_BE_IN_CLAN); sm.addPcName(player); player.sendPacket(sm); return "ClanSkills-NoLeader.htm"; } if (st.getQuestItemsCount(ClanSkillsItemId) >= ClanSkillsItemCount) { final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailablePledgeSkills(clan); SkillTable st1 = SkillTable.getInstance(); for (L2SkillLearn s : skills) { clan.addNewSkill(st1.getInfo(s.getSkillId(), s.getSkillLevel())); } st.takeItems(ClanSkillsItemId, ClanSkillsItemCount); // Notify target and active char clan.broadcastToOnlineMembers(new PledgeSkillList(clan)); for (L2PcInstance member : clan.getOnlineMembers(0)) { member.sendSkillList(); } player.sendMessage("You gave " + skills.size() + " skills to " + player.getName() + "'s clan " + clan.getName() + "."); player.sendMessage("Your clan received " + skills.size() + " skills."); return "ClanSkills-Success.htm"; } return "ClanSkills-NoItems.htm"; } return htmlText; }
  13. Beautiful job mate. Thank you.
  14. Hi can you tell me why the character need to be disconnected after the augmentation? Well I know why is to update the inventory, because after the weapon is augmented it does not show it is augmented until the next time you login, but it must be another way to do this because when you use the augmenter from the server it just unequip the weapon and it shows on inventory with the augmentation. This code wont unequip the weapon and it wont show the augmentation until you relog. It uses this code on the bottom to force the player to relog. try { Thread.sleep(3000L); } catch (Exception e) { } player.deleteMe(); player.sendPacket(new LeaveWorld()); } catch (Exception e) Can someone help me change this? Thank you.
  15. can anyone help adapt to H5 the scripts: 919_Enchanter q8014_Lifestone q8015_Enchex Thank you in advance.
  16. So share the codes after you fix it. I need help to adapt it to L2j H5
  17. Thank you Baggos, it work just fine with the Sp check. Nice share and thank you for your reply and help.
  18. Man I adapted this to L2j Hi5, got it all working but now I got one problem, when you click on DRESS ME more than ounce you get the items again and again Can someone help me fix this problem, need to add something to prevent you to get the items more than 1 time. Thank you.
  19. I did almost everything but got stuck on this error only. The method getSkill() is undefined for the type L2Augmentation
  20. anyone have something like this for L2j hi5 to share?
  21. I tested and it works but it have a few problems. It does decrease your level but it does not decrease your EXP/SP. So after you decrease level you won't be able to level up again because you can't gain no more EXP/SP. Also the path for the 1.htm is right on the java file but you tell us to add at another folder, it should be at the same folder as the java file. I was able to fix the EXP/SP problem but if someone add this to a live server it will bug the characters.
×
×
  • Create New...