[DiscordArchive] <@456226577798135808> is it possible to somehow mail several items + Subject/Body with player->SendI
[DiscordArchive] <@456226577798135808> is it possible to somehow mail several items + Subject/Body with player->SendI
Archived author: Kitzunu • Posted: 2019-10-25T20:41:05.421000+00:00
Original source
<@456226577798135808> is it possible to somehow mail several items + Subject/Body with player->SendItemRetriavalMail ?
Archived author: Deleted User • Posted: 2019-10-25T20:44:44.817000+00:00
Original source
u shd use maildraft instead then
Archived author: Kitzunu • Posted: 2019-10-25T20:51:14.589000+00:00
Original source
Oki, is there any documention of how it works?
Archived author: Exitare • Posted: 2019-10-25T20:56:07.388000+00:00
Original source
<@224931509046345729> yep, the approach I wrote
Archived author: Deleted User • Posted: 2019-10-25T21:08:31.870000+00:00
Original source
u can look at the Player::SendItemRetreivalMail function
Archived author: Kitzunu • Posted: 2019-10-25T21:09:01.251000+00:00
Original source
okay, thanks for the help!
Archived author: Kitzunu • Posted: 2019-10-25T21:20:47.220000+00:00
Original source
appearently dont have that in my core xd anyways thanks for the help
Archived author: Deleted User • Posted: 2019-10-25T21:25:17.117000+00:00
Original source
```cpp
void Player::SendItemRetrievalMail(uint32 itemEntry, uint32 count)
{
MailSender sender(MAIL_CREATURE, 34337 /* The Postmaster */);
MailDraft draft("Recovered Item", "We recovered a lost item in the twisting nether and noted that it was yours.$B$BPlease find said object enclosed."); // This is the text used in Cataclysm, it probably wasn't changed.
SQLTransaction trans = CharacterDatabase.BeginTransaction();
if (Item* item = Item::CreateItem(itemEntry, count, nullptr))
{
item->SaveToDB(trans);
draft.AddItem(item);
}
draft.SendMailTo(trans, MailReceiver(this, GetGUID().GetCounter()), sender);
CharacterDatabase.CommitTransaction(trans);
}
```