184 {
186 if (!iece)
187 {
189 return false;
190 }
191
193
194 if (!item)
195 {
197 return false;
198 }
199
201 {
202 if (!target->HasItemCount(itemId, 1, true))
203 {
205 return false;
206 }
207
209 {
212 {
215 return false;
216 }
217
218 target->SetHonorPoints(honor);
221 }
222
224 {
227 {
230 return false;
231 }
232
233 target->SetArenaPoints(arenapoints);
236 }
237
240 {
241 if (reqItem)
242 {
244 }
245
246 ++count;
247 }
248
249 target->DestroyItemCount(itemId, 1, true);
250 }
251 else
252 {
255
257
261
263
264 if (result)
265 {
267 {
270
272
273 if (queryResult)
274 {
275 Field* fields = queryResult->Fetch();
277 {
279 return false;
280 }
281 }
282
286 trans->Append(stmt);
288 }
289
291 {
294
296
297 if (queryResult)
298 {
299 Field* fields = queryResult->Fetch();
301 {
303 return false;
304 }
305 }
306
310 trans->Append(stmt);
312 }
313
315
316 std::string msg =
"Your item " + item->
Name1 +
" has been removed and the used currency restored. This mail contains any items used as currency.";
318
320 bool foundItems = false;
322 {
323 if (reqItem)
324 {
325
327 {
328 continue;
329 }
330
332 {
333 item->SaveToDB(trans);
334 draft.AddItem(item);
335 foundItems = true;
336 }
337 }
338
339 ++count;
340 }
341
342 if (foundItems)
343 {
344 draft.SendMailTo(trans,
MailReceiver(
nullptr, guid), sender);
345 }
346
347 Field* fields = result->Fetch();
348
350 stmt->
SetData(0, fields[0].Get<uint32>());
351 trans->Append(stmt);
352
354 stmt->
SetData(0, fields[0].Get<uint32>());
355 trans->Append(stmt);
356
358 }
359 else
360 {
362 return false;
363 }
364 }
365
366 return true;
367 }
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
#define sObjectMgr
Definition: ObjectMgr.h:1623
DBCStorage< ItemExtendedCostEntry > sItemExtendedCostStore(ItemExtendedCostEntryfmt)
@ CONFIG_MAX_HONOR_POINTS
Definition: IWorld.h:246
@ CONFIG_MAX_ARENA_POINTS
Definition: IWorld.h:249
@ LANG_CMD_ITEM_REFUND_MAX_HONOR
Definition: Language.h:1128
@ LANG_CMD_ITEM_REFUNDED_HONOR
Definition: Language.h:1130
@ LANG_CMD_ITEM_REFUND_MAX_AP
Definition: Language.h:1131
@ LANG_CMD_ITEM_REFUND_HONOR_FAILED
Definition: Language.h:1129
@ LANG_CMD_ITEM_REFUND_AP_FAILED
Definition: Language.h:1132
@ LANG_CMD_ITEM_REFUND_NOT_FOUND
Definition: Language.h:1134
@ LANG_CMD_ITEM_REFUNDED_AP
Definition: Language.h:1133
@ LANG_CMD_ITEM_REFUND_BAD_EXTENDED_COST
Definition: Language.h:1127
@ LANG_COMMAND_ITEMIDINVALID
Definition: Language.h:467
@ MAIL_STATIONERY_GM
Definition: Mail.h:60
@ MAIL_NORMAL
Definition: Mail.h:38
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
Definition: DatabaseEnvFwd.h:70
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:46
@ CHAR_DEL_ITEM_INSTANCE
Definition: CharacterDatabase.h:127
@ CHAR_DEL_CHAR_INVENTORY_BY_ITEM
Definition: CharacterDatabase.h:433
@ CHAR_SEL_HONORPOINTS
Definition: CharacterDatabase.h:514
@ CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY_AND_OWNER
Definition: CharacterDatabase.h:359
@ CHAR_UDP_CHAR_HONOR_POINTS_ACCUMULATIVE
Definition: CharacterDatabase.h:424
@ CHAR_SEL_ARENAPOINTS
Definition: CharacterDatabase.h:515
@ CHAR_UDP_CHAR_ARENA_POINTS_ACCUMULATIVE
Definition: CharacterDatabase.h:426
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
#define sWorld
Definition: World.h:444
Definition: PreparedStatement.h:158
Class used to access individual fields of database query result.
Definition: Field.h:99
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:78
void PSendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:213
void SendErrorMessage(uint32 entry)
Definition: Chat.cpp:218
ObjectGuid GetGUID() const
Definition: ChatCommandTags.h:180
Player * GetConnectedPlayer() const
Definition: ChatCommandTags.h:182
static Item * CreateItem(uint32 item, uint32 count, Player const *player=nullptr, bool clone=false, uint32 randomPropertyId=0)
Definition: Item.cpp:1088
Definition: ItemTemplate.h:619
std::string Name1
Definition: ItemTemplate.h:624
uint32 ItemId
Definition: ItemTemplate.h:620
LowType GetCounter() const
Definition: ObjectGuid.h:145
uint32 LowType
Definition: ObjectGuid.h:122
Definition: Player.h:1064
Definition: DBCStructure.h:1185
uint32 reqarenapoints
Definition: DBCStructure.h:1188
uint32 reqitemcount[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]
Definition: DBCStructure.h:1191
uint32 reqitem[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]
Definition: DBCStructure.h:1190
uint32 reqhonorpoints
Definition: DBCStructure.h:1187