aboutsummaryrefslogtreecommitdiff
path: root/src/game/AuctionHouseBot.h
diff options
context:
space:
mode:
authorChaz Brown <iamparadox@netscape.net>2009-09-22 20:40:34 -0400
committerChaz Brown <iamparadox@netscape.net>2009-09-22 20:40:34 -0400
commit7aa91dd81b5ea3bb85d97ff30389a2a1a0a7ab28 (patch)
tree43bb89474e720ab75ac4feaecde5cd2a96912393 /src/game/AuctionHouseBot.h
parenta9086ea15a6ef297714aef3c50f9b003a016050f (diff)
* AHBot rewritten to cause less lag spikes when checking for bids and when adding new auctions.
* AH Deposit function rewritten to generate deposits closer to official. * AH Mail system rewritten to fix some bugs. * MULTI_THREAD_MAP enabled by default (I have no idea why this was commented out before) * CLIENT_VER added for allowing parts of the code to be enabled/disabled depending on the client version supported. Only used in AHBot for now. * Various code cleanups. --HG-- branch : trunk
Diffstat (limited to 'src/game/AuctionHouseBot.h')
-rw-r--r--src/game/AuctionHouseBot.h245
1 files changed, 245 insertions, 0 deletions
diff --git a/src/game/AuctionHouseBot.h b/src/game/AuctionHouseBot.h
index f306d1b5422..ed34f32e676 100644
--- a/src/game/AuctionHouseBot.h
+++ b/src/game/AuctionHouseBot.h
@@ -3,7 +3,11 @@
#include "World.h"
#include "Config/ConfigEnv.h"
+#if CLIENT_VER > 300
#include "ace/Vector_T.h"
+#else if CLIENT_VER > 100
+#include <vector>
+#endif
#define AHB_GREY 0
#define AHB_WHITE 1
@@ -110,6 +114,22 @@ private:
uint32 orangeip;
uint32 yellowip;
+ uint32 greyTGoods;
+ uint32 whiteTGoods;
+ uint32 greenTGoods;
+ uint32 blueTGoods;
+ uint32 purpleTGoods;
+ uint32 orangeTGoods;
+ uint32 yellowTGoods;
+
+ uint32 greyItems;
+ uint32 whiteItems;
+ uint32 greenItems;
+ uint32 blueItems;
+ uint32 purpleItems;
+ uint32 orangeItems;
+ uint32 yellowItems;
+
public:
AHBConfig(uint32 ahid)
{
@@ -876,6 +896,225 @@ public:
break;
}
}
+
+ void DecItemCounts(uint32 Class, uint32 Quality)
+ {
+ switch(Class)
+ {
+ case ITEM_CLASS_TRADE_GOODS:
+ DecItemCounts(Quality);
+ break;
+ default:
+ DecItemCounts(Quality + 7);
+ break;
+ }
+ }
+
+ void DecItemCounts(uint32 color)
+ {
+ switch(color)
+ {
+ case AHB_GREY_TG:
+ --greyTGoods;
+ break;
+ case AHB_WHITE_TG:
+ --whiteTGoods;
+ break;
+ case AHB_GREEN_TG:
+ --greenTGoods;
+ break;
+ case AHB_BLUE_TG:
+ --blueTGoods;
+ break;
+ case AHB_PURPLE_TG:
+ --purpleTGoods;
+ break;
+ case AHB_ORANGE_TG:
+ --orangeTGoods;
+ break;
+ case AHB_YELLOW_TG:
+ --yellowTGoods;
+ break;
+ case AHB_GREY_I:
+ --greyItems;
+ break;
+ case AHB_WHITE_I:
+ --whiteItems;
+ break;
+ case AHB_GREEN_I:
+ --greenItems;
+ break;
+ case AHB_BLUE_I:
+ --blueItems;
+ break;
+ case AHB_PURPLE_I:
+ --purpleItems;
+ break;
+ case AHB_ORANGE_I:
+ --orangeItems;
+ break;
+ case AHB_YELLOW_I:
+ --yellowItems;
+ break;
+ default:
+ break;
+ }
+ }
+
+ void IncItemCounts(uint32 Class, uint32 Quality)
+ {
+ switch(Class)
+ {
+ case ITEM_CLASS_TRADE_GOODS:
+ IncItemCounts(Quality);
+ break;
+ default:
+ IncItemCounts(Quality + 7);
+ break;
+ }
+ }
+
+ void IncItemCounts(uint32 color)
+ {
+ switch(color)
+ {
+ case AHB_GREY_TG:
+ ++greyTGoods;
+ break;
+ case AHB_WHITE_TG:
+ ++whiteTGoods;
+ break;
+ case AHB_GREEN_TG:
+ ++greenTGoods;
+ break;
+ case AHB_BLUE_TG:
+ ++blueTGoods;
+ break;
+ case AHB_PURPLE_TG:
+ ++purpleTGoods;
+ break;
+ case AHB_ORANGE_TG:
+ ++orangeTGoods;
+ break;
+ case AHB_YELLOW_TG:
+ ++yellowTGoods;
+ break;
+ case AHB_GREY_I:
+ ++greyItems;
+ break;
+ case AHB_WHITE_I:
+ ++whiteItems;
+ break;
+ case AHB_GREEN_I:
+ ++greenItems;
+ break;
+ case AHB_BLUE_I:
+ ++blueItems;
+ break;
+ case AHB_PURPLE_I:
+ ++purpleItems;
+ break;
+ case AHB_ORANGE_I:
+ ++orangeItems;
+ break;
+ case AHB_YELLOW_I:
+ ++yellowItems;
+ break;
+ default:
+ break;
+ }
+ }
+
+ void ResetItemCounts()
+ {
+ greyTGoods = 0;
+ whiteTGoods = 0;
+ greenTGoods = 0;
+ blueTGoods = 0;
+ purpleTGoods = 0;
+ orangeTGoods = 0;
+ yellowTGoods = 0;
+
+ greyItems = 0;
+ whiteItems = 0;
+ greenItems = 0;
+ blueItems = 0;
+ purpleItems = 0;
+ orangeItems = 0;
+ yellowItems = 0;
+ }
+
+ uint32 TotalItemCounts()
+ {
+ return(
+ greyTGoods +
+ whiteTGoods +
+ greenTGoods +
+ blueTGoods +
+ purpleTGoods +
+ orangeTGoods +
+ yellowTGoods +
+
+ greyItems +
+ whiteItems +
+ greenItems +
+ blueItems +
+ purpleItems +
+ orangeItems +
+ yellowItems);
+ }
+
+ uint32 GetItemCounts(uint32 color)
+ {
+ switch(color)
+ {
+ case AHB_GREY_TG:
+ return greyTGoods;
+ break;
+ case AHB_WHITE_TG:
+ return whiteTGoods;
+ break;
+ case AHB_GREEN_TG:
+ return greenTGoods;
+ break;
+ case AHB_BLUE_TG:
+ return blueTGoods;
+ break;
+ case AHB_PURPLE_TG:
+ return purpleTGoods;
+ break;
+ case AHB_ORANGE_TG:
+ return orangeTGoods;
+ break;
+ case AHB_YELLOW_TG:
+ return yellowTGoods;
+ break;
+ case AHB_GREY_I:
+ return greyItems;
+ break;
+ case AHB_WHITE_I:
+ return whiteItems;
+ break;
+ case AHB_GREEN_I:
+ return greenItems;
+ break;
+ case AHB_BLUE_I:
+ return blueItems;
+ break;
+ case AHB_PURPLE_I:
+ return purpleItems;
+ break;
+ case AHB_ORANGE_I:
+ return orangeItems;
+ break;
+ case AHB_YELLOW_I:
+ return yellowItems;
+ break;
+ default:
+ return 0;
+ break;
+ }
+ }
void SetBidsPerInterval(uint32 value)
{
buyerBidsPerInterval = value;
@@ -891,6 +1130,7 @@ public:
class AuctionHouseBot
{
private:
+#if CLIENT_VER > 300
ACE_Vector<uint32> npcItems;
ACE_Vector<uint32> lootItems;
ACE_Vector<uint32> greyTradeGoodsBin;
@@ -907,6 +1147,7 @@ private:
ACE_Vector<uint32> purpleItemsBin;
ACE_Vector<uint32> orangeItemsBin;
ACE_Vector<uint32> yellowItemsBin;
+#endif
bool debug_Out;
bool debug_Out_Filters;
@@ -937,7 +1178,9 @@ private:
bool DisableBeta_PTR_Unused;
bool DisablePermEnchant;
+#if CLIENT_VER > 300
bool DisableConjured;
+#endif
bool DisableGems;
bool DisableMoney;
bool DisableMoneyLoot;
@@ -995,6 +1238,8 @@ public:
void Update();
void Initialize();
void LoadValues(AHBConfig*);
+ void DecrementItemCounts(AuctionEntry* ah, uint32 item_template);
+ void IncrementItemCounts(AuctionEntry* ah);
void Commands(uint32, uint32, uint32, char*);
uint32 GetAHBplayerGUID() { return AHBplayerGUID; };
};