Перейти к содержанию

AdminNight

Пользователи
  • Публикаций

    0
  • Зарегистрирован

  • Посещение

  • Отзывы

    0%

Репутация

0

1 Подписчик

Информация о AdminNight

  • Звание
    Только пришел

Информация

  • Пол
    Мужчина
  • Город
    Украина

Посетители профиля

1638 просмотров профиля
  • rios

  1. AdminNight

    Профили В Бафере Alt+b

    кто может помочь сделать профили в бафере Community Board? сборка L2jServer HF Скрытый текстpackage com.l2jserver.gameserver.communitybbs.Manager; import javolution.text.TextBuilder; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.datatables.BuffBBSTable; import com.l2jserver.gameserver.datatables.BuffBBSTable.B BSGroupBuffStat; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.model.L2Skill; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2Pc Instance; import java.util.Map; import java.util.StringTokenizer; import java.util.logging.Logger; public class BuffBBSManager extends BaseBBSManager { private static BuffBBSManager _instance = new BuffBBSManager(); private static Logger _log = Logger.getLogger(BuffBBSManager.class.getName()); public BuffBBSManager(){} public static BuffBBSManager getInstance() { if(_instance == null) _instance = new BuffBBSManager(); return _instance; } // back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" public void parsecmd(String command, L2PcInstance activeChar) { int priceRebuff; TextBuilder html = new TextBuilder(""); L2Skill skill; int bufPet = 0; String buffer_top, buffer_body, buffer_bottom; int idGroup = 0; String name = ""; html.clear(); html.append("<center>"); html.append("<table>"); html.append("<tr>"); for (Map.Entry<Integer, BBSGroupBuffStat> entry: BuffBBSTable.getInstance().getBBSGroups().entrySet ()) { idGroup= entry.getKey(); name = entry.getValue().getName(); html.append("<td>"); //html.append("<button value=\""+name+"\" action=\"bypass -h _bbs_buff;"+idGroup+"\" width=80 height=20 back=\"sek.cbui36\" fore=\"sek.cbui75\">"); html.append("<button value=\""+name+"\" action=\"bypass -h _bbs_buff;"+idGroup+"\" width=90 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">"); html.append("</td>"); } html.append("</tr>"); html.append("</table>"); html.append("</center><br><br>"); buffer_top = html.toString(); html.clear(); html.append("<center>"); html.append("<table>"); html.append("<tr>"); html.append("<td>"); html.append("<button value=\"Сохранить баф\" action=\"bypass -h _bbs_buff_save\" width=200 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">"); html.append("</td>"); html.append("<td>"); html.append("<button value=\"Востановить баф\" action=\"bypass -h _bbs_buff_load\" width=200 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">"); html.append("</td>"); html.append("</tr>"); html.append("</table>"); html.append("</center>"); buffer_bottom = html.toString(); if((activeChar.getPet() != null) && (activeChar.getTarget() == activeChar.getPet()))bufPet = 1; if (command.startsWith("_bbs_buff;")) { StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); int idGrp = Integer.parseInt(st.nextToken()); if (idGrp == 0) idGrp = 1; int idSkill= 0; int lvlSkill= 0; int column = 0; String StringSkill = ""; String skillIcon = ""; String skillName = ""; html.clear(); html.append("<center>Стоимость бафа в данной группе: <font color=F2C202>" + BuffBBSTable.getInstance().getPriceGroup(idGrp) +"</font>.</center><br>"); html.append("<table width=600>"); html.append("<tr>"); for (Map.Entry<Integer, Integer> entry: BuffBBSTable.getInstance().getBBSBuffsForGoup(idGr p).entrySet()) { column ++; idSkill= entry.getKey(); lvlSkill= entry.getValue(); StringSkill = Integer.toString(idSkill); switch(StringSkill.length()) { case 1: skillIcon = "icon.skill000" + idSkill; break; case 2: skillIcon = "icon.skill00" + idSkill; break; case 3: skillIcon = "icon.skill0" + idSkill; break; case 4: skillIcon = "icon.skill" + idSkill; break; } L2Skill skillBuff = SkillTable.getInstance().getInfo(idSkill, 1); if(skillBuff == null) { _log.warning("BuffBBSManager: skill id: "+ idSkill +" not found"); continue; } skillName = skillBuff.getName(); html.append("<td width=150>"); html.append("<center><img src=\""+skillIcon+"\" width=32 height=32 align=center></center><br><center><a action=\"bypass -h _bbs_buff_skill;"+idGrp+";"+idSkill+";"+lvlSkill+" \">"+skillName+"</a></center>"); html.append("</td>"); if(column == 4) { html.append("</tr>"); html.append("<tr>"); column = 0; } } html.append("</tr>"); html.append("</table>"); buffer_body = html.toString(); String content = HtmCache.getInstance().getHtmForce(activeChar.getH tmlPrefix(), "data/html/CommunityBoard/60.htm"); content = content.replace("%buffer_top%", buffer_top); content = content.replace("%buffer_bottom%", buffer_bottom); content = content.replace("%buffer_body%", buffer_body); separateAndSend(content, activeChar); } else if (command.startsWith("_bbs_buff_skill;")) { StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); //_bbs_buff_skill int sGrp = Integer.parseInt(st.nextToken()); //1 int sId = Integer.parseInt(st.nextToken()); //100 int sLvl = Integer.parseInt(st.nextToken()); //1 int price = BuffBBSTable.getInstance().getPriceGroup(sGrp); if(!activeChar.destroyItemByItemId("BuffBBS", 57, (long)price, activeChar, true)) return; L2Character target = (L2Character) activeChar.getTarget(); if (bufPet != 0) { skill = SkillTable.getInstance().getInfo(sId, sLvl); skill.getEffects(target, target); } else { skill = SkillTable.getInstance().getInfo(sId, sLvl); skill.getEffects(activeChar, activeChar); } } else if (command.startsWith("_bbs_buff_save")) { activeChar.updateBBSBuff(bufPet); activeChar.sendMessage("Buffs saved."); } else if (command.startsWith("_bbs_buff_load")) { priceRebuff = activeChar.calcBBSBuff(bufPet); if(priceRebuff > 0) if(activeChar.destroyItemByItemId("BuffBBS", 57, (long)priceRebuff, activeChar, true)) activeChar.cactBBSBuff(bufPet); } } public void parsewrite(String s, String s1, String s2, String s3, String s4, L2PcInstance l2pcinstance){} }
  2. AdminNight

    Enchantbbsmanager (ошибка)

    добавил EnchantBBSManager.java в сборку ток в этой строчке ошибка private static final Logger _log = Logger.getLogger(com/l2jserver/gameserver/communitybbs/Manager/EnchantBBSManager.getName()); Не пойму где надо дописать чтобы убрать эту ошибку? пробывал так private static final Logger _log = Logger.getLogger(com.l2jserver.gameserver.communit ybbs.Manager.EnchantBBSManager.getName()); Подчеркивает GetName ошибка в Eclipse такая The method GetName() is undefined for the type EnchantBBSManager метод такой в етом фаиле вроде создавать не надо ,там где я его взял метода на GetName в фаиле EnchantBBSManager не было.
  3. AdminNight

    High Five

    Бери бафера для Фреи подойдет тебе под High Five. А если хочеш с новыми бафами High Five вноси сам)
  4. Вот видео ,там видно в чем проблема. http://www.youtube.com/watch?v=Wjdn8iDMl_w
  5. Проблема в том что я добавил в (Comunity Board Buff) бафы Impover (Combat,Movement и т.д) Когда сохраняешь бафф с баффами Impover ,бафер потом не возращает бафф.Если не бафать Impover(ы) тогда все нормально ,бафф нормально сохраняется и при нажать вернуть поевлятся .Проблема имено в Impover баффах . Не пойму в чем причина, почему Impover баффы не поевляются при нажатии вернуть. В sql дописал Impover баффы.
  6. AdminNight

    Teleport Save (community Board)

    Sql фаил есть ComTeleport .Ошибка где то в Java или в Htm.
  7. AdminNight

    Teleport Save (community Board)

    не пойму че не работает сохранение точки в Community Board Teleport. нажимаю сохранить точку возрата ,оно не сохраняет(Тоесть при нажатии вобще не чего не происходит) сборка L2Jserver вот как сделано тп исходники CommunityBoard.java Скрытый текстpackage com.l2jserver.gameserver.communitybbs; import java.util.StringTokenizer; import com.l2jserver.Config; import com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.ClanBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.ClassBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.PostBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TeleportBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TopBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TopicBBSManager; import com.l2jserver.gameserver.datatables.MultiSell; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.L2GameClient; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ShowBoard; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; public class CommunityBoard { private CommunityBoard() { } public static CommunityBoard getInstance() { return SingletonHolder._instance; } public void handleCommands(L2GameClient client, String command) { L2PcInstance activeChar = client.getActiveChar(); if (activeChar == null) return; if(activeChar.isDead() || activeChar.isAlikeDead() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isFlying() || activeChar.isInSiege() || activeChar.isCombatFlagEquipped()) { } if(activeChar.isInJail()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0442\u044E\u0440\u043C\u0435."); return; } if(activeChar.isInDuel()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u0434\u0443\u0435\u043B\u0438."); return; } if(activeChar.isInOlympiadMode()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u041E\u043B\u0438\u043C\u043F\u0438\u0430\u0434\u044B."); return; } if(activeChar.getPvpFlag() != 0 || activeChar.getKarma() > 0) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C CommunityBoard \u0432 \u0442\u0430\u043A\u043E\u043C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0438."); return; } if(TvTEvent.isStarted()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F TVT \u0435\u0432\u0435\u043D\u0442\u0430."); return; } if(activeChar.isInsideZone((byte)0)) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u043E\u0435\u0432\u043E\u0439 \u0437\u043E\u043D\u0435."); return; } if(activeChar.isInsideZone((byte)2)) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0437\u043E\u043D\u0435 \u043E\u0441\u0430\u0434\u044B."); return; } switch (Config.COMMUNITY_TYPE) { default: case 0: //disabled activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CB_OFFLINE) ); break; case 1: // old RegionBBSManager.getInstance().parsecmd(command, activeChar); break; case 2: // new if (command.startsWith("_bbsclan")) { ClanBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsmemo")) { TopicBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbstopics")) { TopicBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsposts")) { PostBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbstop")) { TopBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbshome")) { TopBBSManager.getInstance().parsecmd(command, activeChar); } else if(command.startsWith("_bbsclass")) { ClassBBSManager.getInstance().parsecmd(command, activeChar); break; } else if (command.startsWith("_bbs_buff")) { BuffBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsteleport;")) { TeleportBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsmultisell;")) { if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel()){ activeChar.sendMessage("В данных условиях использовать Шоп запрещено"); return; } StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); TopBBSManager.getInstance().parsecmd("_bbstop;" + st.nextToken(), activeChar); int multisell = Integer.parseInt(st.nextToken()); MultiSell.getInstance().separateAndSend(multisell, activeChar, null, false); } else if (command.startsWith("_bbsloc")) { RegionBBSManager.getInstance().parsecmd(command, activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } break; } } /** * @param client * @param url * @param arg1 * @param arg2 * @param arg3 * @param arg4 * @param arg5 */ public void handleWriteCommands(L2GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5) { L2PcInstance activeChar = client.getActiveChar(); if (activeChar == null) return; switch (Config.COMMUNITY_TYPE) { case 2: if (url.equals("Topic")) { TopicBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Post")) { PostBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Region")) { RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Notice")) { ClanBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + url + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } break; case 1: RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); break; default: case 0: ShowBoard sb = new ShowBoard("<html><body><br><br><center>The Community board is currently disabled</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); break; } } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final CommunityBoard _instance = new CommunityBoard(); } } вот TeleportBBSManager.java Скрытый текстpackage com.l2jserver.gameserver.communitybbs.Manager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.StringTokenizer; import java.util.logging.Logger; import javolution.text.TextBuilder; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.ShowBoard; public class TeleportBBSManager extends BaseBBSManager { @SuppressWarnings("unused") private static Logger _log = Logger.getLogger(TeleportBBSManager.class.getName()); public class CBteleport { public int TpId = 0; // Teport location ID public String TpName = ""; // Location name public int PlayerId = 0; // charID public int xC = 0; // Location coords X public int yC = 0; // Location coords Y public int zC = 0; // Location coords Z } private static TeleportBBSManager _Instance = null; public static TeleportBBSManager getInstance() { if(_Instance == null) _Instance = new TeleportBBSManager(); return _Instance; } public String points[][]; @Override public void parsecmd(String command, L2PcInstance activeChar) { if(command.equals("_bbsteleport;")) { showTp(activeChar); } else if(command.startsWith("_bbsteleport;delete;")) { StringTokenizer stDell = new StringTokenizer(command, ";"); stDell.nextToken(); stDell.nextToken(); int TpNameDell = Integer.parseInt(stDell.nextToken()); delTp(activeChar, TpNameDell); showTp(activeChar); } else if(command.startsWith("_bbsteleport;save;")) { StringTokenizer stAdd = new StringTokenizer(command, ";"); stAdd.nextToken(); stAdd.nextToken(); String TpNameAdd = stAdd.nextToken(); AddTp(activeChar, TpNameAdd); showTp(activeChar); } else if(command.startsWith("_bbsteleport;teleport;")) { StringTokenizer stGoTp = new StringTokenizer(command, " "); stGoTp.nextToken(); int xTp = Integer.parseInt(stGoTp.nextToken()); int yTp = Integer.parseInt(stGoTp.nextToken()); int zTp = Integer.parseInt(stGoTp.nextToken()); int priceTp = Integer.parseInt(stGoTp.nextToken()); goTp(activeChar, xTp, yTp, zTp, priceTp); showTp(activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } } @SuppressWarnings("cast") private void goTp(L2PcInstance activeChar, int xTp, int yTp, int zTp, int priceTp) { if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel()){ activeChar.sendMessage("В данных условиях телепортация запрещена"); return; } if(priceTp > 0 && activeChar.getAdena() < priceTp) { activeChar.sendMessage("Недостаточно Адены"); return; } else { if(priceTp > 0) { activeChar.reduceAdena("Teleport", (long) priceTp, activeChar, true); } activeChar.teleToLocation(xTp,yTp,zTp); } } private void showTp(L2PcInstance activeChar) { CBteleport tp; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement st = con.prepareStatement("SELECT * FROM comteleport WHERE charId=?;"); st.setLong(1, activeChar.getObjectId()); ResultSet rs = st.executeQuery(); TextBuilder html = new TextBuilder(); html.append("<table width=220>"); while(rs.next()) { tp = new CBteleport(); tp.TpId = rs.getInt("TpId"); tp.TpName = rs.getString("name"); tp.PlayerId = rs.getInt("charId"); tp.xC = rs.getInt("xPos"); tp.yC = rs.getInt("yPos"); tp.zC = rs.getInt("zPos"); html.append("<tr>"); html.append("<td>"); html.append("<button value=\""+ tp.TpName +"\" action=\"bypass -h _bbsteleport;teleport; " + tp.xC + " " + tp.yC + " " + tp.zC + " " +100000 + "\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); html.append("</td>"); html.append("<td>"); html.append("<button value=\"Удалить\" action=\"bypass -h _bbsteleport;delete;" + tp.TpId + "\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); html.append("</td>"); html.append("</tr>"); } html.append("</table>"); String content = HtmCache.getInstance().getHtmForce(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/50.htm"); NpcHtmlMessage adminReply = new NpcHtmlMessage(5); adminReply.setHtml(content); adminReply.replace("%tp%", html.toString()); /*separateAndSend(adminReply.getHtm(), activeChar);*/ return; } catch (Exception e) { } finally { try { con.close(); } catch (Exception e) { } } } private void delTp(L2PcInstance activeChar, int TpNameDell) { Connection conDel = null; try { conDel = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stDel = conDel.prepareStatement("DELETE FROM comteleport WHERE charId=? AND TpId=?;"); stDel.setInt(1, activeChar.getObjectId()); stDel.setInt(2, TpNameDell); stDel.execute(); } catch (Exception e) { } finally { try { conDel.close(); } catch (Exception e) { } } } private void AddTp(L2PcInstance activeChar, String TpNameAdd) { if(activeChar.isDead() || activeChar.isAlikeDead() || activeChar.isCastingNow() || activeChar.isAttackingNow()) { activeChar.sendMessage("Сохранить закладку в вашем состоянии невозможно"); return; } if(activeChar.isInCombat()) { activeChar.sendMessage("Сохранить закладку в боевом режиме нельзя"); return; } if(activeChar.isInsideZone((byte)11) || activeChar.isInsideZone((byte)5) || activeChar.isInsideZone((byte)9) || activeChar.isInsideZone((byte)10) || activeChar.isInsideZone((byte)3) || activeChar.isInsideZone((byte)16) || activeChar.isInsideZone((byte):pardon: || activeChar.isFlying()) { activeChar.sendMessage("Нельзя сохранить данную локацию"); return; } if(TpNameAdd.equals("") || TpNameAdd.equals(null)) { activeChar.sendMessage("Вы не ввели имя закладки"); return; } Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement st = con.prepareStatement("SELECT COUNT(*) FROM comteleport WHERE charId=?;"); st.setLong(1, activeChar.getObjectId()); ResultSet rs = st.executeQuery(); rs.next(); if(rs.getInt(1) <= 9) { PreparedStatement st1 = con.prepareStatement("SELECT COUNT(*) FROM comteleport WHERE charId=? AND name=?;"); st1.setLong(1, activeChar.getObjectId()); st1.setString(2, TpNameAdd); ResultSet rs1 = st1.executeQuery(); rs1.next(); if(rs1.getInt(1) == 0) { PreparedStatement stAdd = con.prepareStatement("INSERT INTO comteleport (charId,xPos,yPos,zPos,name) VALUES(?,?,?,?,?)"); stAdd.setInt(1, activeChar.getObjectId()); stAdd.setInt(2, activeChar.getX()); stAdd.setInt(3, activeChar.getY()); stAdd.setInt(4, activeChar.getZ()); stAdd.setString(5, TpNameAdd); stAdd.execute(); } else { PreparedStatement stAdd = con.prepareStatement("UPDATE comteleport SET xPos=?, yPos=?, zPos=? WHERE charId=? AND name=?;"); stAdd.setInt(1, activeChar.getObjectId()); stAdd.setInt(2, activeChar.getX()); stAdd.setInt(3, activeChar.getY()); stAdd.setInt(4, activeChar.getZ()); stAdd.setString(5, TpNameAdd); stAdd.execute(); } } else { activeChar.sendMessage("Вы не можете сохранить более десяти закладок"); } } catch (Exception e) { } finally { try { con.close(); } catch (Exception e) { } } } @Override public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar) { } } вот Htm страница телепорта Скрытый текст<html><body> <center> <table> <tr> <td><button value="Новости" action="bypass -h _bbstop" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Справка" action="bypass -h _bbstop;20" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Магазин" action="bypass -h _bbstop;30" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Баффер" action="bypass -h _bbstop;60" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Телепорт" action="bypass -h _bbsteleport;" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Карьера" action="bypass -h _bbsclass;" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> </tr> </table> <img src="L2UI.SquareWhite" width=600 height=1> <table width=600 bgcolor=CCCCCC> <tr> <td></td> <td><a action="bypass -h _bbstop"><font color=F2C202>Главная</font></a></td> <td><font color=F2C202> -> </font></td> <td><a action="bypass -h _bbsteleport;"><font color=F2C202>Телепорт</font></a></td> <td width=50></td> <td align=left><font color=D70000>Все ТП 15к Адена. Возврат на точку: 100к адены</font></td> </tr> </table> <img src="L2UI.SquareWhite" width=600 height=1> <table width=600> <tr><td> <center> <table> <tr> <td> <center> <button value="START zone" action="bypass -h _bbsteleport;teleport; 16327 213129 -9360 2000000000" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <button value="PvP zone" action="bypass -h _bbsteleport;teleport; 73890 142656 -3778 1" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <table height=30> <tr> <td><button value="Farm 1" action="bypass -h _bbsteleport;teleport; -78280 -44248 -10624 100000" width=57 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Farm 2" action="bypass -h _bbsteleport;teleport; -87688 -51080 -10624 100000" width=57 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> <td><button value="Farm 3" action="bypass -h _bbsteleport;teleport; -81928 -55288 -10624 100000" width=57 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td> </tr> </table> <button value="Starting zone" action="bypass -h _bbstop;52" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <button value="TownShips" action="bypass -h _bbstop;521" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> </center> </td> <td> <center> <button value="Королевства" action="bypass -h _bbstop;522" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <button value="Некрополисы" action="bypass -h _bbstop;518" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <button value="Катакомбы" action="bypass -h _bbstop;519" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <button value="Interlude зоны" action="bypass -h _bbstop;524" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <button value="Kamael зоны" action="bypass -h _bbstop;525" width=190 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> </center> </td> <td> <table width=220> <tr> <td> <center>Персональные точки возврата:</center> </td> </tr> <tr> <td> <center> <edit var="name" width=180 length=10> <button value="Сохранить текущую точку возврата" action="bypass -h _bbsteleport;save; $name" width=220 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> <br> %tp% </center> </td> </tr> </table> </tr> </td> </table> </center> </td></tr> </table> <img src="L2UI.SquareWhite" width=600 height=1> <font color=3293F3>PVP Community Board</font> </center> </body> </html> Может не хватает sql файла или написано где то не верно? Подскажите плиз.
  8. AdminNight

    Multisellchoose

    Тему Closed . Разобрался.
  9. AdminNight

    Multisellchoose

    Кто может помочь с Community гм-шопом через TW ? не могу разобратся, как сделать чтобы обычным игроком можно было покупать.
  10. AdminNight

    Multisellchoose

    не помогло ( Удалил то что ты отметил красным. Захожу в игру нажимаю купить ,не че не происходит вообще. (скомпилить исходники не забыл!)
  11. AdminNight

    Multisellchoose

    Сборка L2jServer High Five L2J_DataPack_BETA -Revision 8271 L2J_Server_BETA-Revision 4835 Файл MultiSellChoose вот Скрытый текстpackage com.l2jserver.gameserver.network.clientpackets; import java.util.ArrayList; import java.util.logging.Logger; import javolution.util.FastList; import com.l2jserver.Config; import com.l2jserver.gameserver.datatables.MultiSell; import com.l2jserver.gameserver.model.Elementals; import com.l2jserver.gameserver.model.L2Augmentation; import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.itemcontainer.PcInventory; import com.l2jserver.gameserver.model.multisell.Entry; import com.l2jserver.gameserver.model.multisell.Ingredient; import com.l2jserver.gameserver.model.multisell.PreparedListContainer; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ItemList; import com.l2jserver.gameserver.network.serverpackets.StatusUpdate; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; /** * The Class MultiSellChoose. */ public class MultiSellChoose extends L2GameClientPacket { private static final String _C__B0_MULTISELLCHOOSE = "[C] B0 MultiSellChoose"; private static Logger _log = Logger.getLogger(MultiSellChoose.class.getName()); private int _listId; private int _entryId; private long _amount; /*@SuppressWarnings("unused") private int _unk1; @SuppressWarnings("unused") private int _unk2; @SuppressWarnings("unused") private int _unk3; @SuppressWarnings("unused") private int _unk7; @SuppressWarnings("unused") private int _unk4; @SuppressWarnings("unused") private int _unk5; @SuppressWarnings("unused") private int _unk6; @SuppressWarnings("unused") private int _unk8; @SuppressWarnings("unused") private int _unk9; @SuppressWarnings("unused") private int _unk10; @SuppressWarnings("unused") private int _unk11;*/ @Override protected void readImpl() { _listId = readD(); _entryId = readD(); _amount = readQ(); /*_unk1 = readH(); _unk2 = readD(); _unk3 = readD(); _unk4 = readH(); // elemental attributes _unk5 = readH(); // elemental attributes _unk6 = readH(); // elemental attributes _unk7 = readH(); // elemental attributes _unk8 = readH(); // elemental attributes _unk9 = readH(); // elemental attributes _unk10 = readH(); // elemental attributes _unk11 = readH(); // elemental attributes*/ } @Override public void runImpl() { final L2PcInstance player = getClient().getActiveChar(); if (player == null) return; if (!getClient().getFloodProtectors().getMultiSell().tryPerformAction("multisell choose")) { player.setMultiSell(null); return; } if (_amount < 1 || _amount > 5000) { player.setMultiSell(null); return; } PreparedListContainer list = player.getMultiSell(); if (list == null || list.getListId() != _listId) { player.setMultiSell(null); return; } L2Npc target = player.getLastFolkNPC(); if (!player.isGM() && (target == null || !list.checkNpcObjectId(target.getObjectId()) || !target.canInteract(player))) { player.setMultiSell(null); return; } for (Entry entry : list.getEntries()) { if (entry.getEntryId() == _entryId) { if (!entry.isStackable() && _amount > 1) { _log.severe("Character: " + player.getName() + " is trying to set amount > 1 on non-stackable multisell, id:" + _listId + ":" + _entryId); player.setMultiSell(null); return; } final PcInventory inv = player.getInventory(); int slots = 0; int weight = 0; for (Ingredient e : entry.getProducts()) { if (e.getItemId() < 0) // special continue; if (!e.isStackable()) slots += e.getItemCount() * _amount; else if (player.getInventory().getItemByItemId(e.getItemId()) == null) slots++; weight += e.getItemCount() * _amount * e.getWeight(); } if (!inv.validateWeight(weight)) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.WEIGHT_LIMIT_EX CEEDED)); return; } if (!inv.validateCapacity(slots)) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.SLOTS_FULL)); return; } ArrayList<Ingredient> ingredientsList = new ArrayList<Ingredient>(entry.getIngredients().size()); // Generate a list of distinct ingredients and counts in order to check if the correct item-counts // are possessed by the player boolean newIng; for (Ingredient e : entry.getIngredients()) { newIng = true; // at this point, the template has already been modified so that enchantments are properly included // whenever they need to be applied. Uniqueness of items is thus judged by item id AND enchantment level for (int i = ingredientsList.size(); --i >= 0;) { Ingredient ex = ingredientsList.get(i); // if the item was already added in the list, merely increment the count // this happens if 1 list entry has the same ingredient twice (example 2 swords = 1 dual) if ((ex.getItemId() == e.getItemId()) && (ex.getEnchantLevel() == e.getEnchantLevel())) { if (ex.getItemCount() + e.getItemCount() > Integer.MAX_VALUE) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EXCEED ED_QUANTITY_THAT_CAN_BE_INPUTTED)); return; } // two same ingredients, merge into one and replace old final Ingredient ing = ex.clone(); ing.setItemCount(ex.getItemCount() + e.getItemCount()); ingredientsList.set(i, ing); newIng = false; break; } } if (newIng) { // if it's a new ingredient, just store its info directly (item id, count, enchantment) ingredientsList.add(e); } } // now check if the player has sufficient items in the inventory to cover the ingredients' expences for (Ingredient e : ingredientsList) { if (e.getItemCount() * _amount > Integer.MAX_VALUE) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EXCEED ED_QUANTITY_THAT_CAN_BE_INPUTTED)); return; } if (e.getItemId() < 0) { if (!MultiSell.checkSpecialIngredient(e.getItemId(), e.getItemCount() * _amount, player)) return; } else { // if this is not a list that maintains enchantment, check the count of all items that have the given id. // otherwise, check only the count of items with exactly the needed enchantment level final long required = ((Config.ALT_BLACKSMITH_USE_RECIPES || !e.getMaintainIngredient()) ? (e.getItemCount() * _amount) : e.getItemCount()); if (inv.getInventoryItemCount(e.getItemId(), list.getMaintainEnchantment() ? e.getEnchantLevel() : -1, false) < required) { SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_UNIT_OF_THE_ITEM_S1_REQUIRED); sm.addItemName(e.getTemplate()); sm.addNumber((int)required); player.sendPacket(sm); return; } } } FastList<L2Augmentation> augmentation = FastList.newInstance(); Elementals[] elemental = null; /** All ok, remove items and add final product */ try { for (Ingredient e : entry.getIngredients()) { if (e.getItemId() < 0) { if (!MultiSell.getSpecialIngredient(e.getItemId(), e.getItemCount() * _amount, player)) return; } else { L2ItemInstance itemToTake = inv.getItemByItemId(e.getItemId()); // initialize and initial guess for the item to take. if (itemToTake == null) { //this is a cheat, transaction will be aborted and if any items already taken will not be returned back to inventory! _log.severe("Character: " + player.getName() + " is trying to cheat in multisell, id:" + _listId + ":" + _entryId); player.setMultiSell(null); return; } /*if (itemToTake.isEquipped()) { //this is a cheat, transaction will be aborted and if any items already taken will not be returned back to inventory! _log.severe("Character: " + player.getName() + " is trying to cheat in multisell, exchanging equipped item, merchatnt id:" + merchant.getNpcId()); player.setMultiSell(null); return; }*/ if (Config.ALT_BLACKSMITH_USE_RECIPES || !e.getMaintainIngredient()) { // if it's a stackable item, just reduce the amount from the first (only) instance that is found in the inventory if (itemToTake.isStackable()) { if (!player.destroyItem("Multisell", itemToTake.getObjectId(), (e.getItemCount() * _amount), player.getTarget(), true)) { player.setMultiSell(null); return; } } else { // for non-stackable items, one of two scenaria are possible: // a) list maintains enchantment: get the instances that exactly match the requested enchantment level // list does not maintain enchantment: get the instances with the LOWEST enchantment level // a) if enchantment is maintained, then get a list of items that exactly match this enchantment if (list.getMaintainEnchantment()) { // loop through this list and remove (one by one) each item until the required amount is taken. L2ItemInstance[] inventoryContents = inv.getAllItemsByItemId(e.getItemId(), e.getEnchantLevel(), false); for (int i = 0; i < (e.getItemCount() * _amount); i++) { if (inventoryContents.isAugmented()) augmentation.add(inventoryContents.getAugmentation()); if(inventoryContents.getElementals() != null) elemental = inventoryContents.getElementals(); if (!player.destroyItem("Multisell", inventoryContents.getObjectId(), 1, player.getTarget(), true)) { player.setMultiSell(null); return; } } } else // enchantment is not maintained. Get the instances with the LOWEST enchantment level { /* NOTE: There are 2 ways to achieve the above goal. * 1) Get all items that have the correct itemId, loop through them until the lowest enchantment * level is found. Repeat all this for the next item until proper count of items is reached. * 2) Get all items that have the correct itemId, sort them once based on enchantment level, * and get the range of items that is necessary. * Method 1 is faster for a small number of items to be exchanged. * Method 2 is faster for large amounts. * * EXPLANATION: * Worst case scenario for algorithm 1 will make it run in a number of cycles given by: * m*(2n-m+1)/2 where m is the number of items to be exchanged and n is the total * number of inventory items that have a matching id. * With algorithm 2 (sort), sorting takes n*log(n) time and the choice is done in a single cycle * for case b (just grab the m first items) or in linear time for case a (find the beginning of items * with correct enchantment, index x, and take all items from x to x+m). * Basically, whenever m > log(n) we have: m*(2n-m+1)/2 = (2nm-m*m+m)/2 > * (2nlogn-logn*logn+logn)/2 = nlog(n) - log(n*n) + log(n) = nlog(n) + log(n/n*n) = * nlog(n) + log(1/n) = nlog(n) - log(n) = (n-1)log(n) * So for m < log(n) then m*(2n-m+1)/2 > (n-1)log(n) and m*(2n-m+1)/2 > nlog(n) * * IDEALLY: * In order to best optimize the performance, choose which algorithm to run, based on whether 2^m > n * if ( (2<<(e.getItemCount() * _amount)) < inventoryContents.length ) * // do Algorithm 1, no sorting * else * // do Algorithm 2, sorting * * CURRENT IMPLEMENTATION: * In general, it is going to be very rare for a person to do a massive exchange of non-stackable items * For this reason, we assume that algorithm 1 will always suffice and we keep things simple. * If, in the future, it becomes necessary that we optimize, the above discussion should make it clear * what optimization exactly is necessary (based on the comments under "IDEALLY"). */ // choice 1. Small number of items exchanged. No sorting. for (int i = 1; i <= (e.getItemCount() * _amount); i++) { L2ItemInstance[] inventoryContents = inv.getAllItemsByItemId(e.getItemId(), false); itemToTake = inventoryContents[0]; // get item with the LOWEST enchantment level from the inventory... // +0 is lowest by default... if (itemToTake.getEnchantLevel() > 0) { for (L2ItemInstance item : inventoryContents) { if (item.getEnchantLevel() < itemToTake.getEnchantLevel()) { itemToTake = item; // nothing will have enchantment less than 0. If a zero-enchanted // item is found, just take it if (itemToTake.getEnchantLevel() == 0) break; } } } if (!player.destroyItem("Multisell", itemToTake.getObjectId(), 1, player.getTarget(), true)) { player.setMultiSell(null); return; } } } } } } } // Generate the appropriate items for (Ingredient e : entry.getProducts()) { if (e.getItemId() < 0) { MultiSell.addSpecialProduct(e.getItemId(), e.getItemCount() * _amount, player); } else { if (e.isStackable()) inv.addItem("Multisell", e.getItemId(), e.getItemCount() * _amount, player, player.getTarget()); else { L2ItemInstance product = null; for (int i = 0; i < (e.getItemCount() * _amount); i++) { product = inv.addItem("Multisell", e.getItemId(), 1, player, player.getTarget()); if (list.getMaintainEnchantment()) { if (i < augmentation.size()) product.setAugmentation(new L2Augmentation(augmentation.get(i).getAugmentationId(), augmentation.get(i).getSkill())); if (elemental != null) for (Elementals elm : elemental) product.setElementAttr(elm.getElement(), elm.getValue()); product.setEnchantLevel(e.getEnchantLevel()); product.updateDatabase(); } } } // msg part SystemMessage sm; if (e.getItemCount() * _amount > 1) { sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S); sm.addItemName(e.getItemId()); sm.addItemNumber(e.getItemCount() * _amount); player.sendPacket(sm); sm = null; } else { if (list.getMaintainEnchantment() && e.getEnchantLevel() > 0) { sm = SystemMessage.getSystemMessage(SystemMessageId.ACQUIRED_S1_S2); sm.addItemNumber(e.getEnchantLevel()); sm.addItemName(e.getItemId()); } else { sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1); sm.addItemName(e.getItemId()); } player.sendPacket(sm); sm = null; } } } player.sendPacket(new ItemList(player, false)); StatusUpdate su = new StatusUpdate(player); su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad()); player.sendPacket(su); su = null; } finally { FastList.recycle(augmentation); } // finally, give the tax to the castle... if (entry.getTaxAmount() > 0) target.getCastle().addToTreasury(entry.getTaxAmount() * _amount); break; } } } @Override public String getType() { return _C__B0_MULTISELLCHOOSE; } }
  12. AdminNight

    Multisellchoose

    Имсходники как раз есть но в CommunityBoard.java Не нашел такого( вот моя комунка i Скрытый текстmport com.l2jserver.Config;import com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.ClanBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.ClassBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.PostBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TeleportBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TopBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TopicBBSManager; import com.l2jserver.gameserver.datatables.MultiSell; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.L2GameClient; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ShowBoard; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; public class CommunityBoard { private CommunityBoard() { } public static CommunityBoard getInstance() { return SingletonHolder._instance; } public void handleCommands(L2GameClient client, String command) { L2PcInstance activeChar = client.getActiveChar(); if (activeChar == null) return; if(activeChar.isDead() || activeChar.isAlikeDead() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isFlying() || activeChar.isInSiege() || activeChar.isCombatFlagEquipped()) { } if(activeChar.isInJail()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0442\u044E\u0440\u043C\u0435."); return; } if(activeChar.isInDuel()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u0434\u0443\u0435\u043B\u0438."); return; } if(activeChar.isInOlympiadMode()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u041E\u043B\u0438\u043C\u043F\u0438\u0430\u0434\u044B."); return; } if(activeChar.getPvpFlag() != 0 || activeChar.getKarma() > 0) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C CommunityBoard \u0432 \u0442\u0430\u043A\u043E\u043C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0438."); return; } if(TvTEvent.isStarted()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F TVT \u0435\u0432\u0435\u043D\u0442\u0430."); return; } if(activeChar.isInsideZone((byte)0)) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u043E\u0435\u0432\u043E\u0439 \u0437\u043E\u043D\u0435."); return; } if(activeChar.isInsideZone((byte)2)) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0437\u043E\u043D\u0435 \u043E\u0441\u0430\u0434\u044B."); return; } switch (Config.COMMUNITY_TYPE) { default: case 0: //disabled activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CB_OFFLINE) ); break; case 1: // old RegionBBSManager.getInstance().parsecmd(command, activeChar); break; case 2: // new if (command.startsWith("_bbsclan")) { ClanBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsmemo")) { TopicBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbstopics")) { TopicBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsposts")) { PostBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbstop")) { TopBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbshome")) { TopBBSManager.getInstance().parsecmd(command, activeChar); } else if(command.startsWith("_bbsclass")) { ClassBBSManager.getInstance().parsecmd(command, activeChar); break; } else if (command.startsWith("_bbs_buff")) { BuffBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsteleport;")) { TeleportBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsmultisell;")) { if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel()){ activeChar.sendMessage("В данных условиях использовать Шоп запрещено"); return; } StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); TopBBSManager.getInstance().parsecmd("_bbstop;" + st.nextToken(), activeChar); int multisell = Integer.parseInt(st.nextToken()); MultiSell.getInstance().separateAndSend(multisell, activeChar, null, false); } else if (command.startsWith("_bbsloc")) { RegionBBSManager.getInstance().parsecmd(command, activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } break; } } /** * @param client * @param url * @param arg1 * @param arg2 * @param arg3 * @param arg4 * @param arg5 */ public void handleWriteCommands(L2GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5) { L2PcInstance activeChar = client.getActiveChar(); if (activeChar == null) return; switch (Config.COMMUNITY_TYPE) { case 2: if (url.equals("Topic")) { TopicBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Post")) { PostBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Region")) { RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Notice")) { ClanBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + url + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } break; case 1: RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); break; default: case 0: ShowBoard sb = new ShowBoard("<html><body><br><br><center>The Community board is currently disabled</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); break; } } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final CommunityBoard _instance = new CommunityBoard(); } } Убрать проверку в фаиле CommunityBoard.java или в MultiSellChoose.java??
  13. AdminNight

    Multisellchoose

    Ты просветил) Оно у меня реализовано все работает кроме гм шопа . В комунити гм шопе могут покупать ток админы вот в чем прикол!
  14. AdminNight

    Multisellchoose

    Что нада дописат по пути com.l2jserver.gameserver.network.clientpackets;- MultiSellChoose ,чтобы в Alt+B могли покупать обычные игроки ?(проблема в том что гмом могу купить вещи в Alt+B Гм-шопе.Перезахожу обычным игроком ,захожу в тот же Shop и оно там не чего не покупается.Я нажимаю купить оно вообще не реагирует ) Сразу говарю в Google нема ! Темы такие есть ответа на них нормально не нашел! Копать надо в MultisellChoose это точно но что там дописать и где.
  15. AdminNight

    Community Board(l2jserver)

    Как сделать что бы нормально листались страницы в Community Board бафере. Проблема вот в чём, у меня бафер в алт+б, там есть страницы бафа 1 2 . Когда бафаюсь на 1 все норм ,когда начинаеш баф на 2 стр. нажимаеш на баф тебе кидается баф но скидует автоматом на 1 страницу. Что надо дописать в ядре или в Htm бафера ,что бы оно не скидывало на 1 страницу.(Если нажимаеш баф на 2 стр. оно остаётся на 2 стр. а не скидует на 1). Как вот ето сделать?Где и что дописать? Вот исходник CommunityBoard.java Скрытый текстpackage com.l2jserver.gameserver.communitybbs; import java.util.StringTokenizer; import com.l2jserver.Config; import com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.ClanBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.PostBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TeleportBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TopBBSManager; import com.l2jserver.gameserver.communitybbs.Manager.TopicBBSManager; import com.l2jserver.gameserver.datatables.MultiSell; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.L2GameClient; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ShowBoard; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; public class CommunityBoard { private CommunityBoard() { } public static CommunityBoard getInstance() { return SingletonHolder._instance; } public void handleCommands(L2GameClient client, String command) { L2PcInstance activeChar = client.getActiveChar(); if(activeChar == null) return; if(activeChar.isDead() || activeChar.isAlikeDead() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isFlying() || activeChar.isInSiege() || activeChar.isCombatFlagEquipped()) { } if(activeChar.isInJail()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0442\u044E\u0440\u043C\u0435."); return; } if(activeChar.isInDuel()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u0434\u0443\u0435\u043B\u0438."); return; } if(activeChar.isInOlympiadMode()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u041E\u043B\u0438\u043C\u043F\u0438\u0430\u0434\u044B."); return; } if(activeChar.getPvpFlag() != 0 || activeChar.getKarma() > 0) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C CommunityBoard \u0432 \u0442\u0430\u043A\u043E\u043C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0438."); return; } if(TvTEvent.isStarted()) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F TVT \u0435\u0432\u0435\u043D\u0442\u0430."); return; } if(activeChar.isInsideZone((byte)0)) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u043E\u0435\u0432\u043E\u0439 \u0437\u043E\u043D\u0435."); return; } if(activeChar.isInsideZone((byte)2)) { activeChar.sendMessage("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0437\u043E\u043D\u0435 \u043E\u0441\u0430\u0434\u044B."); return; } switch (Config.COMMUNITY_TYPE) { default: case 0: //disabled activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CB_OFFLINE) ); break; case 1: // old RegionBBSManager.getInstance().parsecmd(command, activeChar); break; case 2: // new if (command.startsWith("_bbsclan")) { ClanBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsmemo")) { TopicBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbstopics")) { TopicBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsposts")) { PostBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbstop")) { TopBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbshome")) { TopBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbs_buff")) { BuffBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsteleport;")) { TeleportBBSManager.getInstance().parsecmd(command, activeChar); } else if (command.startsWith("_bbsmultisell;")) { if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel()){ activeChar.sendMessage("В данных условиях использовать Шоп запрещено"); return; } StringTokenizer st = new StringTokenizer(command, ";"); st.nextToken(); TopBBSManager.getInstance().parsecmd("_bbstop;" + st.nextToken(), activeChar); int multisell = Integer.parseInt(st.nextToken()); MultiSell.getInstance().separateAndSend(multisell, activeChar, null, false); } else if (command.startsWith("_bbsloc")) { RegionBBSManager.getInstance().parsecmd(command, activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } break; } } /** * @param client * @param url * @param arg1 * @param arg2 * @param arg3 * @param arg4 * @param arg5 */ public void handleWriteCommands(L2GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5) { L2PcInstance activeChar = client.getActiveChar(); if (activeChar == null) return; switch (Config.COMMUNITY_TYPE) { case 2: if (url.equals("Topic")) { TopicBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Post")) { PostBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Region")) { RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else if (url.equals("Notice")) { ClanBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); } else { ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + url + " is not implemented yet</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); } break; case 1: RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar); break; default: case 0: ShowBoard sb = new ShowBoard("<html><body><br><br><center>The Community board is currently disabled</center><br><br></body></html>", "101"); activeChar.sendPacket(sb); activeChar.sendPacket(new ShowBoard(null, "102")); activeChar.sendPacket(new ShowBoard(null, "103")); break; } } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final CommunityBoard _instance = new CommunityBoard(); } } Вот исходник BuffBBSManager.java Скрытый текстpackage com.l2jserver.gameserver.communitybbs.Manager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.model.*; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage; public class BuffBBSManager extends BaseBBSManager { private static BuffBBSManager _instance = new BuffBBSManager(); public int allskillid_1[][]; public BuffBBSManager() { Load(); } public static BuffBBSManager getInstance() { if(_instance == null) _instance = new BuffBBSManager(); return _instance; } public void Load() { Connection connn = null; try { connn = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement count = connn.prepareStatement("SELECT COUNT(*) FROM communitybuff"); ResultSet countt = count.executeQuery(); countt.next(); allskillid_1 = new int[countt.getInt(1)][4]; PreparedStatement table = connn.prepareStatement("SELECT * FROM communitybuff"); ResultSet skills = table.executeQuery(); for(int i = 0; i < allskillid_1.length; i++) { skills.next(); allskillid_1[0] = skills.getInt(2); allskillid_1[1] = skills.getInt(3); allskillid_1[2] = skills.getInt(4); allskillid_1[3] = skills.getInt(5); } count.close(); countt.close(); skills.close(); table.close(); connn.close(); } catch(Exception ignored) { } } @Override public void parsecmd(String command, L2PcInstance activeChar) { String[] parts = command.split("_"); boolean petbuff = false; if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel()) { activeChar.sendMessage("В данных условиях бафф запрещен"); return; } if (!(parts[2].startsWith("buff"))) return; String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/60.htm"); separateAndSend(content, activeChar); if(parts[4] != null && parts[4].startsWith(" Player")) petbuff = false; if(parts[4] != null && parts[4].startsWith(" Pet")) petbuff = true; if(parts[3].startsWith("FIGHERLIST")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) FIGHERLIST(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { FIGHERLIST(activeChar, petbuff); } if(parts[3].startsWith("DANCEFIGHTERLIST")) { if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) DANCEFIGHTERLIST(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { DANCEFIGHTERLIST(activeChar, petbuff); } } if(parts[3].startsWith("MAGELIST")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) MAGELIST(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { MAGELIST(activeChar, petbuff); } if(parts[3].startsWith("DANCEMAGELIST")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) DANCEMAGELIST(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { DANCEMAGELIST(activeChar, petbuff); } if(parts[3].startsWith("SAVE")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) SAVE(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { SAVE(activeChar, petbuff); } if(parts[3].startsWith("BUFF")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) BUFF(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { BUFF(activeChar, petbuff); } if(parts[3].startsWith("CANCEL")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) CANCEL(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { CANCEL(activeChar, petbuff); } if(parts[3].startsWith("REGMP")) if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) REGMP(activeChar, petbuff); else activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } else { REGMP(activeChar, petbuff); } for(int key = 0; key < allskillid_1.length; key++) { L2Skill skill; int skilllevel; if(Config.BUFF_PEACE) { if(activeChar.isInsideZone((byte)2)) { skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[key][0]); skill = SkillTable.getInstance().getInfo(allskillid_1[key][0], skilllevel); if(parts[3].startsWith(skill.getName())) SKILL(activeChar, petbuff, key, skill); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000)); } continue; } skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[key][0]); skill = SkillTable.getInstance().getInfo(allskillid_1[key][0], skilllevel); if(parts[3].startsWith(skill.getName())) SKILL(activeChar, petbuff, key, skill); } } private void FIGHERLIST(L2PcInstance activeChar, boolean petbuff) { int arr$[][] = allskillid_1; int len$ = arr$.length; for(int i$ = 0; i$ < len$; i$++) { int aSkillid[] = arr$[i$]; if(aSkillid[1] != 1 && aSkillid[1] != 3) continue; L2Skill skill; int skilllevel; if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true)) { skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } continue; } skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } } private void DANCEFIGHTERLIST(L2PcInstance activeChar, boolean petbuff) { int arr$[][] = allskillid_1; int len$ = arr$.length; for(int i$ = 0; i$ < len$; i$++) { int aSkillid[] = arr$[i$]; if(aSkillid[1] != 4 && aSkillid[1] != 6) continue; L2Skill skill; int skilllevel; if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true)) { skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } continue; } skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } } private void MAGELIST(L2PcInstance activeChar, boolean petbuff) { int arr$[][] = allskillid_1; int len$ = arr$.length; for(int i$ = 0; i$ < len$; i$++) { int aSkillid[] = arr$[i$]; if(aSkillid[1] != 2 && aSkillid[1] != 3) continue; L2Skill skill; int skilllevel; if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true)) { skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } continue; } skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } } private void DANCEMAGELIST(L2PcInstance activeChar, boolean petbuff) { int arr$[][] = allskillid_1; int len$ = arr$.length; for(int i$ = 0; i$ < len$; i$++) { int aSkillid[] = arr$[i$]; if(aSkillid[1] != 5 && aSkillid[1] != 6) continue; L2Skill skill; int skilllevel; if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true)) { skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } continue; } skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]); skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel); if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } } private void BUFF(L2PcInstance activeChar, boolean petbuff) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT * FROM community_skillsave WHERE charId=?;"); statement.setInt(1, activeChar.getObjectId()); ResultSet rcln = statement.executeQuery(); rcln.next(); if(!petbuff) { char allskills[] = rcln.getString(2).toCharArray(); if(allskills.length == allskillid_1.length) { for(int i = 0; i < allskillid_1.length; i++) if(allskills == '1') if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, allskillid_1[3], allskillid_1[2], activeChar, true)) { int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[0]); L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[0], skilllevel); skill.getEffects(activeChar, activeChar); activeChar.getLevel(); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } } else { int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[0]); L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[0], skilllevel); skill.getEffects(activeChar, activeChar); } } } else { char petskills[] = rcln.getString(3).toCharArray(); if(petskills.length == allskillid_1.length) { for(int i = 0; i < allskillid_1.length; i++) { if(petskills != '1') continue; if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, allskillid_1[3], allskillid_1[2], activeChar, true)) { int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[0]); L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[0], skilllevel); skill.getEffects(activeChar.getPet(), activeChar.getPet()); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } } else { int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[0]); L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[0], skilllevel); skill.getEffects(activeChar.getPet(), activeChar.getPet()); } } } } rcln.close(); statement.close(); } catch(Exception ignored) { try { if(con != null) con.close(); } catch(SQLException e) { e.printStackTrace(); } } try { if(con != null) con.close(); } catch(SQLException e) { e.printStackTrace(); } } private void CANCEL(L2PcInstance activeChar, boolean petbuff) { if(!petbuff) activeChar.stopAllEffects(); else activeChar.getPet().stopAllEffects(); } private void REGMP(L2PcInstance activeChar, boolean petbuff) { if(!petbuff) activeChar.setCurrentMp(activeChar.getMaxMp()); else activeChar.getPet().setCurrentMp(activeChar.getPet().getMaxMp()); } private void SKILL(L2PcInstance activeChar, boolean petbuff, int key, L2Skill skill) { if(Config.MANI_BUFF) { if(activeChar.destroyItemByItemId(null, allskillid_1[key][3], allskillid_1[key][2], activeChar, true)) { if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } else { activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000)); } } else if(!petbuff) skill.getEffects(activeChar, activeChar); else skill.getEffects(activeChar.getPet(), activeChar.getPet()); } private void SAVE(L2PcInstance activeChar, boolean petbuff) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stat = con.prepareStatement("SELECT COUNT(*) FROM community_skillsave WHERE charId=?;"); stat.setInt(1, activeChar.getObjectId()); ResultSet rset = stat.executeQuery(); rset.next(); String allbuff = ""; if(!petbuff) { L2Effect skill[] = activeChar.getAllEffects(); boolean flag = true; int arr$[][] = allskillid_1; int len$ = arr$.length; for(int i$ = 0; i$ < len$; i$++) { int aSkillid[] = arr$[i$]; for(int j = 0; j < skill.length; j++) { if(aSkillid[0] == skill[j].getId()) { allbuff = (new StringBuilder()).append(allbuff).append(1).toString(); flag = false; } if(j == skill.length - 1 && flag) allbuff = (new StringBuilder()).append(allbuff).append(0).toString(); } flag = true; } if(rset.getInt(1) == 0) { PreparedStatement statement1 = con.prepareStatement("INSERT INTO community_skillsave (charId,skills) values (?,?)"); statement1.setInt(1, activeChar.getObjectId()); statement1.setString(2, allbuff); statement1.execute(); statement1.close(); } else { PreparedStatement statement = con.prepareStatement("UPDATE community_skillsave SET skills=? WHERE charId=?;"); statement.setString(1, allbuff); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } } else { L2Effect skill[] = activeChar.getPet().getAllEffects(); boolean flag = true; int arr$[][] = allskillid_1; int len$ = arr$.length; for(int i$ = 0; i$ < len$; i$++) { int aSkillid[] = arr$[i$]; for(int j = 0; j < skill.length; j++) { if(aSkillid[0] == skill[j].getId()) { allbuff = (new StringBuilder()).append(allbuff).append(1).toString(); flag = false; } if(j == skill.length - 1 && flag) allbuff = (new StringBuilder()).append(allbuff).append(0).toString(); } flag = true; } if(rset.getInt(1) == 0) { PreparedStatement statement1 = con.prepareStatement("INSERT INTO community_skillsave (charId,pet) values (?,?)"); statement1.setInt(1, activeChar.getObjectId()); statement1.setString(2, allbuff); statement1.execute(); statement1.close(); } else { PreparedStatement statement = con.prepareStatement("UPDATE community_skillsave SET pet=? WHERE charId=?;"); statement.setString(1, allbuff); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } } rset.close(); stat.close(); } catch(Exception ignored) { try { if(con != null) con.close(); } catch(SQLException e) { e.printStackTrace(); } } try { if(con != null) con.close(); } catch(SQLException e) { e.printStackTrace(); } } @Override public void parsewrite(String s, String s1, String s2, String s3, String s4, L2PcInstance l2pcinstance) { } } а вот Htm Бафера в Community Скрытый текст <table width=600 bgcolor=CCCCCC> <tr> <td></td> <td><a action="bypass -h _bbstop"><font color=F2C202>Главная</font></a></td> <td><font color=F2C202> -> </font></td> <td><a action="bypass -h _bbs_buff"><font color=F2C202>Баффер</font></a></td> <td></td> <td width=310 align=left></td> </tr> </table> <img src="L2UI.SquareWhite" width=600 height=1> <table width=600> <tr> <td height=250> <table width="250"> <tr> <td><center><font color=3293F3>Баффы</font></center></td> </tr> </table> <table width="250"> <tr> <td align=center> <img src=icon.skill1077 width=32 height=32><button value="Focus" action="bypass -h _bbs_buff_Focus_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1242 width=32 height=32><button value="D. Whisper" action="bypass -h _bbs_buff_Death Whisper_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1303 width=32 height=32><button value="Wild Magic" action="bypass -h _bbs_buff_Wild Magic_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1086 width=32 height=32><button value="Haste" action="bypass -h _bbs_buff_Haste_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1240 width=32 height=32><button value="Guidance" action="bypass -h _bbs_buff_Guidance_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1087 width=32 height=32><button value="Agility" action="bypass -h _bbs_buff_Agility_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> <td align=center> <img src=icon.skill1045 width=32 height=32><button value="Bles. Body" action="bypass -h _bbs_buff_Blessed Body_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1048 width=32 height=32><button value="Bles. Soul" action="bypass -h _bbs_buff_Blessed Soul_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1085 width=32 height=32><button value="Acumen" action="bypass -h _bbs_buff_Acumen_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1257 width=32 height=32><button value="Dec. Weight" action="bypass -h _bbs_buff_Decrease Weight_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1068 width=32 height=32><button value="Might" action="bypass -h _bbs_buff_Might_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1059 width=32 height=32><button value="Empower" action="bypass -h _bbs_buff_Empower_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> <td align=center> <img src=icon.skill1040 width=32 height=32><button value="Shield" action="bypass -h _bbs_buff_Shield_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1036 width=32 height=32><button value="M. Barrier" action="bypass -h _bbs_buff_Magic Barrier_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1268 width=32 height=32><button value="Vamp. Rage" action="bypass -h _bbs_buff_Vampiric Rage_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1204 width=32 height=32><button value="Wind Walk" action="bypass -h _bbs_buff_Wind Walk_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1062 width=32 height=32><button value="Ber. Spirit" action="bypass -h _bbs_buff_Berserker Spirit_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1397 width=32 height=32><button value="Clarity" action="bypass -h _bbs_buff_Clarity_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> <td align=center> <img src=icon.skill1332 width=32 height=32><button value="Bles.Seraphim" action="bypass -h _bbs_buff_Blessing of Seraphim_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1332 width=32 height=32><button value="Gift Seraphim" action="bypass -h _bbs_buff_Gift of Seraphim_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1331 width=32 height=32><button value="Bles.Queen" action="bypass -h _bbs_buff_Blessing of Queen_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1331 width=32 height=32><button value="Gift Queen" action="bypass -h _bbs_buff_Gift of Queen_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1388 width=32 height=32><button value="G. Might" action="bypass -h _bbs_buff_Greater Might_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> <img src=icon.skill1389 width=32 height=32><button value="G. Shield" action="bypass -h _bbs_buff_Greater Shield_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </tr> <tr> <td align=center></td> </tr> </table> </td> <td height=350> <center> <table width="350"> <tr> <td><center><font color=3293F3>Операции</font></center></td> </tr> </table> </center> <center> <table width="300" align=center> <tr> <td align=center><button value="Набор для война" action="bypass -h _bbs_buff_FIGHERLIST_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Танцы для война" action="bypass -h _bbs_buff_DANCEFIGHTERLIST_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Набор для мага" action="bypass -h _bbs_buff_MAGELIST_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Танцы для мага" action="bypass -h _bbs_buff_DANCEMAGELIST_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center> <table> <tr> <td align=center> <button value="Сохранить" action="bypass -h _bbs_buff_SAVE_ $tvari" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> <td align=center> <button value="Вернуть" action="bypass -h _bbs_buff_BUFF_ $tvari" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> </tr> <tr> <td align=center> <button value="Сброс" action="bypass -h _bbs_buff_CANCEL_ $tvari" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> <td align=center> <button value="Мана" action="bypass -h _bbs_buff_REGMP_ $tvari" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> </td> </tr> </table> </td> <td align=center> <font color=3293F3>Кого бафать:</font> <combobox width=145 var=tvari list="Player"> </td> </tr> </table> </center> <br> <center> <table width="350"> <tr> <td><center><font color=3293F3>Song & Dance</font></center></td> </tr> </table> <table width="350"> </center> <center> <tr> <td align=center><button value="Song of Earth" action="bypass -h _bbs_buff_Song of Earth_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Song of Life" action="bypass -h _bbs_buff_Song of Life_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Song of Warding" action="bypass -h _bbs_buff_Song of Warding_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Song of Wind" action="bypass -h _bbs_buff_Song of Wind_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Song of Hunter" action="bypass -h _bbs_buff_Song of Hunter_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Song of Vitality" action="bypass -h _bbs_buff_Song of Vitality_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Song of Renewal" action="bypass -h _bbs_buff_Song of Renewal_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Song of Meditation" action="bypass -h _bbs_buff_Song of Meditation_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Song of Champion" action="bypass -h _bbs_buff_Song of Champion_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Dance of the Mystic" action="bypass -h _bbs_buff_Dance of the Mystic_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Dance of Concentration" action="bypass -h _bbs_buff_Dance of Concentration_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Siren's Dance" action="bypass -h _bbs_buff_Siren's Dance_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Dance of the Warrior" action="bypass -h _bbs_buff_Dance of the Warrior_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Dance of Fire" action="bypass -h _bbs_buff_Dance of Fire_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> <tr> <td align=center><button value="Dance of Fury" action="bypass -h _bbs_buff_Dance of Fury_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> <td align=center><button value="Dance of the Vampire" action="bypass -h _bbs_buff_Dance of the Vampire_ $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td> </tr> </table> </center> </td> </tr> </table> <img src="L2UI.SquareWhite" width=600 height=1> <font color=3293F3>PVP Community Board</font> </center> </body> </html> И такой еще вопрос что надо дописать в ядре ,что бы можно было покупать веши в м-шопе (Community Board)обычным игроком а не только гм-ом.
×
×
  • Создать...