rendered paste body StringBuffer listHtml = new StringBuffer("<html><body>" + "<font color=\"LEVEL\">[ Purchase Consumable Items ]</font><br>" + "Here is a selection of items that only those who are victorious can purchase!<br>"); // Show 10 items per "page", as showing all of them will crash the client! :) int totalItems = SevenSigns.priestItems.length; int indexStart = (val - 12) * 10; int indexEnd = (((val - 11) * 10) > totalItems) ? totalItems : ((val - 11) * 10); int totalPages = (totalItems / 10) + 1; String path = SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_12.htm"; String originalTemp = HtmCache.getInstance().getHtm(path); if (originalTemp != null) { for (int i = indexStart; i < indexEnd; i++) { L2ItemInstance tempItem = ItemTable.getInstance().createDummyItem(Integer.parseInt(SevenSigns.priestItems[i][0])); String itemName = tempItem.getItem().getName(); String itemDispName = itemName.replaceAll("_"," "); itemDispName = SevenSigns.capitalizeWords(itemDispName); String content = originalTemp; content = content.replaceAll("%itemIconName%", SevenSigns.priestItems[i][3]); content = content.replaceAll("%itemName%", itemDispName); content = content.replaceAll("%itemId%", SevenSigns.priestItems[i][0]); content = content.replaceAll("%ancientAdenaCost%", SevenSigns.priestItems[i][1]); content = content.replaceAll("%adenaCost%", SevenSigns.priestItems[i][2]); content = content.replaceAll("%objectId%", String.valueOf(getObjectId())); listHtml.append(content); } } else { _log.warning("Problem with HTML text " + SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_12.htm: " + path); } listHtml.append("<br><table border=\"0\" width=\"230\"><tr><td width=\"19\"> " + "<img src=\"icon.etc_ancient_adena_i00\" width=\"16\" height=\"16\" align=\"left\"></td>" + "<td width=\"211\">" + ancientAdenaAmount + "</td></tr></table>" + "<center>"); if ((val - 11) < totalPages) listHtml.append("<button value=\"Next Page\" action=\"bypass -h npc_" + String.valueOf(getObjectId()) + "_SevenSigns " + (val + 1) + "\" width=\"60\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"); if (val > 12) listHtml.append("<button value=\"Prev Page\" action=\"bypass -h npc_" + String.valueOf(getObjectId()) + "_SevenSigns " + (val - 1) + "\" width=\"60\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"); listHtml.append("<br><button value=\"Return\" action=\"bypass -h npc_" + getObjectId() + "_Chat 0\" width=\"60\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\">" + "</center><br><br></body></html>"); NpcHtmlMessage itemList = new NpcHtmlMessage(1); itemList.setHtml(listHtml.toString()); player.sendPacket(itemList);