Сервис аугментации

Статус
В этой теме нельзя размещать новые ответы.

Umad

Почемучка
Участник
Сообщения
33
Розыгрыши
0
Репутация
11
Реакции
9
Баллы
1 295
Хроники
  1. The 2nd Throne: Gracia
Сборка
l2p
в кб добавил кнопку с сервисом аугментации _bbsls
при нажатии на нее просто пустое окно, в чем может быть проблема?
 
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
Стоит проверка\запрет на вызов этого окна\действия у других нпц (html).
Накосячил с ссылкой\запросом.

Копай дальше
 
Стоит проверка\запрет на вызов этого окна\действия у других нпц (html).
Накосячил с ссылкой\запросом.

Копай дальше
проверок нету

Стоит проверка\запрет на вызов этого окна\действия у других нпц (html).
Накосячил с ссылкой\зап
Стоит проверка\запрет на вызов этого окна\действия у других нпц (html).
Накосячил с ссылкой\запросом.

Копай дальше
Все перепроверил

Java:
package services.community.custom;

import gnu.trove.map.hash.TIntIntHashMap;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import javax.xml.parsers.DocumentBuilderFactory;

import l2p.commons.util.Rnd;
import l2p.gameserver.Config;
import l2p.gameserver.data.htm.HtmCache;
import l2p.gameserver.handler.bbs.CommunityBoardManager;
import l2p.gameserver.handler.bbs.ICommunityBoardHandler;
import l2p.gameserver.model.Player;
import l2p.gameserver.model.Skill;
import l2p.gameserver.model.items.ItemInstance;
import l2p.gameserver.scripts.Functions;
import l2p.gameserver.scripts.ScriptFile;
import l2p.gameserver.serverpackets.InventoryUpdate;
import l2p.gameserver.serverpackets.ShowBoard;
import l2p.gameserver.tables.SkillTable;
import l2p.gameserver.templates.item.ItemTemplate;
import l2p.gameserver.templates.item.ItemTemplate.Grade;
import l2p.gameserver.utils.HtmlUtils;
import l2p.gameserver.utils.StringUtil;
import l2p.gameserver.utils.XMLUtil;

import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.slf4j.Logger;

public class CommunityAugmentation extends Functions implements ScriptFile, ICommunityBoardHandler {

    private static final Logger _log = LoggerFactory.getLogger(CommunityAugmentation.class);

    @Override
    public void onLoad() {
        if (Config.COMMUNITY_BOARD_ENABLED) {
            CommunityBoardManager.getInstance().registerHandler(this);
            load();
            _log.info("CommunityBoard: Augmenation Community service loaded.");
            _log.info("CommunityBoard: Augmenation Community load " + _id.size() + " ls skills");
        }
    }

    @Override
    public void onReload() {
        if (Config.COMMUNITY_BOARD_ENABLED) {
            CommunityBoardManager.getInstance().removeHandler(this);
        }
    }

    @Override
    public void onShutdown() {
    }

    private static int MAXPAGES = 5; // максимальное количество переключателей
    // (для корректного отображения, кнопки
    // динам)
    private static int column = 2; // количество столбцов
    private static int rows = 2; // количество строк
    private static ArrayList<Integer> _id = new ArrayList<>();
    private static TIntIntHashMap _statsId = new TIntIntHashMap();
    private static TIntIntHashMap _skillId = new TIntIntHashMap();
    private static TIntIntHashMap _skillLvl = new TIntIntHashMap();
    private static Map<Integer, String> _type = new HashMap<>();
    private static TIntIntHashMap _itemId = new TIntIntHashMap();
    private static TIntIntHashMap _itemCount = new TIntIntHashMap();
    private static Map<Integer, String> _desc = new HashMap<>();

    private static ArrayList<Integer> _active = new ArrayList<>();
    private static ArrayList<Integer> _passive = new ArrayList<>();
    private static ArrayList<Integer> _chance = new ArrayList<>();
    private static ArrayList<Integer> _jewerly = new ArrayList<>();

    @Override
    public String[] getBypassCommands() {
        return new String[] {
              "_bbsls"
        };
    }

