L2JMobius

C6 Custom tradelist with lower price not updating

G-hamsteR · 2 · 6352

Online G-hamsteR

  • Viscount
  • *****
    • Posts: 338
I have a few buylists with 0 arena and I am getting this message:

Code: [Select]
TradeList XXX itemId  XXX has an ADENA sell price lower then reference price.. Automatically Updating it.
I thought that it autoupdates, but it only edits the merchant_buylists and not the custom_merchant_buylists.

Here is a fix:

gameserver/handler/admincommandhandlers/AdminEditNpc.java, line 735:

Replace this:
Code: [Select]
final PreparedStatement stmt = con.prepareStatement("UPDATE merchant_buylists SET `price`='" + price + "' WHERE `shop_id`='" + tradeListID + "' AND `order`='" + order + "'");
stmt.execute();
stmt.close();

With this:

Code: [Select]
PreparedStatement stmt;
stmt = con.prepareStatement("UPDATE merchant_buylists SET `price`='" + price + "' WHERE `shop_id`='" + tradeListID + "' AND `order`='" + order + "'");
stmt.execute();
stmt.close();
stmt = con.prepareStatement("UPDATE custom_merchant_buylists SET `price`='" + price + "' WHERE `shop_id`='" + tradeListID + "' AND `order`='" + order + "'");
stmt.execute();
stmt.close();

Also, if you want to insert new buylists in the custom_merchant_buylists table, just modify line 721 to this:
Code: [Select]
final PreparedStatement stmt = con.prepareStatement("INSERT INTO custom_merchant_buylists (`item_id`,`price`,`shop_id`,`order`) values (" + itemId + "," + price + "," + tradeListID + "," + order + ")");


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 338
Sorry for not checking before posting, but it was the only update on the merchant_buylist and I thought that it was correct.

This doesn't fix the problem.