145 {
147 uint32 count = countArg.value_or(10);
148
150 {
152 }
153 else
154 {
156 }
157
158 if (!count || !itemId)
159 return false;
160
162
163
164 uint32 inventoryCount = 0;
165
169
170 if (result)
171 inventoryCount = (*result)[0].Get<
uint64>();
172
175 stmt->SetData(1, count);
177
178 if (result)
179 {
180 do
181 {
182 Field* fields = result->Fetch();
188 std::string ownerName = fields[5].
Get<std::string>();
189
190 char const* itemPos = nullptr;
192 itemPos = "[equipped]";
194 itemPos = "[in inventory]";
196 itemPos = "[in bank]";
197 else
198 itemPos = "";
199
201 }
202 while (result->NextRow());
203
205
206 if (count > resultCount)
207 count -= resultCount;
208 else
209 count = 0;
210 }
211
212
214
216 stmt->SetData(0, itemId);
218
219 if (result)
220 mailCount = (*result)[0].Get<
uint64>();
221
222 if (count > 0)
223 {
225 stmt->SetData(0, itemId);
226 stmt->SetData(1, count);
228 }
229 else
231
232 if (result)
233 {
234 do
235 {
236 Field* fields = result->Fetch();
241 std::string itemSenderName = fields[4].
Get<std::string>();
243 std::string itemReceiverName = fields[6].
Get<std::string>();
244
245 char const* itemPos = "[in mail]";
246
247 handler->
PSendSysMessage(
LANG_ITEMLIST_MAIL, itemGuid, itemSenderName, itemSender, itemSenderAccountId, itemReceiverName, itemReceiver, itemReceiverAccount, itemPos);
248 }
249 while (result->NextRow());
250
252
253 if (count > resultCount)
254 count -= resultCount;
255 else
256 count = 0;
257 }
258
259
261
263 stmt->SetData(0, itemId);
265
266 if (result)
267 auctionCount = (*result)[0].Get<
uint64>();
268
269 if (count > 0)
270 {
272 stmt->SetData(0, itemId);
273 stmt->SetData(1, count);
275 }
276 else
278
279 if (result)
280 {
281 do
282 {
283 Field* fields = result->Fetch();
287 std::string ownerName = fields[3].
Get<std::string>();
288
289 char const* itemPos = "[in auction]";
290
292 }
293 while (result->NextRow());
294 }
295
296
298
300 stmt->SetData(0, itemId);
302
303 if (result)
304 guildCount = (*result)[0].Get<
uint64>();
305
307 stmt->SetData(0, itemId);
308 stmt->SetData(1, count);
310
311 if (result)
312 {
313 do
314 {
315 Field* fields = result->Fetch();
318 std::string guildName = fields[2].
Get<std::string>();
319
320 char const* itemPos = "[in guild bank]";
321
323 }
324 while (result->NextRow());
325
327
328 if (count > resultCount)
329 count -= resultCount;
330 else
331 count = 0;
332 }
333
334 if (inventoryCount + mailCount + auctionCount + guildCount == 0)
335 {
337 return false;
338 }
339
341
342 return true;
343 }
@ CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY
Definition CharacterDatabase.h:360
@ CHAR_SEL_MAIL_COUNT_ITEM
Definition CharacterDatabase.h:357
@ CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM
Definition CharacterDatabase.h:358
@ CHAR_SEL_GUILD_BANK_COUNT_ITEM
Definition CharacterDatabase.h:359
@ CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY
Definition CharacterDatabase.h:363
@ CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY
Definition CharacterDatabase.h:364
@ CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM
Definition CharacterDatabase.h:356
@ CHAR_SEL_MAIL_ITEMS_BY_ENTRY
Definition CharacterDatabase.h:362
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:908
@ LANG_ITEMLIST_MAIL
Definition Language.h:552
@ LANG_COMMAND_NOITEMFOUND
Definition Language.h:469
@ LANG_ITEMLIST_AUCTION
Definition Language.h:553
@ LANG_ITEMLIST_SLOT
Definition Language.h:551
@ LANG_COMMAND_LISTITEMMESSAGE
Definition Language.h:471
static bool IsEquipmentPos(uint16 pos)
Definition Player.h:1276
static bool IsInventoryPos(uint16 pos)
Definition Player.h:1274
static bool IsBankPos(uint16 pos)
Definition Player.h:1279
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition PreparedStatement.h:77
Definition PreparedStatement.h:157
Definition ChatCommandTags.h:200
constexpr decltype(auto) get()
Definition ChatCommandTags.h:284
constexpr bool holds_alternative() const
Definition ChatCommandTags.h:298