mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-01-13 01:08:37 +00:00
Merge pull request #7 from NathanHandley/BotSellRework
Make min price at least sell price
This commit is contained in:
@@ -87,8 +87,8 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
|
||||
// Start with a buyout price related to the sell price
|
||||
outBuyoutPrice = itemProto->SellPrice;
|
||||
|
||||
// Set a minimum base buyoutPrice to 5-15 silver for non-projectiles
|
||||
if (outBuyoutPrice < 500 && itemProto->Class != ITEM_CLASS_PROJECTILE)
|
||||
// Set a minimum base buyoutPrice to 5-15 silver for non-projectiles and non-common trade goods
|
||||
if (outBuyoutPrice < 500 && (itemProto->Class != ITEM_CLASS_PROJECTILE && !(itemProto->Class == ITEM_CLASS_TRADE_GOODS && itemProto->Quality == ITEM_QUALITY_NORMAL)))
|
||||
{
|
||||
// TODO: Move to a config
|
||||
outBuyoutPrice = urand(500, 1500);
|
||||
@@ -118,6 +118,14 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
|
||||
uint64 sellVarianceBidPriceBottomPercent = 75;
|
||||
outBidPrice = urand(sellVarianceBidPriceBottomPercent * outBuyoutPrice, sellVarianceBidPriceTopPercent * outBuyoutPrice);
|
||||
outBidPrice /= 100;
|
||||
|
||||
// If variance brought price below sell price, bring it back up to avoid making money off vendoring AH items
|
||||
if (outBuyoutPrice < itemProto->SellPrice)
|
||||
{
|
||||
uint64 minLowPriceAddVariancePercent = 125;
|
||||
outBuyoutPrice = urand(100 * outBuyoutPrice, minLowPriceAddVariancePercent * outBuyoutPrice);
|
||||
outBuyoutPrice /= 100;
|
||||
}
|
||||
}
|
||||
|
||||
void AuctionHouseBot::populatetemClassSeedListForItemClass(uint32 itemClass, uint32 itemClassSeedWeight)
|
||||
@@ -761,7 +769,7 @@ void AuctionHouseBot::InitializeConfiguration()
|
||||
ItemsPerCycle = sConfigMgr->GetOption<uint32>("AuctionHouseBot.ItemsPerCycle", 200);
|
||||
}
|
||||
|
||||
void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char* args)
|
||||
void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, char* args)
|
||||
{
|
||||
AHBConfig *config = NULL;
|
||||
switch (ahMapID)
|
||||
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
void Initialize();
|
||||
void InitializeConfiguration();
|
||||
void LoadValues(AHBConfig*);
|
||||
void Commands(uint32, uint32, uint32, char*);
|
||||
void Commands(uint32 command, uint32 ahMapID, char* args);
|
||||
ObjectGuid::LowType GetAHBplayerGUID() { return AHBplayerGUID; };
|
||||
};
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
auctionbot->Commands(0, ahMapID, 0, NULL);
|
||||
auctionbot->Commands(0, ahMapID, NULL);
|
||||
}
|
||||
else if (strncmp(opt, "minitems", l) == 0)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
auctionbot->Commands(1, ahMapID, 0, param1);
|
||||
auctionbot->Commands(1, ahMapID, param1);
|
||||
}
|
||||
else if (strncmp(opt, "maxitems", l) == 0)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
auctionbot->Commands(2, ahMapID, 0, param1);
|
||||
auctionbot->Commands(2, ahMapID, param1);
|
||||
}
|
||||
else if (strncmp(opt, "bidinterval", l) == 0)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
auctionbot->Commands(12, ahMapID, 0, param1);
|
||||
auctionbot->Commands(12, ahMapID, param1);
|
||||
}
|
||||
else if (strncmp(opt, "bidsperinterval", l) == 0)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
auctionbot->Commands(13, ahMapID, 0, param1);
|
||||
auctionbot->Commands(13, ahMapID, param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user