aboutsummaryrefslogtreecommitdiff
path: root/src/game/Mail.cpp
diff options
context:
space:
mode:
authorKingPin <KingPin@Trinitycore.org>2009-01-20 16:44:05 -0600
committerKingPin <KingPin@Trinitycore.org>2009-01-20 16:44:05 -0600
commite1f765a972f3039cd4e7d80b1dfd7b0e20acdd88 (patch)
treeed6c0d20763e6630b6f5d2ce9aa35b46d303b607 /src/game/Mail.cpp
parent5a549389d62c9e08f944160d8c376f16acc81da4 (diff)
AuctionHouseBot patch added. thanx to everyone who worked on it especially Paradox. Only apply 930_characters.sql if you dont already have AHBot installed. AHBot requires an account ID and a character ID to work with, set them in trinitycore.conf and also login atleast once to this character.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Mail.cpp')
-rw-r--r--src/game/Mail.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index 00211094d4e..48bf94c4411 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -30,6 +30,7 @@
#include "Unit.h"
#include "Language.h"
#include "Database/DBCStores.h"
+#include "AuctionHouseBot.h"
void MailItem::deleteItem( bool inDB )
{
@@ -348,7 +349,14 @@ void WorldSession::HandleReturnToSender(WorldPacket & recv_data )
}
}
- SendReturnToSender(MAIL_NORMAL, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
+ if (m->sender == AHBplayerGUID)
+ {
+ SendReturnToSender(MAIL_CREATURE, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
+ }
+ else
+ {
+ SendReturnToSender(MAIL_NORMAL, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
+ }
delete m; //we can deallocate old mail
pl->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, 0);
@@ -765,6 +773,14 @@ void WorldSession::HandleMsgQueryNextMailtime(WorldPacket & /*recv_data*/ )
void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 stationery, uint32 sender_guidlow_or_entry, uint32 receiver_guidlow, std::string subject, uint32 itemTextId, MailItemsInfo* mi, uint32 money, uint32 COD, uint32 checked, uint32 deliver_delay, uint16 mailTemplateId)
{
+ if (receiver_guidlow == AHBplayerGUID)
+ {
+ if(messageType == MAIL_AUCTION && mi) // auction mail with items
+ {
+ mi->deleteIncludedItems(true);
+ }
+ return;
+ }
uint32 mailId = objmgr.GenerateMailID();
time_t deliver_time = time(NULL) + deliver_delay;