152 {
154 uint32 count = countArg.value_or(10);
155
157 {
159 }
160 else
161 {
163 }
164
165 if (!count || !itemId)
166 return false;
167
169
170
171 uint32 inventoryCount = 0;
172
176
177 if (result)
178 inventoryCount = (*result)[0].Get<
uint64>();
179
181 stmt->SetData(0, itemId);
182 stmt->SetData(1, count);
184
185 if (result)
186 {
187 do
188 {
189 Field* fields = result->Fetch();
195 std::string ownerName = fields[5].
Get<std::string>();
196
197 char const* itemPos = nullptr;
199 itemPos = "[equipped]";
201 itemPos = "[in inventory]";
203 itemPos = "[in bank]";
204 else
205 itemPos = "";
206
208 }
209 while (result->NextRow());
210
212
213 if (count > resultCount)
214 count -= resultCount;
215 else
216 count = 0;
217 }
218
219
221
223 stmt->SetData(0, itemId);
225
226 if (result)
227 mailCount = (*result)[0].Get<
uint64>();
228
229 if (count > 0)
230 {
232 stmt->SetData(0, itemId);
233 stmt->SetData(1, count);
235 }
236 else
238
239 if (result)
240 {
241 do
242 {
243 Field* fields = result->Fetch();
248 std::string itemSenderName = fields[4].
Get<std::string>();
250 std::string itemReceiverName = fields[6].
Get<std::string>();
251
252 char const* itemPos = "[in mail]";
253
254 handler->
PSendSysMessage(
LANG_ITEMLIST_MAIL, itemGuid, itemSenderName, itemSender, itemSenderAccountId, itemReceiverName, itemReceiver, itemReceiverAccount, itemPos);
255 }
256 while (result->NextRow());
257
259
260 if (count > resultCount)
261 count -= resultCount;
262 else
263 count = 0;
264 }
265
266
268
270 stmt->SetData(0, itemId);
272
273 if (result)
274 auctionCount = (*result)[0].Get<
uint64>();
275
276 if (count > 0)
277 {
279 stmt->SetData(0, itemId);
280 stmt->SetData(1, count);
282 }
283 else
285
286 if (result)
287 {
288 do
289 {
290 Field* fields = result->Fetch();
294 std::string ownerName = fields[3].
Get<std::string>();
295
296 char const* itemPos = "[in auction]";
297
299 }
300 while (result->NextRow());
301 }
302
303
305
307 stmt->SetData(0, itemId);
309
310 if (result)
311 guildCount = (*result)[0].Get<
uint64>();
312
314 stmt->SetData(0, itemId);
315 stmt->SetData(1, count);
317
318 if (result)
319 {
320 do
321 {
322 Field* fields = result->Fetch();
325 std::string guildName = fields[2].
Get<std::string>();
326
327 char const* itemPos = "[in guild bank]";
328
330 }
331 while (result->NextRow());
332
334
335 if (count > resultCount)
336 count -= resultCount;
337 else
338 count = 0;
339 }
340
341 if (inventoryCount + mailCount + auctionCount + guildCount == 0)
342 {
344 return false;
345 }
346
348
349 return true;
350 }
std::uint8_t uint8
Definition: Define.h:109
@ LANG_ITEMLIST_GUILD
Definition: Language.h:907
@ LANG_ITEMLIST_MAIL
Definition: Language.h:551
@ LANG_COMMAND_NOITEMFOUND
Definition: Language.h:468
@ LANG_ITEMLIST_AUCTION
Definition: Language.h:552
@ LANG_ITEMLIST_SLOT
Definition: Language.h:550
@ LANG_COMMAND_LISTITEMMESSAGE
Definition: Language.h:470
@ CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY
Definition: CharacterDatabase.h:358
@ CHAR_SEL_MAIL_COUNT_ITEM
Definition: CharacterDatabase.h:355
@ CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM
Definition: CharacterDatabase.h:356
@ CHAR_SEL_GUILD_BANK_COUNT_ITEM
Definition: CharacterDatabase.h:357
@ CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY
Definition: CharacterDatabase.h:361
@ CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY
Definition: CharacterDatabase.h:362
@ CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM
Definition: CharacterDatabase.h:354
@ CHAR_SEL_MAIL_ITEMS_BY_ENTRY
Definition: CharacterDatabase.h:360
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:45
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: PreparedStatement.h:157
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:77
Definition: ChatCommandTags.h:200
constexpr decltype(auto) get()
Definition: ChatCommandTags.h:284
constexpr bool holds_alternative() const
Definition: ChatCommandTags.h:298
static bool IsEquipmentPos(uint16 pos)
Definition: Player.h:1275
static bool IsInventoryPos(uint16 pos)
Definition: Player.h:1273
static bool IsBankPos(uint16 pos)
Definition: Player.h:1278