    @Override
    public void onBypassCommand(Player player, String bypass) {
        final String[] commands = bypass.split(" ");
        if (commands.length == 0) {
            _log.info("Wtf");
            return;
        }

        if (commands[0].equals("_bbsls") && commands.length == 1) {
            showLSIndexPage(player);
        } else if (commands[1].equalsIgnoreCase("showskillslist")) {
            final int page = Integer.parseInt(commands[2]);
            showSkillsList(player, page);
        } else if (commands[1].equalsIgnoreCase("selectlsskill")) {
            final int id = Integer.parseInt(commands[2]);
            if (!_id.contains(id)) {
                _log.info("LifeStoneCommunity: invalid id: " + id);
                return;
            }
            player.setSelectCommunitySkillLS(id);
            showLSIndexPage(player);
        } else if (commands[1].equalsIgnoreCase("itemselect")) {
            String content = HtmCache.getInstance()
                    .getNotNull(Config.COMMUNITY_BOARD_PATH + "/pages/augmentation/item_select.htm", player);

            final StringBuilder res = StringUtil.startAppend(400, "<table width=600>");
            for (ItemInstance iteminstance : player.getInventory().getItems()) {
                ItemTemplate item = iteminstance.getTemplate();

                if (checkItemValiable(iteminstance)) {
                    StringUtil.append(res, "<tr>");
                    StringUtil.append(res,
                            "<td width=34 height=34><img src=\"icon." + item.getIcon()
                            + "\" width=32 height=32></td><td width=511>" + item.getName() + " "
                            + item.getAdditionalName() + " "
                            + (iteminstance.getEnchantLevel() == 0 ? ""
                                    : "+" + iteminstance.getEnchantLevel())
                            + "</td><td width=55><button value=\"Выбрать\" action=\"bypass _bbsls itemselected "
                            + iteminstance.getObjectId()
                            + "\" width=50 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
                    StringUtil.append(res, "</tr>");
                }
            }
            StringUtil.append(res, "</table>");
            content = content.replace("%item_select%", res.toString());
            ShowBoard.separateAndSend(content, player);
            StringUtil.recycle(res);
        } else if (commands[1].equalsIgnoreCase("itemselected")) {
            final int weaponObjId = Integer.parseInt(commands[2]);
            ItemInstance iteminstance = player.getInventory().getItemByObjectId(weaponObjId);
            if (iteminstance == null || !checkItemValiable(iteminstance)) {
                _log.info("LifeStoneCommunity: invalid item id: Character objID: " + player.getObjectId());
                return;
            }
            player.setSelectCommunityItemLS(iteminstance);
            showLSIndexPage(player);
        } else if (commands[1].equalsIgnoreCase("filter")) {
            final String filtertype = commands[2];
            if (!filtertype.equalsIgnoreCase("all") && !filtertype.equalsIgnoreCase("active")
                    && !filtertype.equalsIgnoreCase("passive") && !filtertype.equalsIgnoreCase("chance")
                    && !filtertype.equalsIgnoreCase("jewerly")) {
                _log.info("LifeStoneCommunity: invalid filter type: Character objID: " + player.getObjectId()
                        + "; filterType=" + filtertype);
                return;
            }
            player.setCommunityFilterType(filtertype);

            showLSIndexPage(player);
        } else if (commands[1].equalsIgnoreCase("insertlsinitem")) {

            int stat = 0;
            if (commands[2].equalsIgnoreCase("RANDOM")) {
                stat = 0;
            } else if (commands[2].equalsIgnoreCase("STR")) {
                stat = 1;
            } else if (commands[2].equalsIgnoreCase("CON")) {
                stat = 2;
            } else if (commands[2].equalsIgnoreCase("MEN")) {
                stat = 3;
            } else if (commands[2].equalsIgnoreCase("INT")) {
                stat = 4;
            }

            int id = player.getSelectCommunitySkillLS();

            if (id == 0) {
                player.sendMessage("Вы не выбрали скилл");
            } else if (player.getSelectCommunityItemLS() == null) {
                player.sendMessage("Вы не выбрали оружие");
            } else if (!checkItemValiable(player.getSelectCommunityItemLS())) {
                player.sendMessage("Нельзя точить вещи ниже C грейда и рейд бижу");
            } else if (player.getSelectCommunityItemLS().isAugmented()) {
                player.sendMessage("Предмет уже зачарован");
            } else if (!player.getInventory().destroyItemByItemId(_itemId.get(id), _itemCount.get(id))) {
                player.sendMessage("У вас нехватает предметов");
            } else {
                ItemInstance iteminstance = player.getSelectCommunityItemLS();
                ItemTemplate item = iteminstance.getTemplate();
                String localtype = _type.get(id);

                if (item.getType2() == ItemTemplate.TYPE2_WEAPON && (localtype.equalsIgnoreCase("chance")
                        || localtype.equalsIgnoreCase("passive") || localtype.equalsIgnoreCase("active"))) {
                    setAugmentation(iteminstance, id, player, stat);
                } else if (item.getType1() == ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE
                        && localtype.equalsIgnoreCase("jewerly") && !item.isWeapon()) {
                    setAugmentation(iteminstance, id, player, 0);
                } else {
                    player.sendMessage(
                            "Вы не можете вставить скилл бижутерии в оружие, так же вы не можете вставить скилл оружия в бижутерию.");
                }
            }
        }
    }

    private void load() {
        final File localFile = new File("./config/community/community_augmentation.xml");
        if (!localFile.exists()) {
            System.out.println("File community_augmentation.xml not found!");
            return;
        }
        Document localDocument = null;
        try {
            final DocumentBuilderFactory localDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
            localDocumentBuilderFactory.setValidating(false);
            localDocumentBuilderFactory.setIgnoringComments(true);
            localDocument = localDocumentBuilderFactory.newDocumentBuilder().parse(localFile);
        } catch (final Exception e1) {
            e1.printStackTrace();
        }
        try {
            parseFile(localDocument);
        } catch (final Exception e) {
            e.printStackTrace();
        }
    }

    private void parseFile(final Document doc) {
        for (Node il = doc.getFirstChild(); il != null; il = il.getNextSibling()) {
            if ("list".equalsIgnoreCase(il.getNodeName())) {
                for (Node area = il.getFirstChild(); area != null; area = area.getNextSibling()) {
                    if ("aug".equalsIgnoreCase(area.getNodeName())) {
                        int id = XMLUtil.getAttributeIntValue(area, "id", 0);
                        int statsId = XMLUtil.getAttributeIntValue(area, "statsId", 0);
                        int skillId = XMLUtil.getAttributeIntValue(area, "skillId", 0);
                        int skillLvl = XMLUtil.getAttributeIntValue(area, "skillLvl", 0);
                        String type = XMLUtil.getAttributeValue(area, "type");
                        int itemId = XMLUtil.getAttributeIntValue(area, "itemId", 0);
                        int itemCount = XMLUtil.getAttributeIntValue(area, "itemCount", 0);
                        String desc = XMLUtil.getAttributeValue(area, "desc");

                        _id.add(id);
                        _statsId.put(id, statsId);
                        _skillId.put(id, skillId);
                        _skillLvl.put(id, skillLvl);
                        _type.put(id, type);
                        _itemId.put(id, itemId);
                        _itemCount.put(id, itemCount);
                        _desc.put(id, desc);

                        if (type.equalsIgnoreCase("active")) {
                            _active.add(id);
                        } else if (type.equalsIgnoreCase("passive")) {
                            _passive.add(id);
                        } else if (type.equalsIgnoreCase("chance")) {
                            _chance.add(id);
                        } else if (type.equalsIgnoreCase("jewerly")) {
                            _jewerly.add(id);
                        }

                        if (SkillTable.getInstance().getBaseLevel(skillId) < skillLvl) {
                            _log.info("Community Augmenation: skillId: " + skillId + " maxlevel = "
                                    + SkillTable.getInstance().getBaseLevel(skillId) + " current = " + skillLvl);
                        }
                    }

                }
            }
        }
    }

    private boolean checkItemValiable(ItemInstance im) {
        ItemTemplate item = im.getTemplate();
        boolean ok = false;
        if ((item.getType1() == ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE
                || item.getType2() == ItemTemplate.TYPE2_WEAPON) && !im.isAugmented()
                && im.getTemplate().isAugmentable() && !im.getTemplate().isTerritoryAccessory()) {
            Grade grade = item.getItemGrade();
            if ((grade != Grade.NONE) && (grade != Grade.D)) {
                int id = item.getItemId();
                if (id >= 6611 && id <= 6621) {
                    ok = false;
                }
                // Hero weapon's
                if (id != 6659 && id != 6656 && id != 6657 && id != 8191 && id != 6658 && id != 6662 && id != 6661
                        && id != 6660 || id >= 14801 && id <= 14809 || id >= 14664 && id <= 14672) {
                    ok = true;
                }
            }
        }
        return ok;
    }

    private void setAugmentation(ItemInstance iteminstance, int id, Player player, int stat) {
        int stat34 = _statsId.get(id);

        int offset = 9 * 91 + Rnd.get(0, 1) * 3640 + (3 + 3) / 2 * 10 * 91 + 1;

        int stat12 = Rnd.get(offset, offset + 91 - 1);
        switch (stat) {
            case 1:
                stat12 = 16341;
                break;
            case 2:
                stat12 = 16342;
                break;
            case 3:
                stat12 = 16344;
                break;
            case 4:
                stat12 = 16343;
                break;

        }
        if (iteminstance.isEquipped()) {
            player.getInventory().unEquipItem(iteminstance);
        }
        iteminstance.setAugmentationId((stat34 << 16) + stat12);

        player.sendPacket(new InventoryUpdate().addModifiedItem(iteminstance));
        player.setSelectCommunitySkillLS(0);
        player.setSelectCommunityItemLS(null);
        player.sendChanges();
        player.sendMessage("Поздравляем с покупкой LS!");
        showLSIndexPage(player);
    }

    private void showSkillsList(Player player, int page) {
        int numpages = 0;

        if (player.getCommunityFilterType().equalsIgnoreCase("all")) {
            numpages = getNumPages(_id.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("active")) {
            numpages = getNumPages(_active.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("passive")) {
            numpages = getNumPages(_passive.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("chance")) {
            numpages = getNumPages(_chance.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("jewerly")) {
            numpages = getNumPages(_jewerly.size());
        }

        final StringBuilder html = StringUtil.startAppend(600, buildTable(page, player));

        String content = HtmCache.getInstance().getNotNull(Config.COMMUNITY_BOARD_PATH + "/pages/augmentation/ls.htm",
                player);

        final ItemInstance iteminstance = player.getSelectCommunityItemLS();

        if (player.getSelectCommunitySkillLS() == 0) {
            content = content.replace("%ls_icon%", "<img src=\"icon.skill3808\" width=32 height=32>");
            content = content.replace("%ls_name%", "");
            content = content.replace("%ls_type%", "");
            content = content.replace("%ls_level%", "");
            content = content.replace("%ls_price%", "");
            content = content.replace("%ls_price_name%", "");
            content = content.replace("%item_select%",
                    (iteminstance == null ? ""
                            : "<img src=\"icon." + iteminstance.getTemplate().getIcon()
                            + "\" width=32 height=32> &nbsp;&nbsp;" + iteminstance.getTemplate().getName() + " "
                            + iteminstance.getTemplate().getAdditionalName() + " "
                            + (iteminstance.getEnchantLevel() == 0 ? ""
                                    : "+" + iteminstance.getEnchantLevel())));
            content = content.replace("%desc%", "");
            content = content.replace("%pagelist%", page_list(numpages, page, "showskillslist"));
            content = content.replace("%skilllist%", html.toString());
        } else {
            final int charId = player.getSelectCommunitySkillLS();
            final int skill_id = _skillId.get(charId);
            final int skill_level = _skillLvl.get(charId);
            Skill skill = SkillTable.getInstance().getInfo(skill_id, skill_level);
            if (skill == null) {
                _log.info("CommunityAugmentation: - skill[" + skill_id + "] is NULL! Character objID: "
                        + player.getObjectId());
                return;
            }

            content = content.replace("%ls_icon%", "<img src=\"icon." + skill.getIcon() + "\" width=32 height=32>");
            content = content.replace("%ls_name%", skill.getName());
            content = content.replace("%ls_type%", _type.get(charId));
            content = content.replace("%ls_level%", "" + skill.getLevel());
            content = content.replace("%ls_price%", "" + _itemCount.get(charId));
            content = content.replace("%ls_price_name%", "" + HtmlUtils.htmlItemName(_itemId.get(charId)));
            content = content.replace("%item_select%",
                    (iteminstance == null ? ""
                            : "<img src=\"icon." + iteminstance.getTemplate().getIcon()
                            + "\" width=32 height=32> &nbsp;&nbsp;" + iteminstance.getTemplate().getName() + " "
                            + iteminstance.getTemplate().getAdditionalName() + " "
                            + (iteminstance.getEnchantLevel() == 0 ? ""
                                    : "+" + iteminstance.getEnchantLevel())));
            content = content.replace("%desc%", _desc.get(charId));
            content = content.replace("%pagelist%", page_list(numpages, page, "showskillslist"));
            content = content.replace("%skilllist%", html.toString());
        }

        ShowBoard.separateAndSend(content, player);
        StringUtil.recycle(html);
    }

    private String buildTable(final int page, Player player) {
        Skill skill;
        final StringBuilder res = StringUtil.startAppend(400, "<table width=600>");
        String userFilter = player.getCommunityFilterType();

        int c = 0;

        if (userFilter.equalsIgnoreCase("all") || userFilter.equalsIgnoreCase("active")) {
            if (page == 1) {
                c = 1;
            } else {
                c = (((page - 1) * column * rows) + 1);
            }
        } else if (userFilter.equalsIgnoreCase("passive")) {
            if (page == 1) {
                c = _passive.get(0);
            } else {
                c = (((page - 1) * column * rows) + _passive.get(0));
            }
        } else if (userFilter.equalsIgnoreCase("chance")) {
            if (page == 1) {
                c = _chance.get(0);
            } else {
                c = (((page - 1) * column * rows) + _chance.get(0));
            }
        } else if (userFilter.equalsIgnoreCase("jewerly")) {
            if (page == 1) {
                c = _jewerly.get(0);
            } else {
                c = (((page - 1) * column * rows) + _jewerly.get(0));
            }
        }

        for (int i = 0; i < rows; i++) {
            StringUtil.append(res, "<tr>");
            for (int j = 0; j < column; j++) {
                if (_id.size() >= c) {
                    final int skill_id = _skillId.get(c);
                    final int skill_level = _skillLvl.get(c);
                    final String type_ls = _type.get(c);

                    skill = SkillTable.getInstance().getInfo(skill_id, skill_level);
                    if (skill == null) {
                        _log.warn("Community Augmentation: buildTable - skill[" + skill_id + "] is NULL!");
                        c++;
                        continue;
                    }

                    if (userFilter.equalsIgnoreCase("all") || userFilter.equalsIgnoreCase(type_ls)) {
                        StringUtil.append(res, "<td width=55><center><img src=\"icon." + skill.getIcon()
                                + "\" width=32 height=32><br><button value=\"Выбрать\" action=\"bypass _bbsls selectlsskill "
                                + c
                                + "\" width=55 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></center></td>");
                        StringUtil.append(res, "<td width=245>Название: " + skill.getName() + "<br> Тип: "
                                + _type.get(c) + "<br> Уровень: " + skill.getLevel() + "<br></td>");
                    }
                } else {
                    StringUtil.append(res, "<td width=150><center></center></td>");
                }
                c++;
            }
            StringUtil.append(res, "</tr>");
        }

        StringUtil.append(res, "</table><br>");
        return res.toString();
    }

    private void showLSIndexPage(Player player) {
        int numpages = 0;

        if (player.getCommunityFilterType().equalsIgnoreCase("all")) {
            numpages = getNumPages(_id.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("active")) {
            numpages = getNumPages(_active.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("passive")) {
            numpages = getNumPages(_passive.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("chance")) {
            numpages = getNumPages(_chance.size());
        } else if (player.getCommunityFilterType().equalsIgnoreCase("jewerly")) {
            numpages = getNumPages(_jewerly.size());
        }

        String content = HtmCache.getInstance().getNotNull(Config.COMMUNITY_BOARD_PATH + "/pages/augmentation/ls.htm",
                player);

        final ItemInstance iteminstance = player.getSelectCommunityItemLS();

        if (player.getSelectCommunitySkillLS() == 0) {
            content = content.replace("%ls_icon%", "<img src=\"icon.skill3808\" width=32 height=32>");
            content = content.replace("%ls_name%", "");
            content = content.replace("%ls_type%", "");
            content = content.replace("%ls_level%", "");
            content = content.replace("%ls_price_name%", "");
            content = content.replace("%item_select%",
                    (iteminstance == null ? ""
                            : "<img src=\"icon." + iteminstance.getTemplate().getIcon()
                            + "\" width=32 height=32> &nbsp;&nbsp;" + iteminstance.getTemplate().getName() + " "
                            + iteminstance.getTemplate().getAdditionalName() + " "
                            + (iteminstance.getEnchantLevel() == 0 ? ""
                                    : "+" + iteminstance.getEnchantLevel())));
            content = content.replace("%desc%", "");
            content = content.replace("%pagelist%", page_list(numpages, 1, "showskillslist"));
            content = content.replace("%skilllist%", buildTable(1, player));
        } else {
            final int charId = player.getSelectCommunitySkillLS();
            final int skill_id = _skillId.get(charId);
            final int skill_level = _skillLvl.get(charId);
            Skill skill = SkillTable.getInstance().getInfo(skill_id, skill_level);
            if (skill == null) {
                _log.warn("CommunityAugmentation: - skill[" + skill_id + "] is NULL! Character objID: "
                        + player.getObjectId());
                return;
            }

            content = content.replace("%ls_icon%", "<img src=\"icon." + skill.getIcon() + "\" width=32 height=32>");
            content = content.replace("%ls_name%", skill.getName());
            content = content.replace("%ls_type%", _type.get(charId));
            content = content.replace("%ls_level%", "" + skill.getLevel());
            content = content.replace("%ls_price%", "" + _itemCount.get(charId));
            content = content.replace("%ls_price_name%", "" + HtmlUtils.htmlItemName(_itemId.get(charId)));
            content = content.replace("%item_select%",
                    (iteminstance == null ? ""
                            : "<img src=\"icon." + iteminstance.getTemplate().getIcon()
                            + "\" width=32 height=32> &nbsp;&nbsp;" + iteminstance.getTemplate().getName() + " "
                            + iteminstance.getTemplate().getAdditionalName() + " "
                            + (iteminstance.getEnchantLevel() == 0 ? ""
                                    : "+" + iteminstance.getEnchantLevel())));
            content = content.replace("%desc%", _desc.get(charId));
            content = content.replace("%pagelist%", page_list(numpages, 1, "showskillslist"));
            content = content.replace("%skilllist%", buildTable(1, player));
        }

        ShowBoard.separateAndSend(content, player);
    }

    private String page_list(final double numpages, final int cur_page, final String bypass) {
        if (numpages == 1) {
            return null;
        }

        final StringBuilder navpage = StringUtil.startAppend(200, "");

        if (numpages <= MAXPAGES || cur_page < MAXPAGES) {
            for (int page = 1; page <= MAXPAGES; page++) {
                if (page == cur_page) {
                    StringUtil.append(navpage, "<td align=center width=25>", page, "</td>");
                } else {
                    StringUtil.append(navpage, "<td align=rigt width=25><button value=\"", page,
                            "\" action=\"bypass _bbsls ", bypass, " ", page,
                            "\" width=25 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
                }
            }
        } else if (cur_page >= MAXPAGES) {
            for (int page = (cur_page - ((MAXPAGES + 1) / 2)); page <= cur_page + 1; page++) {
                if (page <= numpages) {
                    if (page == cur_page) {
                        StringUtil.append(navpage, "<td align=center width=25>", page, "</td>");
                    } else {
                        StringUtil.append(navpage, "<td align=rigt width=25><button value=\"", page,
                                "\" action=\"bypass _bbsls ", bypass, " ", page,
                                "\" width=25 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
                    }
                }
            }
        }

        return navpage.toString();
    }

    private static int getNumPages(final int size) {
        return (int) Math.ceil((double) size / (column * rows));
    }

    @Override
    public void onWriteCommand(Player player, String bypass, String arg1, String arg2, String arg3, String arg4,
            String arg5) {
    }
}
 
Последнее редактирование модератором:
В конфигах включен сервис?
Напишите в пм мне.

Я думаю у вас в файле ls.html такой код:

HTML:
<center>
    <table width=700 cellpadding="3">
        <tr>
            <td align="center">
                <table width=700>
                    <tr>
                        <td width=36 height=22><center>%ls_icon%</center></td>
                        <td width=232 height=22>Название: %ls_name%</td>
                        <td width=232 height=22></td>
                        <td width=100 height=22></td>
                    </tr>
                    <tr>
                        <td width=36 height=22><center></center></td>
                        <td width=232 height=22>Тип: %ls_type%</td>
                        <td width=232 height=22>Цена: %ls_price% <font color="LEVEL">%ls_price_name%</font></td>
                        <td width=100 height=22></td>
                    </tr>
                    <tr>
                       <td width=36 height=22><center></center></td>
                       <td width=232 height=22>Уровень: %ls_level%
                       <table>
                         <tr>
                          <td width="40">+1 к:</td>
                          <td><combobox width=100 var="lock_type" list="RANDOM;STR;CON;MEN;INT"><br></td>
                         </tr></table></td>
                        <td width=232 height=22><table><tr><td width="65">Предмет:</td> <td align="center" width="150">%item_select%</td></tr></table></td>
                        <td width=100 height=22><button value="Выбрать" action="bypass _bbsls itemselect" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                    </tr>
                    <tr>
                        <td width=36 height=22><center></center></td>
                        <td width=232 height=22><button value="Вставить" action="bypass _bbsls insertlsinitem $lock_type" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=232 height=22></td>
                        <td width=100 height=22></td>
                    </tr>
                </table>
                <table width=700>
                    <tr>
                        <td width=75>Описание:</td>
                        <td width=500>%desc%</td>
                    </tr>
                </table>
                <br>

                <img src="L2UI.SquareWhite" width=600 height=1>
                <table width=700>
                    <tr>
                        <td width=60>Фильтры:</td>
                        <td width=30><button value="Все" action="bypass _bbsls filter all" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=40><button value="Актив" action="bypass _bbsls filter active" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=44><button value="Пассив" action="bypass _bbsls filter passive" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=42><button value="Шанс" action="bypass _bbsls filter chance" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=42><button value="Бижа" action="bypass _bbsls filter jewerly" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=120> </td>
                        <td align=right>Страницы:</td>
                        %pagelist%
                    </tr>
                </table>
                <img src="L2UI.SquareWhite" width=600 height=1>

                %skilllist%

                <img src="L2UI.SquareWhite" width=600 height=1>
            </td>
        </tr>
    </table>
</center>

Надо просто добавить:
HTML:
<html noscrollbar>
<!--Заголовок окна-->
<title>Community Board</title>
<body>
.... сюда строчки вашего кода
</body></html>

Предполагаю что это поможет. :unsure:
 
  • Мне нравится
Реакции: Umad
В конфигах включен сервис?
Напишите в пм мне.

Я думаю у вас в файле ls.html такой код:

HTML:
<center>
    <table width=700 cellpadding="3">
        <tr>
            <td align="center">
                <table width=700>
                    <tr>
                        <td width=36 height=22><center>%ls_icon%</center></td>
                        <td width=232 height=22>Название: %ls_name%</td>
                        <td width=232 height=22></td>
                        <td width=100 height=22></td>
                    </tr>
                    <tr>
                        <td width=36 height=22><center></center></td>
                        <td width=232 height=22>Тип: %ls_type%</td>
                        <td width=232 height=22>Цена: %ls_price% <font color="LEVEL">%ls_price_name%</font></td>
                        <td width=100 height=22></td>
                    </tr>
                    <tr>
                       <td width=36 height=22><center></center></td>
                       <td width=232 height=22>Уровень: %ls_level%
                       <table>
                         <tr>
                          <td width="40">+1 к:</td>
                          <td><combobox width=100 var="lock_type" list="RANDOM;STR;CON;MEN;INT"><br></td>
                         </tr></table></td>
                        <td width=232 height=22><table><tr><td width="65">Предмет:</td> <td align="center" width="150">%item_select%</td></tr></table></td>
                        <td width=100 height=22><button value="Выбрать" action="bypass _bbsls itemselect" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                    </tr>
                    <tr>
                        <td width=36 height=22><center></center></td>
                        <td width=232 height=22><button value="Вставить" action="bypass _bbsls insertlsinitem $lock_type" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=232 height=22></td>
                        <td width=100 height=22></td>
                    </tr>
                </table>
                <table width=700>
                    <tr>
                        <td width=75>Описание:</td>
                        <td width=500>%desc%</td>
                    </tr>
                </table>
                <br>

                <img src="L2UI.SquareWhite" width=600 height=1>
                <table width=700>
                    <tr>
                        <td width=60>Фильтры:</td>
                        <td width=30><button value="Все" action="bypass _bbsls filter all" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=40><button value="Актив" action="bypass _bbsls filter active" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=44><button value="Пассив" action="bypass _bbsls filter passive" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=42><button value="Шанс" action="bypass _bbsls filter chance" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=42><button value="Бижа" action="bypass _bbsls filter jewerly" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=120> </td>
                        <td align=right>Страницы:</td>
                        %pagelist%
                    </tr>
                </table>
                <img src="L2UI.SquareWhite" width=600 height=1>

                %skilllist%

                <img src="L2UI.SquareWhite" width=600 height=1>
            </td>
        </tr>
    </table>
</center>

Надо просто добавить:
HTML:
<html noscrollbar>
<!--Заголовок окна-->
<title>Community Board</title>
<body>
.... сюда строчки вашего кода
</body></html>

Предполагаю что это поможет. :unsure:
Да сервис включен, попробую отпишу)
 
В конфигах включен сервис?
Напишите в пм мне.

Я думаю у вас в файле ls.html такой код:

HTML:
<center>
    <table width=700 cellpadding="3">
        <tr>
            <td align="center">
                <table width=700>
                    <tr>
                        <td width=36 height=22><center>%ls_icon%</center></td>
                        <td width=232 height=22>Название: %ls_name%</td>
                        <td width=232 height=22></td>
                        <td width=100 height=22></td>
                    </tr>
                    <tr>
                        <td width=36 height=22><center></center></td>
                        <td width=232 height=22>Тип: %ls_type%</td>
                        <td width=232 height=22>Цена: %ls_price% <font color="LEVEL">%ls_price_name%</font></td>
                        <td width=100 height=22></td>
                    </tr>
                    <tr>
                       <td width=36 height=22><center></center></td>
                       <td width=232 height=22>Уровень: %ls_level%
                       <table>
                         <tr>
                          <td width="40">+1 к:</td>
                          <td><combobox width=100 var="lock_type" list="RANDOM;STR;CON;MEN;INT"><br></td>
                         </tr></table></td>
                        <td width=232 height=22><table><tr><td width="65">Предмет:</td> <td align="center" width="150">%item_select%</td></tr></table></td>
                        <td width=100 height=22><button value="Выбрать" action="bypass _bbsls itemselect" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                    </tr>
                    <tr>
                        <td width=36 height=22><center></center></td>
                        <td width=232 height=22><button value="Вставить" action="bypass _bbsls insertlsinitem $lock_type" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=232 height=22></td>
                        <td width=100 height=22></td>
                    </tr>
                </table>
                <table width=700>
                    <tr>
                        <td width=75>Описание:</td>
                        <td width=500>%desc%</td>
                    </tr>
                </table>
                <br>

                <img src="L2UI.SquareWhite" width=600 height=1>
                <table width=700>
                    <tr>
                        <td width=60>Фильтры:</td>
                        <td width=30><button value="Все" action="bypass _bbsls filter all" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=40><button value="Актив" action="bypass _bbsls filter active" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=44><button value="Пассив" action="bypass _bbsls filter passive" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=42><button value="Шанс" action="bypass _bbsls filter chance" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=42><button value="Бижа" action="bypass _bbsls filter jewerly" width=52 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
                        <td width=120> </td>
                        <td align=right>Страницы:</td>
                        %pagelist%
                    </tr>
                </table>
                <img src="L2UI.SquareWhite" width=600 height=1>

                %skilllist%

                <img src="L2UI.SquareWhite" width=600 height=1>
            </td>
        </tr>
    </table>
</center>

Надо просто добавить:
HTML:
<html noscrollbar>
<!--Заголовок окна-->
<title>Community Board</title>
<body>
.... сюда строчки вашего кода
</body></html>

Предполагаю что это поможет. :unsure:
Большое тебе спасибо, твой вариант помог, все работает

Надо быть чуток вниматочнее
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху Снизу