MaNGOS merge: Mail System.

* Store loot in mail_loot_template indexed by mail template ids.
* Implement proper creating mail text copy item from mail template based mail.
* Move send functions to new MailDraft class from WorldSession.
* Implement mails sending at player levelup.
* Autor VladimirMangos, converted by me.

--HG--
branch : trunk
This commit is contained in:
win32
2009-12-16 18:58:36 +02:00
parent dc53b4a9de
commit bf2c3fd8cf
25 changed files with 779 additions and 571 deletions
+9 -6
View File
@@ -129,7 +129,9 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
if (oldBidder && _player)
oldBidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, _player->GetGUID(), newPrice, auction->GetAuctionOutBid(), auction->item_template);
WorldSession::SendMailTo(oldBidder, MAIL_AUCTION, MAIL_STATIONERY_AUCTION, auction->GetHouseId(), auction->bidder, msgAuctionOutbiddedSubject.str(), 0, NULL, auction->bid, 0, MAIL_CHECK_MASK_NONE);
MailDraft(msgAuctionOutbiddedSubject.str())
.AddMoney(auction->bid)
.SendMailTo(MailReceiver(oldBidder, auction->bidder), auction);
}
}
@@ -149,7 +151,9 @@ void WorldSession::SendAuctionCancelledToBidderMail(AuctionEntry* auction)
std::ostringstream msgAuctionCancelledSubject;
msgAuctionCancelledSubject << auction->item_template << ":0:" << AUCTION_CANCELLED_TO_BIDDER;
WorldSession::SendMailTo(bidder, MAIL_AUCTION, MAIL_STATIONERY_AUCTION, auction->GetHouseId(), auction->bidder, msgAuctionCancelledSubject.str(), 0, NULL, auction->bid, 0, MAIL_CHECK_MASK_NONE);
MailDraft(msgAuctionCancelledSubject.str())
.AddMoney(auction->bid)
.SendMailTo(MailReceiver(bidder, auction->bidder), auction);
}
}
@@ -442,11 +446,10 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
std::ostringstream msgAuctionCanceledOwner;
msgAuctionCanceledOwner << auction->item_template << ":0:" << AUCTION_CANCELED;
MailItemsInfo mi;
mi.AddItem(auction->item_guidlow, auction->item_template, pItem);
// item will deleted or added to received mail list
WorldSession::SendMailTo(pl, MAIL_AUCTION, MAIL_STATIONERY_AUCTION, auction->GetHouseId(), pl->GetGUIDLow(), msgAuctionCanceledOwner.str(), 0, &mi, 0, 0, MAIL_CHECK_MASK_NONE);
MailDraft(msgAuctionCanceledOwner.str())
.AddItem(pItem)
.SendMailTo(pl, auction);
}
else
{