Реализовал функцию продажи за 0 аден, возможно при наличии исходников.
Откройте config/rus_acis.properties и добавьте:
# Продажа предметов за 0 аден (true/false)
EnableFreeSell = True
В файле RequestSellItem.java сделайте изменения:
// В методе sellBbs() замените:
int price = item.getReferencePrice() / 2;
totalPrice += price * i.getValue();
// На:
int price = Config.ENABLE_FREE_SELL ? 0 : item.getReferencePrice() / 2;
totalPrice += Config.ENABLE_FREE_SELL ? 0 : price * i.getValue();
// В методе runImpl() (продажа NPC) замените:
int price = item.getReferencePrice() / 2;
totalPrice += price * i.getValue();
// На:
int price = Config.ENABLE_FREE_SELL ? 0 : item.getReferencePrice() / 2;
totalPrice += Config.ENABLE_FREE_SELL ? 0 : price * i.getValue();
/** SellPrice 0 aden */
public static boolean ENABLE_FREE_SELL;
// ... в методе loadRusAcis() ...
private static final void loadRusAcis()
{
final ExProperties rusacis = initProperties(RUS_ACIS_FILE);
INFINITY_SS = rusacis.getProperty("InfinitySS", false);
INFINITY_ARROWS = rusacis.getProperty("InfinityArrows", false);
// ДОБАВЬТЕ ЭТУ СТРОКУ:
ENABLE_FREE_SELL = rusacis.getProperty("EnableFreeSell", false);
import net.sf.l2j.Config; // ДОБАВЬТЕ ЭТОТ ИМПОРТ
В методе writeImpl() найдите строку:
java
writeD(item.getItem().getReferencePrice() / 2);
И замените на:
java
writeD(Config.ENABLE_FREE_SELL ? 0 : item.getItem().getReferencePrice() / 2);
Откройте config/rus_acis.properties и добавьте:
# Продажа предметов за 0 аден (true/false)
EnableFreeSell = True
В файле RequestSellItem.java сделайте изменения:
// В методе sellBbs() замените:
int price = item.getReferencePrice() / 2;
totalPrice += price * i.getValue();
// На:
int price = Config.ENABLE_FREE_SELL ? 0 : item.getReferencePrice() / 2;
totalPrice += Config.ENABLE_FREE_SELL ? 0 : price * i.getValue();
// В методе runImpl() (продажа NPC) замените:
int price = item.getReferencePrice() / 2;
totalPrice += price * i.getValue();
// На:
int price = Config.ENABLE_FREE_SELL ? 0 : item.getReferencePrice() / 2;
totalPrice += Config.ENABLE_FREE_SELL ? 0 : price * i.getValue();
В Config.java:
/** SellPrice 0 aden */
public static boolean ENABLE_FREE_SELL;
// ... в методе loadRusAcis() ...
private static final void loadRusAcis()
{
final ExProperties rusacis = initProperties(RUS_ACIS_FILE);
INFINITY_SS = rusacis.getProperty("InfinitySS", false);
INFINITY_ARROWS = rusacis.getProperty("InfinityArrows", false);
// ДОБАВЬТЕ ЭТУ СТРОКУ:
ENABLE_FREE_SELL = rusacis.getProperty("EnableFreeSell", false);
Изменения в SellList.java:
import net.sf.l2j.Config; // ДОБАВЬТЕ ЭТОТ ИМПОРТ
В методе writeImpl() найдите строку:
java
writeD(item.getItem().getReferencePrice() / 2);
И замените на:
java
writeD(Config.ENABLE_FREE_SELL ? 0 : item.getItem().getReferencePrice() / 2);