diff --git a/src/AuctionHouseBot.cpp b/src/AuctionHouseBot.cpp index 294fd7e..1602dd1 100644 --- a/src/AuctionHouseBot.cpp +++ b/src/AuctionHouseBot.cpp @@ -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("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) diff --git a/src/AuctionHouseBot.h b/src/AuctionHouseBot.h index 1953b96..7768c51 100644 --- a/src/AuctionHouseBot.h +++ b/src/AuctionHouseBot.h @@ -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; }; }; diff --git a/src/cs_ah_bot.cpp b/src/cs_ah_bot.cpp index 215c8a8..20610b2 100644 --- a/src/cs_ah_bot.cpp +++ b/src/cs_ah_bot.cpp @@ -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 {