private void editShopItem(L2PcInstance activeChar, String[] args)
{
int tradeListID = Integer.parseInt(args[1]);
int itemID = Integer.parseInt(args[2]);
L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);
L2Item item = ItemTable.getInstance().getTemplate(itemID);
if (tradeList.getPriceForItemId(itemID) < 0)
{
return;
}
if (args.length > 3)
{
int price = Integer.parseInt(args[3]);
int order = findOrderTradeList(itemID, tradeList.getPriceForItemId(itemID), tradeListID);
tradeList.replaceItem(itemID, Integer.parseInt(args[3]));
updateTradeList(itemID, price, tradeListID, order);
activeChar.sendMessage("Updated price for "+item.getName()+" in Trade List "+tradeListID);
showShopList(activeChar, tradeListID, 1);
return;
}
NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
TextBuilder replyMSG = new TextBuilder();
replyMSG.append("<html><title>Merchant Shop Item Edit</title>");
replyMSG.append("<body>");
replyMSG.append("<br>Edit an entry in merchantList.");
replyMSG.append("<br>Editing Item: "+item.getName());
replyMSG.append("<table>");
replyMSG.append("<tr><td width=100>Property</td><td width=100>Edit Field</td><td width=100>Old Value</td></tr>");
replyMSG.append("<tr><td><br></td><td></td></tr>");
replyMSG.append("<tr><td>Price</td><td><edit var=\"price\" width=80></td><td>"+tradeList.getPriceForItemId(itemID)+"</td></tr>");
replyMSG.append("</table>");
replyMSG.append("<center><br><br><br>");
replyMSG.append("<button value=\"Save\" action=\"bypass -h admin_editShopItem " + tradeListID + " " + itemID + " $price\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
replyMSG.append("<br><button value=\"Back\" action=\"bypass -h admin_showShopList " + tradeListID +" 1\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
replyMSG.append("</center>");