-
Публикаций
71 -
Зарегистрирован
-
Посещение
-
Отзывы
0%
Тип контента
Профили
Форумы
Загрузки
Магазин
Инструкции
Весь контент Blact
-
та же ошибка
-
как добавить? по подробнее можна?
-
как?у меня файл залит сюда head-src\com\l2jfrozen\gameserver\model\actor\instance
-
Попробуйте кто то скомпилировать очень прошу вот закинуть его в model/actor/instance код Скрытый текстpackage com.l2jfrozen.gameserver.model.actor.instance; import java.util.StringTokenizer; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import java.util.regex.Matcher; import javolution.text.TextBuilder; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.UserInfo; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.gameserver.util.Util; public class L2CharManagerInstance extends L2FolkInstance { /** * @author SeDneY */ private final String NPC_MENU = "<html><title>L2j Char Manager</title><body>" + "<a action=\"bypass -h npc_%objectId%_showwindow 1\">>Change my name</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 2\">Change my name color</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 3\">Change my title color</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 4\">Set me as Noble</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 5\">Set me as Hero</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 6\">Change my sex</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 7\">Put down my PKs</a><br>" + "</body></html>"; private final int NickNameChangeItem = 4037; private final int NickNameChangeItemCount = 200; private final String NickNameChangeItemName = "Coin of Luck"; private final String NickNamePattern = ".*"; // private final int ChangeTitleColorItem = 4037; // private final int ChangeTitleColorItemCount = 20; // private final String ChangeTitleColorItemName = "Coin of Luck"; private final int ChangeNickColorItem = 4037; private final int ChangeNickColorItemCount = 30; private final String ChangeNickColorItemName = "Coin of Luck"; private final int SetNobleItem = 4037; // private final int SetNobleItemCount = 100; // private final String SetNobleItemName = "Coin of Luck"; private final int SetHeroItem = 4037; // private final int SetHeroItemCount = 300; // private final String SetHeroItemName = "Coin of Luck"; // private final int SetSexItem = 4037; // private final int SetSexItemCount = 10; // private final String SetSexItemName = "Coin of Luck"; // private final int ChangePkKillsItem = 57; // private final int ChangePkKillsItemCount = 1; // private final String ChangePkKillsItemName = "Coin of Luck"; // public L2CharManagerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String curCommand = st.nextToken(); if(curCommand.startsWith("showwindow")) { showWindow(player, Integer.parseInt(st.nextToken())); } else if(curCommand.startsWith("change_nickname")) { String name = st.nextToken(); playerSetNickName(player, name); } else if(curCommand.startsWith("change_nickcolor")) { playerSetColor(player, st.nextToken(), 1); } else if(curCommand.startsWith("change_titlecolor")) { playerSetColor(player, st.nextToken(), 2); } else if(curCommand.startsWith("change_pkcount")) { changePkCount(player, Integer.parseInt(st.nextToken())); } else if(curCommand.startsWith("setstatus")) { setStatus(player, Integer.parseInt(st.nextToken())); } } @Override public void onAction(L2PcInstance player) { player.setLastFolkNPC(this); if(!canTarget(player)) return; if(this != player.getTarget()) { player.setTarget(this); MyTargetSelected my = new MyTargetSelected(getObjectId(), 0); player.sendPacket(my); player.sendPacket(new ValidateLocation(this)); } else { if(!canInteract(player)) { } else { NpcHtmlMessage html = new NpcHtmlMessage(1); html.setHtml(NPC_MENU); sendHtmlMessage(player, html); } } player.sendPacket(ActionFailed.STATIC_PACKET); } private void sendHtmlMessage(L2PcInstance player, NpcHtmlMessage html) { html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%npcId%", String.valueOf(getNpcId())); player.sendPacket(html); } private void playerSetColor(L2PcInstance player, String color, int type) { int colorh = -1; if(color.equalsIgnoreCase("Green")) { colorh = Integer.decode("0x00FF00"); } else if(color.equalsIgnoreCase("Yellow")) { colorh = Integer.decode("0x00FFFF"); } else if(color.equalsIgnoreCase("Orange")) { colorh = Integer.decode("0x0099FF"); } else if(color.equalsIgnoreCase("Blue")) { colorh = Integer.decode("0xFF0000"); } else if(color.equalsIgnoreCase("Black")) { colorh = Integer.decode("0x000000"); } else if(color.equalsIgnoreCase("White")) { colorh = Integer.decode("0xFFFFFF"); } if(type == 1) { if(player.getInventory().getItemByItemId(ChangeNickColorItem) != null && player.getInventory().getItemByItemId(ChangeNickColorItem).getCount() >= ChangeNickColorItemCount && colorh != -1) { player.destroyItemByItemId("Consume", ChangeNickColorItem, ChangeNickColorItemCount, player, false); player.getAppearance().setNameColor(colorh); player.broadcastUserInfo(); player.sendMessage(" " + color); } else { player.sendMessage(""); } } else if(type == 2) { if(player.getInventory().getItemByItemId(ChangeTitleColorItem) != null && player.getInventory().getItemByItemId(ChangeTitleColorItem).getCount() >= ChangeTitleColorItemCount) { player.destroyItemByItemId("Consume", ChangeTitleColorItem, ChangeTitleColorItemCount, player, false); player.getAppearance().setTitleColor(colorh); player.broadcastUserInfo(); player.sendMessage(" " + color); } else { player.sendMessage(""); } } } private void playerSetNickName(L2PcInstance player, String name) { if (name.length() < 3 || name.length() > 16 || !Util.isAlphaNumeric(name) || !isValidName(name)) { player.sendMessage(""); } else { if(player.getInventory().getItemByItemId(NickNameChangeItem) != null && player.getInventory().getItemByItemId(NickNameChangeItem).getCount() >= NickNameChangeItemCount) { player.setName(name); player.destroyItemByItemId("Consume", NickNameChangeItem, NickNameChangeItemCount, player, false); player.broadcastUserInfo(); player.sendMessage(""); player.store(); } else { player.sendMessage(""); } } } private void setStatus(L2PcInstance player, int type) { if(type == 1) { if(player.isNoble()) { player.sendMessage(""); return; } else if(player.getInventory().getItemByItemId(SetNobleItem) == null || player.getInventory().getItemByItemId(SetNobleItem).getCount() < SetNobleItemCount) { player.sendMessage(""); return; } player.destroyItemByItemId("Consume", SetNobleItem, SetNobleItemCount, player, false); MagicSkillUser MSU = new MagicSkillUser(player, player, 2023, 1, 1, 0); player.sendPacket(MSU); player.broadcastPacket(MSU); player.setNoble(true); player.sendMessage(""); player.broadcastUserInfo(); player.getInventory().addItem("Noblesse Tiara",7694, 1, player, player.getTarget()); } else if(type == 2) { if(player.isHero()) { player.sendMessage(""); return; } else if(player.getInventory().getItemByItemId(SetHeroItem) == null || player.getInventory().getItemByItemId(SetHeroItem).getCount() < SetHeroItemCount) { player.sendMessage(""); return; } player.destroyItemByItemId("Consume", SetHeroItem, SetHeroItemCount, player, false); player.setHero(true); player.broadcastUserInfo(); } else if(type == 3) { if(player.getInventory().getItemByItemId(SetSexItem) == null || player.getInventory().getItemByItemId(SetSexItem).getCount() < SetSexItemCount) { player.sendMessage("Not enough item"); return; } player.destroyItemByItemId("Consume", SetSexItem, SetSexItemCount, player, false); player.getAppearance().setSex(player.getAppearance().getSex() ? false : true); player.broadcastUserInfo(); player.decayMe(); player.spawnMe(player.getX(), player.getY(), player.getZ()); player.sendMessage("You have successfully changed their sex."); } } private void showWindow(L2PcInstance player, int window) { TextBuilder tb; NpcHtmlMessage html; if(window == 0) { html = new NpcHtmlMessage(1); html.setHtml(NPC_MENU); sendHtmlMessage(player, html); } else if(window == 1) { tb = new TextBuilder(); tb.append("<html><title></title>"); tb.append("<body><center>"); tb.append("<br> <edit var=\"name\" width=120 height=15><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_nickname $name\"></a><br>"); tb.append(" " + NickNameChangeItemCount + " <font color=\"LEVEL\">" + NickNameChangeItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 2) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<br> <combobox var=\"scolor\" width=\"100\" List=\"White;Green;Yellow;Orange;Blue;Black\"><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_nickcolor $scolor\"></a>"); tb.append("" + ChangeNickColorItemCount + " <font color=\"LEVEL\">" + ChangeNickColorItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 3) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<br> <combobox var=\"scolor\" width=\"100\" List=\"White;Green;Yellow;Orange;Blue;Black\"><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_titlecolor $scolor\"></a><br>"); tb.append(" " + ChangeTitleColorItemCount + " <font color=\"LEVEL\">" + ChangeTitleColorItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 4) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 1\"></a>"); tb.append(" " + SetNobleItemCount + " <font color=\"LEVEL\">" + SetNobleItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 5) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 2\"></a><br>"); tb.append(" " + SetHeroItemCount + " <font color=\"LEVEL\">" + SetHeroItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 6) { tb = new TextBuilder(); tb.append("<html><title>sex change</title><body><center>"); tb.append("Here you can change the gender of your character.<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 3\">Back to the floor</a><br>"); tb.append("Price: " + SetSexItemCount + " <font color=\"LEVEL\">" + SetSexItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\">back</a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 7) { tb = new TextBuilder(); tb.append("<html><title>Wash counter pc</title>"); tb.append("<body><center>"); tb.append("<br> Enter a quantitative pc that will be deleted:<br> <edit var=\"pkcount\" width=120 height=15><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_pkcount $pkcount\">Change</a><br>"); tb.append("1 PC = " + ChangePkKillsItemCount + " <font color=\"LEVEL\">" + ChangePkKillsItemName + "</font>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\">back</a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } } private void changePkCount(L2PcInstance player, int count) { if(player.getInventory().getItemByItemId(ChangePkKillsItem) != null && player.getInventory().getItemByItemId(ChangePkKillsItem).getCount() >= ChangePkKillsItemCount * count) { int inipkKills = player.getPkKills(); if(inipkKills == 0) { player.sendMessage("You have 0 PC"); return; } else if(inipkKills < count) { player.sendMessage("Not the correct number of PCs"); return; } player.destroyItemByItemId("Consume", ChangePkKillsItem, count * ChangePkKillsItemCount, player, false); player.setPkKills(inipkKills - count); player.sendPacket(new UserInfo(player)); player.sendMessage("You have removed " + count + " PK"); } else { player.sendMessage("Not enough item"); } } private boolean isValidName(String text) { Pattern pattern; boolean result = true; String test = text; try { pattern = Pattern.compile(Config.NICK_CHANGE_TEMPLATE); } catch (PatternSyntaxException e) { _log.warning("ERROR : Character name pattern of config is wrong!"); pattern = Pattern.compile(".*"); } Matcher regexp = pattern.matcher(test); if (!(regexp.matches())) { result = false; if (Config.SYMBOL_MIX_PROTECTION) { try { pattern = Pattern.compile("[0-9А-Яа-я]{1,16}"); } catch (PatternSyntaxException e) { _log.warning("ERROR : RU char name pattern is wrong!"); } regexp = pattern.matcher(test); if (regexp.matches()) { result = true; } } } return result; } }
-
как через свн? у меня исходы на компе,проект в еклипсе создал,закинул исходы,и компилю
-
Пробывал,все равно ошибку ту пишет [javac] Compiling 662 source files to E:\gm\server\serverfrozeh\Core\Core\build\classes [javac] E:\gm\server\serverfrozeh\Core\Core\head-src\com\l2jfrozen\gameserver\model\actor\L2CharManagerInstance.java:1: illegal character: \65279 [javac] ?package com.l2jfrozen.gameserver.model.actor.instance; [javac] ^ [javac] 1 error
-
НУ ЧЕ ЗА КОДИРОВКА ЕМАЕ illegal character: \65279 АААААА ЧЕ ДЕЛАТЬ Я В ШОКЕ ХДД))
-
Читайте http://seo4ski.biz/strashnyj-son-verstalsh...mvol-65279.html хД)))
-
Скажите нормальный текстовый редактор что бы я кодировку поставил,потому что читаю сейчас на американских форумах что Нотепад параша
-
Вот код я хотел встроить этот код,и прописать в донейт нпц байпас на смену пола и очистку пк очков,но не могу скомпилить,выше ошибка Скрытый текстpackage com.l2jfrozen.gameserver.model.actor.instance; import java.util.StringTokenizer; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import java.util.regex.Matcher; import javolution.text.TextBuilder; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.UserInfo; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.gameserver.util.Util; public class L2CharManagerInstance extends L2FolkInstance { /** * @author SeDneY */ private final String NPC_MENU = "<html><title>L2j Char Manager</title><body>" + "<a action=\"bypass -h npc_%objectId%_showwindow 1\">>Change my name</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 2\">Change my name color</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 3\">Change my title color</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 4\">Set me as Noble</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 5\">Set me as Hero</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 6\">Change my sex</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 7\">Put down my PKs</a><br>" + "</body></html>"; private final int NickNameChangeItem = 4037; private final int NickNameChangeItemCount = 200; private final String NickNameChangeItemName = "Coin of Luck"; private final String NickNamePattern = ".*"; // private final int ChangeTitleColorItem = 4037; // private final int ChangeTitleColorItemCount = 20; // private final String ChangeTitleColorItemName = "Coin of Luck"; private final int ChangeNickColorItem = 4037; private final int ChangeNickColorItemCount = 30; private final String ChangeNickColorItemName = "Coin of Luck"; private final int SetNobleItem = 4037; // private final int SetNobleItemCount = 100; // private final String SetNobleItemName = "Coin of Luck"; private final int SetHeroItem = 4037; // private final int SetHeroItemCount = 300; // private final String SetHeroItemName = "Coin of Luck"; // private final int SetSexItem = 4037; // private final int SetSexItemCount = 10; // private final String SetSexItemName = "Coin of Luck"; // private final int ChangePkKillsItem = 57; // private final int ChangePkKillsItemCount = 1; // private final String ChangePkKillsItemName = "Coin of Luck"; // public L2CharManagerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String curCommand = st.nextToken(); if(curCommand.startsWith("showwindow")) { showWindow(player, Integer.parseInt(st.nextToken())); } else if(curCommand.startsWith("change_nickname")) { String name = st.nextToken(); playerSetNickName(player, name); } else if(curCommand.startsWith("change_nickcolor")) { playerSetColor(player, st.nextToken(), 1); } else if(curCommand.startsWith("change_titlecolor")) { playerSetColor(player, st.nextToken(), 2); } else if(curCommand.startsWith("change_pkcount")) { changePkCount(player, Integer.parseInt(st.nextToken())); } else if(curCommand.startsWith("setstatus")) { setStatus(player, Integer.parseInt(st.nextToken())); } } @Override public void onAction(L2PcInstance player) { player.setLastFolkNPC(this); if(!canTarget(player)) return; if(this != player.getTarget()) { player.setTarget(this); MyTargetSelected my = new MyTargetSelected(getObjectId(), 0); player.sendPacket(my); player.sendPacket(new ValidateLocation(this)); } else { if(!canInteract(player)) { } else { NpcHtmlMessage html = new NpcHtmlMessage(1); html.setHtml(NPC_MENU); sendHtmlMessage(player, html); } } player.sendPacket(ActionFailed.STATIC_PACKET); } private void sendHtmlMessage(L2PcInstance player, NpcHtmlMessage html) { html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%npcId%", String.valueOf(getNpcId())); player.sendPacket(html); } private void playerSetColor(L2PcInstance player, String color, int type) { int colorh = -1; if(color.equalsIgnoreCase("Green")) { colorh = Integer.decode("0x00FF00"); } else if(color.equalsIgnoreCase("Yellow")) { colorh = Integer.decode("0x00FFFF"); } else if(color.equalsIgnoreCase("Orange")) { colorh = Integer.decode("0x0099FF"); } else if(color.equalsIgnoreCase("Blue")) { colorh = Integer.decode("0xFF0000"); } else if(color.equalsIgnoreCase("Black")) { colorh = Integer.decode("0x000000"); } else if(color.equalsIgnoreCase("White")) { colorh = Integer.decode("0xFFFFFF"); } if(type == 1) { if(player.getInventory().getItemByItemId(ChangeNickColorItem) != null && player.getInventory().getItemByItemId(ChangeNickColorItem).getCount() >= ChangeNickColorItemCount && colorh != -1) { player.destroyItemByItemId("Consume", ChangeNickColorItem, ChangeNickColorItemCount, player, false); player.getAppearance().setNameColor(colorh); player.broadcastUserInfo(); player.sendMessage(" " + color); } else { player.sendMessage(""); } } else if(type == 2) { if(player.getInventory().getItemByItemId(ChangeTitleColorItem) != null && player.getInventory().getItemByItemId(ChangeTitleColorItem).getCount() >= ChangeTitleColorItemCount) { player.destroyItemByItemId("Consume", ChangeTitleColorItem, ChangeTitleColorItemCount, player, false); player.getAppearance().setTitleColor(colorh); player.broadcastUserInfo(); player.sendMessage(" " + color); } else { player.sendMessage(""); } } } private void playerSetNickName(L2PcInstance player, String name) { if (name.length() < 3 || name.length() > 16 || !Util.isAlphaNumeric(name) || !isValidName(name)) { player.sendMessage(""); } else { if(player.getInventory().getItemByItemId(NickNameChangeItem) != null && player.getInventory().getItemByItemId(NickNameChangeItem).getCount() >= NickNameChangeItemCount) { player.setName(name); player.destroyItemByItemId("Consume", NickNameChangeItem, NickNameChangeItemCount, player, false); player.broadcastUserInfo(); player.sendMessage(""); player.store(); } else { player.sendMessage(""); } } } private void setStatus(L2PcInstance player, int type) { if(type == 1) { if(player.isNoble()) { player.sendMessage(""); return; } else if(player.getInventory().getItemByItemId(SetNobleItem) == null || player.getInventory().getItemByItemId(SetNobleItem).getCount() < SetNobleItemCount) { player.sendMessage(""); return; } player.destroyItemByItemId("Consume", SetNobleItem, SetNobleItemCount, player, false); MagicSkillUser MSU = new MagicSkillUser(player, player, 2023, 1, 1, 0); player.sendPacket(MSU); player.broadcastPacket(MSU); player.setNoble(true); player.sendMessage(""); player.broadcastUserInfo(); player.getInventory().addItem("Noblesse Tiara",7694, 1, player, player.getTarget()); } else if(type == 2) { if(player.isHero()) { player.sendMessage(""); return; } else if(player.getInventory().getItemByItemId(SetHeroItem) == null || player.getInventory().getItemByItemId(SetHeroItem).getCount() < SetHeroItemCount) { player.sendMessage(""); return; } player.destroyItemByItemId("Consume", SetHeroItem, SetHeroItemCount, player, false); player.setHero(true); player.broadcastUserInfo(); } else if(type == 3) { if(player.getInventory().getItemByItemId(SetSexItem) == null || player.getInventory().getItemByItemId(SetSexItem).getCount() < SetSexItemCount) { player.sendMessage("Not enough item"); return; } player.destroyItemByItemId("Consume", SetSexItem, SetSexItemCount, player, false); player.getAppearance().setSex(player.getAppearance().getSex() ? false : true); player.broadcastUserInfo(); player.decayMe(); player.spawnMe(player.getX(), player.getY(), player.getZ()); player.sendMessage("You have successfully changed their sex."); } } private void showWindow(L2PcInstance player, int window) { TextBuilder tb; NpcHtmlMessage html; if(window == 0) { html = new NpcHtmlMessage(1); html.setHtml(NPC_MENU); sendHtmlMessage(player, html); } else if(window == 1) { tb = new TextBuilder(); tb.append("<html><title></title>"); tb.append("<body><center>"); tb.append("<br> <edit var=\"name\" width=120 height=15><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_nickname $name\"></a><br>"); tb.append(" " + NickNameChangeItemCount + " <font color=\"LEVEL\">" + NickNameChangeItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 2) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<br> <combobox var=\"scolor\" width=\"100\" List=\"White;Green;Yellow;Orange;Blue;Black\"><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_nickcolor $scolor\"></a>"); tb.append("" + ChangeNickColorItemCount + " <font color=\"LEVEL\">" + ChangeNickColorItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 3) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<br> <combobox var=\"scolor\" width=\"100\" List=\"White;Green;Yellow;Orange;Blue;Black\"><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_titlecolor $scolor\"></a><br>"); tb.append(" " + ChangeTitleColorItemCount + " <font color=\"LEVEL\">" + ChangeTitleColorItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 4) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 1\"></a>"); tb.append(" " + SetNobleItemCount + " <font color=\"LEVEL\">" + SetNobleItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 5) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 2\"></a><br>"); tb.append(" " + SetHeroItemCount + " <font color=\"LEVEL\">" + SetHeroItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 6) { tb = new TextBuilder(); tb.append("<html><title>sex change</title><body><center>"); tb.append("Here you can change the gender of your character.<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 3\">Back to the floor</a><br>"); tb.append("Price: " + SetSexItemCount + " <font color=\"LEVEL\">" + SetSexItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\">back</a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 7) { tb = new TextBuilder(); tb.append("<html><title>Wash counter pc</title>"); tb.append("<body><center>"); tb.append("<br> Enter a quantitative pc that will be deleted:<br> <edit var=\"pkcount\" width=120 height=15><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_pkcount $pkcount\">Change</a><br>"); tb.append("1 PC = " + ChangePkKillsItemCount + " <font color=\"LEVEL\">" + ChangePkKillsItemName + "</font>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\">back</a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } } private void changePkCount(L2PcInstance player, int count) { if(player.getInventory().getItemByItemId(ChangePkKillsItem) != null && player.getInventory().getItemByItemId(ChangePkKillsItem).getCount() >= ChangePkKillsItemCount * count) { int inipkKills = player.getPkKills(); if(inipkKills == 0) { player.sendMessage("You have 0 PC"); return; } else if(inipkKills < count) { player.sendMessage("Not the correct number of PCs"); return; } player.destroyItemByItemId("Consume", ChangePkKillsItem, count * ChangePkKillsItemCount, player, false); player.setPkKills(inipkKills - count); player.sendPacket(new UserInfo(player)); player.sendMessage("You have removed " + count + " PK"); } else { player.sendMessage("Not enough item"); } } private boolean isValidName(String text) { Pattern pattern; boolean result = true; String test = text; try { pattern = Pattern.compile(Config.NICK_CHANGE_TEMPLATE); } catch (PatternSyntaxException e) { _log.warning("ERROR : Character name pattern of config is wrong!"); pattern = Pattern.compile(".*"); } Matcher regexp = pattern.matcher(test); if (!(regexp.matches())) { result = false; if (Config.SYMBOL_MIX_PROTECTION) { try { pattern = Pattern.compile("[0-9А-Яа-я]{1,16}"); } catch (PatternSyntaxException e) { _log.warning("ERROR : RU char name pattern is wrong!"); } regexp = pattern.matcher(test); if (regexp.matches()) { result = true; } } } return result; } } [javac] Compiling 662 source files to E:\gm\server\serverfrozeh\Core\Core\build\classes [javac] E:\gm\server\serverfrozeh\Core\Core\head-src\com\l2jfrozen\gameserver\model\actor\L2CharManagerInstance.java:1: illegal character: \65279 [javac] ?package com.l2jfrozen.gameserver.model.actor.instance; [javac] ^ [javac] E:\gm\server\serverfrozeh\Core\Core\head-src\com\l2jfrozen\gameserver\model\actor\instance\L2CharManagerInstance.java:1: illegal character: \65279 [javac] ?package com.l2jfrozen.gameserver.model.actor.instance; [javac] ^ [javac] 2 errors
-
Может что-то в коде не так? прописано
-
<javac destdir="${build.classes}" includeantruntime="false" optimize="on" debug="on" source="1.6" target="1.6" encoding="UTF-8" nowarn="off"> это?
-
теперь пишет ошибку [javac] Compiling 662 source files to E:\gm\server\serverfrozeh\Core\Core\build\classes [javac] E:\gm\server\serverfrozeh\Core\Core\head-src\com\l2jfrozen\gameserver\model\actor\L2CharManagerInstance.java:1: illegal character: \65279 [javac] ?package com.l2jfrozen.gameserver.model.actor.instance; [javac] ^ [javac] 1 error
-
Помогите очень прошу с меня +
-
Вот код Charmaganer не хочет компилиться пишет ошибку Buildfile: E:\gm\server\serverfrozeh\Core\Core\build.xml prepare-local: prepare-final: init: version: [echo] L2jFrozen Gameserver Revision: exported compile: [javac] Compiling 662 source files to E:\gm\server\serverfrozeh\Core\Core\build\classes [javac] E:\gm\server\serverfrozeh\Core\Core\head-src\com\l2jfrozen\gameserver\model\actor\L2CharManagerInstance.java:1(и так с 1 по 29 строчку): unmappable character for encoding utf-8 : illegal character: \0 [javac] ?? : [javac] 100 errors Кодировку меняю и тоже самое помогите решить ошибку вот собственно код чар менеджера Скрытый текстpackage com.l2jfrozen.gameserver.model.actor.instance; import java.util.StringTokenizer; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import java.util.regex.Matcher; import javolution.text.TextBuilder; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.UserInfo; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.gameserver.util.Util; public class L2CharManagerInstance extends L2FolkInstance { /** * @author SeDneY */ private final String NPC_MENU = "<html><title>L2j Char Manager</title><body>" + "<a action=\"bypass -h npc_%objectId%_showwindow 1\">>Change my name</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 2\">Change my name color</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 3\">Change my title color</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 4\">Set me as Noble</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 5\">Set me as Hero</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 6\">Change my sex</a><br>" + "<a action=\"bypass -h npc_%objectId%_showwindow 7\">Put down my PKs</a><br>" + "</body></html>"; private final int NickNameChangeItem = 4037; private final int NickNameChangeItemCount = 200; private final String NickNameChangeItemName = "Coin of Luck"; private final String NickNamePattern = ".*"; // private final int ChangeTitleColorItem = 4037; // private final int ChangeTitleColorItemCount = 20; // private final String ChangeTitleColorItemName = "Coin of Luck"; private final int ChangeNickColorItem = 4037; private final int ChangeNickColorItemCount = 30; private final String ChangeNickColorItemName = "Coin of Luck"; private final int SetNobleItem = 4037; // private final int SetNobleItemCount = 100; // private final String SetNobleItemName = "Coin of Luck"; private final int SetHeroItem = 4037; // private final int SetHeroItemCount = 300; // private final String SetHeroItemName = "Coin of Luck"; // private final int SetSexItem = 4037; // private final int SetSexItemCount = 10; // private final String SetSexItemName = "Coin of Luck"; // private final int ChangePkKillsItem = 57; // private final int ChangePkKillsItemCount = 1; // private final String ChangePkKillsItemName = "Coin of Luck"; // public L2CharManagerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String curCommand = st.nextToken(); if(curCommand.startsWith("showwindow")) { showWindow(player, Integer.parseInt(st.nextToken())); } else if(curCommand.startsWith("change_nickname")) { String name = st.nextToken(); playerSetNickName(player, name); } else if(curCommand.startsWith("change_nickcolor")) { playerSetColor(player, st.nextToken(), 1); } else if(curCommand.startsWith("change_titlecolor")) { playerSetColor(player, st.nextToken(), 2); } else if(curCommand.startsWith("change_pkcount")) { changePkCount(player, Integer.parseInt(st.nextToken())); } else if(curCommand.startsWith("setstatus")) { setStatus(player, Integer.parseInt(st.nextToken())); } } @Override public void onAction(L2PcInstance player) { player.setLastFolkNPC(this); if(!canTarget(player)) return; if(this != player.getTarget()) { player.setTarget(this); MyTargetSelected my = new MyTargetSelected(getObjectId(), 0); player.sendPacket(my); player.sendPacket(new ValidateLocation(this)); } else { if(!canInteract(player)) { } else { NpcHtmlMessage html = new NpcHtmlMessage(1); html.setHtml(NPC_MENU); sendHtmlMessage(player, html); } } player.sendPacket(ActionFailed.STATIC_PACKET); } private void sendHtmlMessage(L2PcInstance player, NpcHtmlMessage html) { html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%npcId%", String.valueOf(getNpcId())); player.sendPacket(html); } private void playerSetColor(L2PcInstance player, String color, int type) { int colorh = -1; if(color.equalsIgnoreCase("Green")) { colorh = Integer.decode("0x00FF00"); } else if(color.equalsIgnoreCase("Yellow")) { colorh = Integer.decode("0x00FFFF"); } else if(color.equalsIgnoreCase("Orange")) { colorh = Integer.decode("0x0099FF"); } else if(color.equalsIgnoreCase("Blue")) { colorh = Integer.decode("0xFF0000"); } else if(color.equalsIgnoreCase("Black")) { colorh = Integer.decode("0x000000"); } else if(color.equalsIgnoreCase("White")) { colorh = Integer.decode("0xFFFFFF"); } if(type == 1) { if(player.getInventory().getItemByItemId(ChangeNickColorItem) != null && player.getInventory().getItemByItemId(ChangeNickColorItem).getCount() >= ChangeNickColorItemCount && colorh != -1) { player.destroyItemByItemId("Consume", ChangeNickColorItem, ChangeNickColorItemCount, player, false); player.getAppearance().setNameColor(colorh); player.broadcastUserInfo(); player.sendMessage(" " + color); } else { player.sendMessage(""); } } else if(type == 2) { if(player.getInventory().getItemByItemId(ChangeTitleColorItem) != null && player.getInventory().getItemByItemId(ChangeTitleColorItem).getCount() >= ChangeTitleColorItemCount) { player.destroyItemByItemId("Consume", ChangeTitleColorItem, ChangeTitleColorItemCount, player, false); player.getAppearance().setTitleColor(colorh); player.broadcastUserInfo(); player.sendMessage(" " + color); } else { player.sendMessage(""); } } } private void playerSetNickName(L2PcInstance player, String name) { if (name.length() < 3 || name.length() > 16 || !Util.isAlphaNumeric(name) || !isValidName(name)) { player.sendMessage(""); } else { if(player.getInventory().getItemByItemId(NickNameChangeItem) != null && player.getInventory().getItemByItemId(NickNameChangeItem).getCount() >= NickNameChangeItemCount) { player.setName(name); player.destroyItemByItemId("Consume", NickNameChangeItem, NickNameChangeItemCount, player, false); player.broadcastUserInfo(); player.sendMessage(""); player.store(); } else { player.sendMessage(""); } } } private void setStatus(L2PcInstance player, int type) { if(type == 1) { if(player.isNoble()) { player.sendMessage(""); return; } else if(player.getInventory().getItemByItemId(SetNobleItem) == null || player.getInventory().getItemByItemId(SetNobleItem).getCount() < SetNobleItemCount) { player.sendMessage(""); return; } player.destroyItemByItemId("Consume", SetNobleItem, SetNobleItemCount, player, false); MagicSkillUser MSU = new MagicSkillUser(player, player, 2023, 1, 1, 0); player.sendPacket(MSU); player.broadcastPacket(MSU); player.setNoble(true); player.sendMessage(""); player.broadcastUserInfo(); player.getInventory().addItem("Noblesse Tiara",7694, 1, player, player.getTarget()); } else if(type == 2) { if(player.isHero()) { player.sendMessage(""); return; } else if(player.getInventory().getItemByItemId(SetHeroItem) == null || player.getInventory().getItemByItemId(SetHeroItem).getCount() < SetHeroItemCount) { player.sendMessage(""); return; } player.destroyItemByItemId("Consume", SetHeroItem, SetHeroItemCount, player, false); player.setHero(true); player.broadcastUserInfo(); } else if(type == 3) { if(player.getInventory().getItemByItemId(SetSexItem) == null || player.getInventory().getItemByItemId(SetSexItem).getCount() < SetSexItemCount) { player.sendMessage("Not enough item"); return; } player.destroyItemByItemId("Consume", SetSexItem, SetSexItemCount, player, false); player.getAppearance().setSex(player.getAppearance().getSex() ? false : true); player.broadcastUserInfo(); player.decayMe(); player.spawnMe(player.getX(), player.getY(), player.getZ()); player.sendMessage("You have successfully changed their sex."); } } private void showWindow(L2PcInstance player, int window) { TextBuilder tb; NpcHtmlMessage html; if(window == 0) { html = new NpcHtmlMessage(1); html.setHtml(NPC_MENU); sendHtmlMessage(player, html); } else if(window == 1) { tb = new TextBuilder(); tb.append("<html><title></title>"); tb.append("<body><center>"); tb.append("<br> <edit var=\"name\" width=120 height=15><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_nickname $name\"></a><br>"); tb.append(" " + NickNameChangeItemCount + " <font color=\"LEVEL\">" + NickNameChangeItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 2) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<br> <combobox var=\"scolor\" width=\"100\" List=\"White;Green;Yellow;Orange;Blue;Black\"><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_nickcolor $scolor\"></a>"); tb.append("" + ChangeNickColorItemCount + " <font color=\"LEVEL\">" + ChangeNickColorItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 3) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<br> <combobox var=\"scolor\" width=\"100\" List=\"White;Green;Yellow;Orange;Blue;Black\"><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_titlecolor $scolor\"></a><br>"); tb.append(" " + ChangeTitleColorItemCount + " <font color=\"LEVEL\">" + ChangeTitleColorItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 4) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 1\"></a>"); tb.append(" " + SetNobleItemCount + " <font color=\"LEVEL\">" + SetNobleItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 5) { tb = new TextBuilder(); tb.append("<html><title></title><body><center>"); tb.append("<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 2\"></a><br>"); tb.append(" " + SetHeroItemCount + " <font color=\"LEVEL\">" + SetHeroItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\"></a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 6) { tb = new TextBuilder(); tb.append("<html><title>sex change</title><body><center>"); tb.append("Here you can change the gender of your character.<br>"); tb.append("<a action=\"bypass -h npc_%objectId%_setstatus 3\">Back to the floor</a><br>"); tb.append("Price: " + SetSexItemCount + " <font color=\"LEVEL\">" + SetSexItemName + "</font><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\">back</a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } else if(window == 7) { tb = new TextBuilder(); tb.append("<html><title>Wash counter pc</title>"); tb.append("<body><center>"); tb.append("<br> Enter a quantitative pc that will be deleted:<br> <edit var=\"pkcount\" width=120 height=15><br>"); tb.append("<a action=\"bypass -h npc_%objectId%_change_pkcount $pkcount\">Change</a><br>"); tb.append("1 PC = " + ChangePkKillsItemCount + " <font color=\"LEVEL\">" + ChangePkKillsItemName + "</font>"); tb.append("<a action=\"bypass -h npc_%objectId%_showwindow 0\">back</a><br>"); tb.append("</center></body></html>"); html = new NpcHtmlMessage(1); html.setHtml(tb.toString()); sendHtmlMessage(player, html); } } private void changePkCount(L2PcInstance player, int count) { if(player.getInventory().getItemByItemId(ChangePkKillsItem) != null && player.getInventory().getItemByItemId(ChangePkKillsItem).getCount() >= ChangePkKillsItemCount * count) { int inipkKills = player.getPkKills(); if(inipkKills == 0) { player.sendMessage("You have 0 PC"); return; } else if(inipkKills < count) { player.sendMessage("Not the correct number of PCs"); return; } player.destroyItemByItemId("Consume", ChangePkKillsItem, count * ChangePkKillsItemCount, player, false); player.setPkKills(inipkKills - count); player.sendPacket(new UserInfo(player)); player.sendMessage("You have removed " + count + " PK"); } else { player.sendMessage("Not enough item"); } } private boolean isValidName(String text) { Pattern pattern; boolean result = true; String test = text; try { pattern = Pattern.compile(Config.NICK_CHANGE_TEMPLATE); } catch (PatternSyntaxException e) { _log.warning("ERROR : Character name pattern of config is wrong!"); pattern = Pattern.compile(".*"); } Matcher regexp = pattern.matcher(test); if (!(regexp.matches())) { result = false; if (Config.SYMBOL_MIX_PROTECTION) { try { pattern = Pattern.compile("[0-9А-Яа-я]{1,16}"); } catch (PatternSyntaxException e) { _log.warning("ERROR : RU char name pattern is wrong!"); } regexp = pattern.matcher(test); if (regexp.matches()) { result = true; } } } return result; } }
-
Есть скайп или аська?
-
Ладно все по + старались,буду пробывать вытягивать функции
-
Хех меня обломил только что разработчик сборки Люцер,его сообщение Импорты вас не спасут. Вам еще функционал лючеры надо перенести.Я спросил можете мне помочь это сделать? Ответ - Запросто. 3.5к WMR и сборка с этой командой в вашем распоряжении. аххаахах)))
-
нада импорты правильно написать,и убрать код про евенты,они там лишние,там импорт на стф,твт,ласт хиро и дм евенты,нада поубирать их с кода,я пробывал но у меня не оч получалось,очень прошу помогите правильно доработать код,уверен многие будут довольны менюшкой
-
Вот html Скрытый текст<html><title>Меню настроек</title><body><center><font color="LEVEL">Личные настройки персонажа</font></center> <table bgcolor="666666"> <tr> <td width=5></td> <td width=150>Описание команд:</td> <td width=50>Сейчас</td> <td width=30>ON</td> <td width=30>OFF</td> </tr> </table> <br> <table bgcolor="666666"> <tr> <td width=5></td> <td width=150>Не показывать trader'ов:</td> <td width=30>%notraders%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_disableOffKnow" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_enableOffKnow" value="OFF"></td> </tr> <tr> <td width=5></td> <td width=150>Отключить обмен:</td> <td width=30>%notrade%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_disableTrade" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_enableTrade" value="OFF"></td> </tr> <tr> <td width=5></td> <td width=150>Включить авто Loot:</td> <td width=30>%autoloot%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_enableAutoloot" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_disableAutoloot" value="OFF"></td> </tr> <tr> <td width=5></td> <td width=150>Отключить сообщения:</td> <td width=30>%nomsg%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_disableMessage" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_enableMessage" value="OFF"></td> </tr> <tr> <td width=5></td> <td width=150>Анимировать Buff:</td> <td width=30>%buffanim%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_enableBuffAnim" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_disableBuffAnim" value="OFF"></td> </tr> <tr> <td width=5></td> <td width=150>Остановить опыт:</td> <td width=30>%gainexp%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_disableGainExp" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_enableGainExp" value="OFF"></td> </tr> <tr> <td width=5></td> <td width=150>Шанс прохождения скилов:</td> <td width=30>%skillchance%</td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_showSkillSuccess" value="ON"></td> <td width=35><button width=35 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_hideSkillSuccess" value="OFF"></td> </tr> </table bgcolor="666666"> <br><br> <center><font color="LEVEL">Список доступных сервисов</font></center> <table bgcolor="666666"> <tr> <td width=5></td> <td width=170>Описание кнопок:</td> <td width=100>Enable</td> </tr> </table> <br> <table bgcolor="666666"> <tr> <td width=5></td> <td width=160>Offline торговля:</td> <td width=100><button width=70 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_offline" value="ENABLE"></td> </tr> <tr> <td width=5></td> <td width=160>Восстановить игрока:</td> <td width=100><button width=70 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_repair" value="ENABLE"></td> </tr> <tr> <td width=5></td> <td width=160>Поиск маммонов:</td> <td width=100><button width=70 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_mammon" value="ENABLE"></td> </tr> <td width=5></td> <td width=160>Статистика:</td> <td width=100><button width=70 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_status" value="ENABLE"></td> </tr> <tr> <td width=5></td> <td width=160>Показать помощь:</td> <td width=100><button width=70 height=15 back="sek.cbui94" fore="sek.cbui94" action="bypass -h voice_help" value="ENABLE"></td> </tr> </table> </body></html>
-
Что никому ненада такая меню?Хм странно, это скрин нашел,ну в этом меню что я дал больше функций
-
В VoicedCommandHandler прописал после Online - вроде бы разницы нету где прописать import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Menu;
-
Вообще нашел на одном форуме код для реализации меню но код настроен под Люцер сборку,очень классная менюшка,большой и вкусный функционал,помогите доработать под фрозен ,я буду очень признателен и с меня + Помогите настроить под фрозен,я импорты вроде бы правельно написал,а компилится не хочет вот собственно код Скрытый текстpackage handlers.voice; import ru.catssoftware.Config; import ru.catssoftware.Message; import ru.catssoftware.gameserver.cache.HtmCache; import ru.catssoftware.gameserver.handler.IVoicedCommandHandler; import ru.catssoftware.gameserver.handler.VoicedCommandHandler; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.entity.events.CTF.CTF; import ru.catssoftware.gameserver.model.entity.events.DeathMatch.DeathMatch; import ru.catssoftware.gameserver.model.entity.events.LastHero.LastHero; import ru.catssoftware.gameserver.model.entity.events.TvT.TvT; import ru.catssoftware.gameserver.model.zone.L2Zone; import ru.catssoftware.gameserver.network.serverpackets.NpcHtmlMessage; /** * Author: m095 * Хандлер команд для конфигурации персонажа * EmuRT DevTeam **/ public class Configurator implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "menu", "events", "autoloot", "enableTrade", "disableTrade", "enableOffKnow", "disableOffKnow", "enableAutoloot", "disableAutoloot", "enableMessage", "showSkillSuccess", "disableMessage", "enableBuffAnim", "disableBuffAnim", "enableGainExp", "disableGainExp", "ignorecolors", "lang" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (activeChar.isInOlympiadMode() || activeChar.isInFunEvent() || activeChar.isInCombat()) { activeChar.sendMessage(Message.getMessage(activeChar, Message.MessageId.MSG_NOT_ALLOWED_AT_THE_MOMENT)); return true; } if (command.startsWith("menu")) { showMainPage(activeChar); return true; } else if (command.startsWith("events")) { showEventPage(activeChar); return true; } else if (command.startsWith("showSkillSuccess")) { if(!Config.SHOW_SKILL_SUCCESS_CHANCE) activeChar.sendMessage(Message.getMessage(activeChar, Message.MessageId.MSG_FORBIDEN_BY_ADMIN)); else activeChar.setShowSkillChance(!activeChar.isShowSkillChance()); showMainPage(activeChar); return true; } else if(command.equals("ignorecolors")) { boolean val = true; try { val = !activeChar.getCharacterData().getBool("ignorecolors"); activeChar.getCharacterData().set("ignorecolors",val); } catch(Exception e) { activeChar.getCharacterData().set("ignorecolors",val); } activeChar.sendMessage("Ignoring system colors "+(val?"endbled":"disabled")); } else if (command.startsWith("autoloot")) { if (!Config.ALLOW_AUTO_LOOT) { activeChar.notWorking(false); return true; } if (activeChar.isAutoLootEnabled()) { activeChar.enableAutoLoot(false); activeChar.sendMessage("AutoLoot is off."); } else { activeChar.enableAutoLoot(true); activeChar.sendMessage("AutoLoot is on"); } } else if (command.startsWith("enableTrade")) { activeChar.setTradeRefusal(false); showMainPage(activeChar); return true; } else if (command.startsWith("disableTrade")) { activeChar.setTradeRefusal(true); showMainPage(activeChar); return true; } else if (command.startsWith("enableOffKnow")) { if (!activeChar.isInsideZone(L2Zone.FLAG_PEACE)) { activeChar.sendMessage(Message.getMessage(activeChar, Message.MessageId.MSG_ONLY_IN_PEACE_ZONE)); showMainPage(activeChar); return true; } activeChar.setKnowlistMode(true); showMainPage(activeChar); return true; } else if (command.startsWith("lang")) { activeChar.sendMessage(String.format(Message.getMessage(activeChar, Message.MessageId.MSG_CURRENT_LANG),HtmCache.getInstance().getLanguages().get(ac tiveChar.getLang()))); if(target!=null && target.length()>0) if(HtmCache.getInstance().getLanguages().containsKey(target)) { activeChar.setLang(target); activeChar.sendMessage(String.format(Message.getMessage(activeChar, Message.MessageId.MSG_CURRENT_LANG),HtmCache.getInstance().getLanguages().get(ac tiveChar.getLang()))); } } else if (command.startsWith("disableOffKnow")) { if (!activeChar.isInsideZone(L2Zone.FLAG_PEACE)) { activeChar.sendMessage(Message.getMessage(activeChar, Message.MessageId.MSG_ONLY_IN_PEACE_ZONE)); showMainPage(activeChar); return true; } activeChar.setKnowlistMode(false); showMainPage(activeChar); return true; } else if (command.startsWith("enableAutoloot")) { if (Config.ALLOW_AUTO_LOOT) activeChar.enableAutoLoot(true); else activeChar.notWorking(false); showMainPage(activeChar); return true; } else if (command.startsWith("disableAutoloot")) { if (Config.ALLOW_AUTO_LOOT) activeChar.enableAutoLoot(false); else activeChar.notWorking(false); showMainPage(activeChar); return true; } else if (command.startsWith("enableGainExp")) { if (Config.ALLOW_USE_EXP_SET) activeChar.canGainExp(true); else activeChar.notWorking(false); showMainPage(activeChar); return true; } else if (command.startsWith("disableGainExp")) { if (Config.ALLOW_USE_EXP_SET) activeChar.canGainExp(false); else activeChar.notWorking(false); showMainPage(activeChar); return true; } else if (command.startsWith("enableMessage")) { activeChar.setMessageRefusal(false); showMainPage(activeChar); return true; } else if (command.startsWith("disableMessage")) { activeChar.setMessageRefusal(true); showMainPage(activeChar); return true; } else if (command.startsWith("enableBuffAnim")) { activeChar.setShowBuffAnim(true); showMainPage(activeChar); return true; } else if (command.startsWith("disableBuffAnim")) { activeChar.setShowBuffAnim(false); showMainPage(activeChar); return true; } return false; } private String getGainExpMode(L2PcInstance activeChar) { String result = "ON"; if (activeChar.canGainExp()) result = "OFF"; return result; } private String getBuffAnimMode(L2PcInstance activeChar) { String result = "OFF"; if (activeChar.ShowBuffAnim()) result = "ON"; return result; } private String getKnowListMode(L2PcInstance activeChar) { String result = "ON"; if (activeChar.showTraders()) result = "OFF"; return result; } private String getTradeMode(L2PcInstance activeChar) { String result = "OFF"; if (activeChar.getTradeRefusal()) result = "ON"; return result; } private String getMessageMode(L2PcInstance activeChar) { String result = "OFF"; if (activeChar.getMessageRefusal()) result = "ON"; return result; } private String getLootMode(L2PcInstance activeChar) { String result = "OFF"; if (activeChar.isAutoLootEnabled()) result = "ON"; return result; } private void showMainPage(L2PcInstance activeChar) { if(!Config.ALLOW_MENU) return; NpcHtmlMessage html = new NpcHtmlMessage(activeChar.getObjectId()); html.setFile("data/html/menu.htm"); html.replace("%notraders%", getKnowListMode(activeChar)); html.replace("%notrade%", getTradeMode(activeChar)); html.replace("%autoloot%", getLootMode(activeChar)); html.replace("%nomsg%", getMessageMode(activeChar)); html.replace("%buffanim%", getBuffAnimMode(activeChar)); html.replace("%gainexp%", getGainExpMode(activeChar)); html.replace("%skillchance%",activeChar.isShowSkillChance()?"ON":"OFF"); activeChar.sendPacket(html); } private void showEventPage(L2PcInstance activeChar) { NpcHtmlMessage html = new NpcHtmlMessage(activeChar.getObjectId()); html.setFile("data/html/mods/event_npc.htm"); html.replace("%tvt_state%", getEventStatus(0)); html.replace("%ctf_state%", getEventStatus(1)); html.replace("%lh_state%", getEventStatus(2)); html.replace("%dm_state%", getEventStatus(2)); activeChar.sendPacket(html); } private String getEventStatus(int event) { String result = "unknown"; int state = 0; try { switch (event) { case 0: state = TvT.getInstance().getState(); break; case 1: state = CTF.getInstance().getState(); break; case 2: state = LastHero.getInstance().getState(); break; case 3: state = DeathMatch.getInstance().getState(); break; } switch (state) { case 0: result = "Inactive"; break; case 1: result = "Active"; break; case 2: result = "Running"; break; } } catch(Exception e) { } return result; } public String getDescription(String command) { if(command.equals("menu")) return "Выводит меню команд."; return "Подробно в .menu"; } public String[] getVoicedCommandList() { return VOICED_COMMANDS; } public static void main(String [] args) { VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Configurator()); } } А вот импорты я под фрозен переписал но при компиляции ошибку пишет о том что ошибка в package handlers.voice; вот импорты как я переписал Скрытый текстpackage handlers.voice; import com.l2jfrozen.Config; import com.l2jfrozen.Message; import com.l2jfrozen.gameserver.cache.HtmCache; import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler; import com.l2jfrozen.gameserver.handler.VoicedCommandHandler; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.event.CTF; import com.l2jfrozen.gameserver.model.entity.event.TvT; import com.l2jfrozen.gameserver.model.zone.L2Zone; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
-
Подскажите как решить это html was too long Try to use DB for this action и считайте аукцион готов)