148 {
150 uint32 count = countArg.value_or(10);
151
153 {
155 }
156 else
157 {
159 }
160
161 if (!count || !itemId)
162 return false;
163
165
166
167 uint32 inventoryCount = 0;
168
172
173 if (result)
174 inventoryCount = (*result)[0].Get<
uint64>();
175
178 stmt->SetData(1, count);
180
181 if (result)
182 {
183 do
184 {
185 Field* fields = result->Fetch();
191 std::string ownerName = fields[5].
Get<std::string>();
192
193 char const* itemPos = nullptr;
195 itemPos = "[equipped]";
197 itemPos = "[in inventory]";
199 itemPos = "[in bank]";
200 else
201 itemPos = "";
202
204 }
205 while (result->NextRow());
206
208
209 if (count > resultCount)
210 count -= resultCount;
211 else
212 count = 0;
213 }
214
215
217
219 stmt->SetData(0, itemId);
221
222 if (result)
223 mailCount = (*result)[0].Get<
uint64>();
224
225 if (count > 0)
226 {
228 stmt->SetData(0, itemId);
229 stmt->SetData(1, count);
231 }
232 else
234
235 if (result)
236 {
237 do
238 {
239 Field* fields = result->Fetch();
244 std::string itemSenderName = fields[4].
Get<std::string>();
246 std::string itemReceiverName = fields[6].
Get<std::string>();
247
248 char const* itemPos = "[in mail]";
249
250 handler->
PSendSysMessage(
LANG_ITEMLIST_MAIL, itemGuid, itemSenderName, itemSender, itemSenderAccountId, itemReceiverName, itemReceiver, itemReceiverAccount, itemPos);
251 }
252 while (result->NextRow());
253
255
256 if (count > resultCount)
257 count -= resultCount;
258 else
259 count = 0;
260 }
261
262
264
266 stmt->SetData(0, itemId);
268
269 if (result)
270 auctionCount = (*result)[0].Get<
uint64>();
271
272 if (count > 0)
273 {
275 stmt->SetData(0, itemId);
276 stmt->SetData(1, count);
278 }
279 else
281
282 if (result)
283 {
284 do
285 {
286 Field* fields = result->Fetch();
290 std::string ownerName = fields[3].
Get<std::string>();
291
292 char const* itemPos = "[in auction]";
293
295 }
296 while (result->NextRow());
297 }
298
299
301
303 stmt->SetData(0, itemId);
305
306 if (result)
307 guildCount = (*result)[0].Get<
uint64>();
308
310 stmt->SetData(0, itemId);
311 stmt->SetData(1, count);
313
314 if (result)
315 {
316 do
317 {
318 Field* fields = result->Fetch();
321 std::string guildName = fields[2].
Get<std::string>();
322
323 char const* itemPos = "[in guild bank]";
324
326 }
327 while (result->NextRow());
328
330
331 if (count > resultCount)
332 count -= resultCount;
333 else
334 count = 0;
335 }
336
337 if (inventoryCount + mailCount + auctionCount + guildCount == 0)
338 {
340 return false;
341 }
342
344
345 return true;
346 }
@ CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY
Definition CharacterDatabase.h:362
@ CHAR_SEL_MAIL_COUNT_ITEM
Definition CharacterDatabase.h:359
@ CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM
Definition CharacterDatabase.h:360
@ CHAR_SEL_GUILD_BANK_COUNT_ITEM
Definition CharacterDatabase.h:361
@ CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY
Definition CharacterDatabase.h:365
@ CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY
Definition CharacterDatabase.h:366
@ CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM
Definition CharacterDatabase.h:358
@ CHAR_SEL_MAIL_ITEMS_BY_ENTRY
Definition CharacterDatabase.h:364
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition DatabaseEnvFwd.h:45
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition DatabaseEnv.cpp:21
std::uint8_t uint8
Definition Define.h:109
@ LANG_ITEMLIST_GUILD
Definition Language.h:919
@ LANG_ITEMLIST_MAIL
Definition Language.h:560
@ LANG_COMMAND_NOITEMFOUND
Definition Language.h:477
@ LANG_ITEMLIST_AUCTION
Definition Language.h:561
@ LANG_ITEMLIST_SLOT
Definition Language.h:559
@ LANG_COMMAND_LISTITEMMESSAGE
Definition Language.h:479
static bool IsEquipmentPos(uint16 pos)
Definition Player.h:1278
static bool IsInventoryPos(uint16 pos)
Definition Player.h:1276
static bool IsBankPos(uint16 pos)
Definition Player.h:1281
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition PreparedStatement.h:77
Definition PreparedStatement.h:157
Definition ChatCommandTags.h:205
constexpr decltype(auto) get()
Definition ChatCommandTags.h:289
constexpr bool holds_alternative() const
Definition ChatCommandTags.h:303