mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/AH: AuctionHouseBot BidPrice determined by config options
(cherry picked from commit bed369e7c8)
This commit is contained in:
committed by
DoctorKraft
parent
c519992c1a
commit
bec131eac3
@@ -285,6 +285,9 @@ void AuctionBotConfig::GetConfigFromFile()
|
||||
SetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_KEY, "AuctionHouseBot.Class.RandomStackRatio.Key", 100);
|
||||
SetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_MISC, "AuctionHouseBot.Class.RandomStackRatio.Misc", 100);
|
||||
SetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_GLYPH, "AuctionHouseBot.Class.RandomStackRatio.Glyph", 0);
|
||||
|
||||
SetConfig(CONFIG_AHBOT_BIDPRICE_MIN, "AuctionHouseBot.BidPrice.Min", 0.6f);
|
||||
SetConfig(CONFIG_AHBOT_BIDPRICE_MAX, "AuctionHouseBot.BidPrice.Max", 1.4f);
|
||||
}
|
||||
|
||||
char const* AuctionBotConfig::GetHouseTypeName(AuctionHouseType houseType)
|
||||
|
||||
@@ -196,7 +196,9 @@ enum AuctionBotConfigBoolValues
|
||||
enum AuctionBotConfigFloatValues
|
||||
{
|
||||
CONFIG_AHBOT_BUYER_CHANCE_FACTOR,
|
||||
CONFIG_AHBOT_FLOAT_COUNT
|
||||
CONFIG_AHBOT_FLOAT_COUNT,
|
||||
CONFIG_AHBOT_BIDPRICE_MIN,
|
||||
CONFIG_AHBOT_BIDPRICE_MAX
|
||||
};
|
||||
|
||||
// All basic config data used by other AHBot classes for self-configure.
|
||||
|
||||
@@ -699,9 +699,11 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
|
||||
buyp = static_cast<uint32>(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f);
|
||||
if (buyp == 0)
|
||||
buyp = 1;
|
||||
uint32 basePrice = buyp * .5;
|
||||
range = buyp * .4;
|
||||
bidp = urand(static_cast<uint32>(basePrice - range + 0.5f), static_cast<uint32>(basePrice + range + 0.5f)) + 1;
|
||||
|
||||
float bidPercentage = frand(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIDPRICE_MIN), sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIDPRICE_MAX));
|
||||
bidp = static_cast<uint32>(bidPercentage * buyp);
|
||||
if (bidp == 0)
|
||||
bidp = 1;
|
||||
}
|
||||
|
||||
// Determines the stack size to use for the item
|
||||
|
||||
@@ -3354,6 +3354,15 @@ AuctionHouseBot.ItemsPerCycle.Normal = 20
|
||||
|
||||
AuctionHouseBot.BuyPrice.Seller = 1
|
||||
|
||||
#
|
||||
# AuctionHouseBot.BidPrice.*
|
||||
# Description: These values determine the range that the Bid Price will fall into, as a percentage of the Buy Price
|
||||
# Default: 0.6 - (Min)
|
||||
# 1.4 - (Max)
|
||||
|
||||
AuctionHouseBot.BidPrice.Min = 0.6
|
||||
AuctionHouseBot.BidPrice.Max = 1.4
|
||||
|
||||
#
|
||||
# AuctionHouseBot.Alliance.Price.Ratio
|
||||
# Description: Percentage by which the price of items selled on Alliance Auction House is incremented / decreased
|
||||
|
||||
Reference in New Issue
Block a user