Sell price checks.

This commit is contained in:
MobiusDevelopment
2021-03-06 09:19:30 +00:00
parent a5266432c5
commit e867feb170
107 changed files with 458 additions and 147 deletions

View File

@@ -278,6 +278,10 @@ RaidMinionRespawnTime = 300000
# Default: 50
ClickTaskDelay = 50
# Correct buylist prices when lower than sell price.
# Default: True
CorrectPrices = True
# ---------------------------------------------------------------------------
# Pets

View File

@@ -216,6 +216,7 @@ public class Config
public static int WYVERN_SPEED;
public static int STRIDER_SPEED;
public static boolean ALLOW_WYVERN_UPGRADER;
public static boolean CORRECT_PRICES;
public static String NONDROPPABLE_ITEMS;
public static List<Integer> LIST_NONDROPPABLE_ITEMS = new ArrayList<>();
public static String PET_RENT_NPC;
@@ -1404,6 +1405,7 @@ public class Config
WYVERN_SPEED = generalConfig.getInt("WyvernSpeed", 100);
STRIDER_SPEED = generalConfig.getInt("StriderSpeed", 80);
ALLOW_WYVERN_UPGRADER = generalConfig.getBoolean("AllowWyvernUpgrader", false);
CORRECT_PRICES = generalConfig.getBoolean("CorrectPrices", true);
ENABLE_AIO_SYSTEM = generalConfig.getBoolean("EnableAioSystem", true);
ALLOW_AIO_NCOLOR = generalConfig.getBoolean("AllowAioNameColor", true);
AIO_NCOLOR = Integer.decode("0x" + generalConfig.getString("AioNameColor", "88AA88"));

View File

@@ -84,10 +84,11 @@ public class TradeController
limitedItem = true;
}
if (!rset1.getString("npc_id").equals("gm") && (price < (item.getReferencePrice() / 2)))
final int sellPrice = item.getReferencePrice() / 2;
if (Config.CORRECT_PRICES && (price < sellPrice) && !rset1.getString("npc_id").equals("gm"))
{
LOGGER.warning("TradeList " + buy1.getListId() + " itemId " + itemId + " has an ADENA sell price lower then reference price.. Automatically Updating it..");
price = item.getReferencePrice();
LOGGER.warning("Buy price " + price + " is less than sell price " + sellPrice + " for ItemID:" + itemId + " of buylist " + buy1.getListId() + ".");
price = sellPrice;
}
item.setPriceToSell(price);