Sell price checks.
This commit is contained in:
@@ -288,6 +288,10 @@ GridNeighborTurnOnTime = 1
|
||||
# Default: 90
|
||||
GridNeighborTurnOffTime = 90
|
||||
|
||||
# Correct buylist and multisell prices when lower than sell price.
|
||||
# Default: True
|
||||
CorrectPrices = True
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Falling Damage
|
||||
|
@@ -473,6 +473,7 @@ public class Config
|
||||
public static int MAX_NPC_ANIMATION;
|
||||
public static int MIN_MONSTER_ANIMATION;
|
||||
public static int MAX_MONSTER_ANIMATION;
|
||||
public static boolean CORRECT_PRICES;
|
||||
public static boolean ENABLE_FALLING_DAMAGE;
|
||||
public static boolean GRIDS_ALWAYS_ON;
|
||||
public static int GRID_NEIGHBOR_TURNON_TIME;
|
||||
@@ -2055,6 +2056,7 @@ public class Config
|
||||
GRIDS_ALWAYS_ON = General.getBoolean("GridsAlwaysOn", false);
|
||||
GRID_NEIGHBOR_TURNON_TIME = General.getInt("GridNeighborTurnOnTime", 1);
|
||||
GRID_NEIGHBOR_TURNOFF_TIME = General.getInt("GridNeighborTurnOffTime", 90);
|
||||
CORRECT_PRICES = General.getBoolean("CorrectPrices", true);
|
||||
PEACE_ZONE_MODE = General.getInt("PeaceZoneMode", 0);
|
||||
DEFAULT_GLOBAL_CHAT = General.getString("GlobalChat", "ON");
|
||||
DEFAULT_TRADE_CHAT = General.getString("TradeChat", "ON");
|
||||
|
@@ -126,7 +126,16 @@ public class BuyListData implements IXmlReader
|
||||
final long restockDelay = parseLong(attrs, "restock_delay", -1L);
|
||||
final long count = parseLong(attrs, "count", -1L);
|
||||
final int baseTax = parseInteger(attrs, "baseTax", defaultBaseTax);
|
||||
buyList.addProduct(new Product(buyListId, item, price, restockDelay, count, baseTax));
|
||||
final long sellPrice = item.getReferencePrice() / 2;
|
||||
if (Config.CORRECT_PRICES && (price > -1) && (sellPrice > price) && (buyList.getNpcsAllowed() != null))
|
||||
{
|
||||
LOGGER.warning("Buy price " + price + " is less than sell price " + sellPrice + " for ItemID:" + itemId + " of buylist " + buyList.getListId() + ".");
|
||||
buyList.addProduct(new Product(buyListId, item, sellPrice, restockDelay, count, baseTax));
|
||||
}
|
||||
else
|
||||
{
|
||||
buyList.addProduct(new Product(buyListId, item, price, restockDelay, count, baseTax));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -167,7 +167,7 @@ public class MultisellData implements IXmlReader
|
||||
final Item item = ItemTable.getInstance().getTemplate(id);
|
||||
if (item != null)
|
||||
{
|
||||
totalPrice += (item.getReferencePrice() * count);
|
||||
totalPrice += ((item.getReferencePrice() / 2) * count);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -186,7 +186,7 @@ public class MultisellData implements IXmlReader
|
||||
|
||||
// Check if buy price is lower than sell price.
|
||||
// Only applies when there is only one ingredient and it is adena.
|
||||
if ((ingredients.size() == 1) && (lastIngredientId == 57) && (lastIngredientCount < totalPrice))
|
||||
if (Config.CORRECT_PRICES && (ingredients.size() == 1) && (lastIngredientId == 57) && (lastIngredientCount < totalPrice))
|
||||
{
|
||||
LOGGER.warning("Buy price " + lastIngredientCount + " is less than sell price " + totalPrice + " at entry " + entryCounter.intValue() + " of multisell " + listId + ".");
|
||||
// Adjust price.
|
||||
|
@@ -70,8 +70,8 @@ public class ProductList
|
||||
return (_allowedNpcs != null) && _allowedNpcs.contains(npcId);
|
||||
}
|
||||
|
||||
// public Set<Integer> getNpcsAllowed()
|
||||
// {
|
||||
// return _allowedNpcs;
|
||||
// }
|
||||
public Set<Integer> getNpcsAllowed()
|
||||
{
|
||||
return _allowedNpcs;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user