254 time_t now = time(
nullptr);
264 TC_LOG_DEBUG(
"ahbot",
"AHBot: Boost value used for Buyer! (if this happens often adjust both ItemsPerCycle in worldserver.conf)");
268 CheckEntryMap::iterator itr = items.begin();
269 while (cycles && itr != items.end())
274 TC_LOG_DEBUG(
"ahbot",
"AHBot: Entry %u doesn't exists, perhaps bought already?", itr->second.AuctionId);
281 if (itr->second.LastChecked && (now - itr->second.LastChecked) <=
_checkInterval)
283 TC_LOG_DEBUG(
"ahbot",
"AHBot: In time interval wait for entry %u!", auction->
Id);
312 ahInfo = &sameItemItr->second;
314 TC_LOG_DEBUG(
"ahbot",
"AHBot: Rolling for AHentry %u:", auction->
Id);
317 bool successBuy =
RollBuyChance(ahInfo, item, auction, bidPrice);
318 bool successBid =
RollBidChance(ahInfo, item, auction, bidPrice);
325 if ((auction->
buyout && successBid && bidPrice >= auction->
buyout) ||
326 (successBuy && (!successBid ||
urand(1, 5) == 1)))
331 itr->second.LastChecked = now;
uint32 _checkInterval
Definition: AuctionHouseBotBuyer.h:83
#define sAuctionBotConfig
Definition: AuctionHouseBot.h:252
AuctionEntry * GetAuction(uint32 id) const
Definition: AuctionHouseMgr.h:116
ObjectGuid::LowType itemGUIDLow
Definition: AuctionHouseMgr.h:71
Definition: AuctionHouseMgr.h:67
void BuyEntry(AuctionEntry *auction, AuctionHouseObject *auctionHouse)
Definition: AuctionHouseBotBuyer.cpp:387
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
bool RollBuyChance(const BuyerItemInfo *ahInfo, const Item *item, const AuctionEntry *auction, uint32 bidPrice)
Definition: AuctionHouseBotBuyer.cpp:159
AuctionHouseType GetHouseType() const
Definition: AuctionHouseBotBuyer.h:58
uint32 Id
Definition: AuctionHouseMgr.h:69
BuyerItemInfoMap SameItemInfo
Definition: AuctionHouseBotBuyer.h:60
bool RollBidChance(const BuyerItemInfo *ahInfo, const Item *item, const AuctionEntry *auction, uint32 bidPrice)
Definition: AuctionHouseBotBuyer.cpp:198
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 startbid
Definition: AuctionHouseMgr.h:75
uint32_t uint32
Definition: Define.h:150
uint32 bid
Definition: AuctionHouseMgr.h:76
CheckEntryMap EligibleItems
Definition: AuctionHouseBotBuyer.h:61
uint32 buyout
Definition: AuctionHouseMgr.h:77
#define sAuctionMgr
Definition: AuctionHouseMgr.h:199
Definition: AuctionHouseMgr.h:100
uint32 GetEntry() const
Definition: Object.h:107
void PlaceBidToEntry(AuctionEntry *auction, uint32 bidPrice)
Definition: AuctionHouseBotBuyer.cpp:418
std::map< uint32, BuyerAuctionEval > CheckEntryMap
Definition: AuctionHouseBotBuyer.h:47
uint32 GetAuctionOutBid() const
the sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c
Definition: AuctionHouseMgr.cpp:794
Definition: AuctionHouseBotBuyer.h:34