37 std::vector<uint32> npcItems;
38 std::vector<uint32> lootItems;
39 std::vector<uint32> includeItems;
40 std::vector<uint32> excludeItems;
47 while (std::getline(includeStream, temp,
','))
48 includeItems.push_back(atoi(temp.c_str()));
54 while (std::getline(excludeStream, temp,
','))
55 excludeItems.push_back(atoi(temp.c_str()));
61 TC_LOG_DEBUG(
"ahbot",
"Loading npc vendor items for filter..");
63 std::set<uint32> tempItems;
64 for (CreatureTemplateContainer::const_iterator it = creatures->begin(); it != creatures->end(); ++it)
68 for (VendorItemList::const_iterator it2 = data->m_items.begin(); it2 != data->m_items.end(); ++it2)
69 tempItems.insert((*it2)->item);
72 for (std::set<uint32>::const_iterator it = tempItems.begin(); it != tempItems.end(); ++it)
73 npcItems.push_back(*it);
77 TC_LOG_DEBUG(
"ahbot",
"Loading loot items for filter..");
79 "SELECT `item` FROM `creature_loot_template` WHERE `Reference` = 0 UNION "
80 "SELECT `item` FROM `disenchant_loot_template` WHERE `Reference` = 0 UNION "
81 "SELECT `item` FROM `fishing_loot_template` WHERE `Reference` = 0 UNION "
82 "SELECT `item` FROM `gameobject_loot_template` WHERE `Reference` = 0 UNION "
83 "SELECT `item` FROM `item_loot_template` WHERE `Reference` = 0 UNION "
84 "SELECT `item` FROM `milling_loot_template` WHERE `Reference` = 0 UNION "
85 "SELECT `item` FROM `pickpocketing_loot_template` WHERE `Reference` = 0 UNION "
86 "SELECT `item` FROM `prospecting_loot_template` WHERE `Reference` = 0 UNION "
87 "SELECT `item` FROM `reference_loot_template` WHERE `Reference` = 0 UNION "
88 "SELECT `item` FROM `skinning_loot_template` WHERE `Reference` = 0 UNION "
89 "SELECT `item` FROM `spell_loot_template` WHERE `Reference` = 0");
95 Field* fields = result->Fetch();
101 lootItems.push_back(entry);
102 }
while (result->NextRow());
106 TC_LOG_DEBUG(
"ahbot",
"Sorting and cleaning items for AHBot seller...");
122 bool isExcludeItem =
false;
123 for (
size_t i = 0; i < excludeItems.size() && !isExcludeItem; ++i)
124 if (itemId == excludeItems[i])
125 isExcludeItem =
true;
131 bool isForcedIncludeItem =
false;
132 for (
size_t i = 0; i < includeItems.size() && !isForcedIncludeItem; ++i)
133 if (itemId == includeItems[i])
134 isForcedIncludeItem =
true;
136 if (isForcedIncludeItem)
170 bool allowZero =
false;
223 bool isVendorItem =
false;
224 for (
size_t i = 0; i < npcItems.size() && !isVendorItem; ++i)
225 if (itemId == npcItems[i])
235 bool isLootItem =
false;
236 for (
size_t i = 0; i < lootItems.size() && !isLootItem; ++i)
237 if (itemId == lootItems[i])
247 bool isVendorItem =
false;
248 bool isLootItem =
false;
250 for (
size_t i = 0; i < npcItems.size() && !isVendorItem; ++i)
251 if (itemId == npcItems[i])
254 for (
size_t i = 0; i < lootItems.size() && !isLootItem; ++i)
255 if (itemId == lootItems[i])
258 if (!isLootItem && !isVendorItem)
379 TC_LOG_ERROR(
"ahbot",
"AuctionHouseBot seller not have items, disabled.");
386 TC_LOG_DEBUG(
"ahbot",
"AuctionHouseBot seller will use %u items to fill auction house (according your config choices)", itemsAdded);
390 TC_LOG_DEBUG(
"ahbot",
"Items loaded \tGray\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow");
397 TC_LOG_DEBUG(
"ahbot",
"AHBot seller configuration data loaded and initialized");
uint32 GetBaseItemLevel() const
Definition: ItemTemplate.h:667
uint32 GetLockID() const
Definition: ItemTemplate.h:687
Definition: ItemTemplate.h:373
Definition: AuctionHouseBot.h:129
Definition: ItemTemplate.h:599
#define sAuctionBotConfig
Definition: AuctionHouseBot.h:252
QueryResult PQuery(Format &&sql, T *conn, Args &&...args)
Definition: DatabaseWorkerPool.h:165
Definition: AuctionHouseBot.h:184
Definition: AuctionHouseBot.h:139
Definition: ItemTemplate.h:382
#define MAX_AUCTION_QUALITY
Definition: AuctionHouseBot.h:38
Class used to access individual fields of database query result.
Definition: Field.h:56
Definition: ItemTemplate.h:123
Definition: ItemTemplate.h:376
Definition: AuctionHouseBot.h:59
Definition: AuctionHouseBot.h:171
uint32 GetClass() const
Definition: ItemTemplate.h:653
#define MAX_ITEM_CLASS
Definition: ItemTemplate.h:386
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
uint32 GetRequiredSkillRank() const
Definition: ItemTemplate.h:670
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: AuctionHouseBot.h:55
Definition: AuctionHouseBot.h:176
Definition: AuctionHouseBot.h:177
Definition: AuctionHouseBot.h:168
Definition: ItemTemplate.h:120
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: AuctionHouseBot.h:131
Definition: AuctionHouseBot.h:183
Definition: ItemTemplate.h:119
Definition: AuctionHouseBot.h:133
Definition: AuctionHouseBot.h:130
Definition: AuctionHouseBot.h:169
Definition: AuctionHouseBot.h:136
Definition: ItemTemplate.h:380
Definition: AuctionHouseBot.h:138
Definition: AuctionHouseBot.h:186
Definition: AuctionHouseBot.h:187
Definition: AuctionHouseBot.h:179
Definition: AuctionHouseBot.h:128
Definition: ItemTemplate.h:121
Definition: AuctionHouseBot.h:63
ItemPool _itemPool[MAX_AUCTION_QUALITY][MAX_ITEM_CLASS]
Definition: AuctionHouseBotSeller.h:139
Definition: ItemTemplate.h:122
Definition: ItemTemplate.h:368
Definition: AuctionHouseBot.h:170
uint32 GetSellPrice() const
Definition: ItemTemplate.h:663
DB2Storage< ItemEntry > sItemStore("Item.db2", ItemFormat, HOTFIX_SEL_ITEM)
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
Definition: AuctionHouseBot.h:185
Definition: AuctionHouseBot.h:56
Definition: AuctionHouseBot.h:61
Definition: AuctionHouseBot.h:163
Definition: AuctionHouseBot.h:167
Definition: AuctionHouseBot.h:165
Definition: ItemTemplate.h:378
Definition: AuctionHouseBot.h:135
Definition: AuctionHouseBot.h:188
Definition: AuctionHouseBot.h:62
ItemBondingType GetBonding() const
Definition: ItemTemplate.h:683
Definition: AuctionHouseBot.h:178
Definition: ItemTemplate.h:383
Definition: ItemTemplate.h:369
Definition: ItemTemplate.h:647
Definition: ItemTemplate.h:370
uint32 GetSubClass() const
Definition: ItemTemplate.h:654
Definition: AuctionHouseBot.h:175
Definition: ItemTemplate.h:367
Definition: AuctionHouseBot.h:174
uint32 GetUInt32() const
Definition: Field.h:146
int32 GetBaseRequiredLevel() const
Definition: ItemTemplate.h:668
uint32 GetFlags() const
Definition: ItemTemplate.h:656
void LoadConfig()
Definition: AuctionHouseBotSeller.cpp:401
Definition: AuctionHouseBot.h:58
const FieldDescriptor value
Definition: descriptor.h:1522
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: AuctionHouseBot.h:137
Definition: AuctionHouseBot.h:182
Definition: ItemTemplate.h:372
Definition: AuctionHouseBot.h:166
Definition: Creature.h:383
std::unordered_map< uint32, CreatureTemplate > CreatureTemplateContainer
Definition: Creature.h:213
Definition: AuctionHouseBot.h:181
Definition: ItemTemplate.h:379
Definition: AuctionHouseBot.h:164
Definition: AuctionHouseBot.h:134
Definition: ItemTemplate.h:371
Definition: AuctionHouseBot.h:180
Definition: AuctionHouseBot.h:57
Definition: ItemTemplate.h:137
Definition: ItemTemplate.h:374
uint32 GetBuyPrice() const
Definition: ItemTemplate.h:662
Definition: AuctionHouseBot.h:132
Definition: AuctionHouseBot.h:60
uint32 GetQuality() const
Definition: ItemTemplate.h:655