mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-01-13 09:17:21 +00:00
Added multi-session loading
This commit is contained in:
@@ -33,23 +33,49 @@ public:
|
||||
|
||||
void OnBeforeAuctionHouseMgrSendAuctionSuccessfulMail(AuctionHouseMgr* /*auctionHouseMgr*/, AuctionEntry* /*auction*/, Player* owner, uint32& /*owner_accId*/, uint32& /*profit*/, bool& sendNotification, bool& updateAchievementCriteria, bool& /*sendMail*/) override
|
||||
{
|
||||
if (owner && owner->GetGUID().GetCounter() == auctionbot->GetAHBplayerGUID())
|
||||
if (owner)
|
||||
{
|
||||
sendNotification = false;
|
||||
updateAchievementCriteria = false;
|
||||
bool isAHBot = false;
|
||||
for (AuctionHouseBotCharacter character : auctionbot->AHCharacters)
|
||||
{
|
||||
if (character.CharacterGUID == owner->GetGUID().GetCounter())
|
||||
{
|
||||
isAHBot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isAHBot == true)
|
||||
{
|
||||
sendNotification = false;
|
||||
updateAchievementCriteria = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnBeforeAuctionHouseMgrSendAuctionExpiredMail(AuctionHouseMgr* /*auctionHouseMgr*/, AuctionEntry* /*auction*/, Player* owner, uint32& /*owner_accId*/, bool& sendNotification, bool& /*sendMail*/) override
|
||||
{
|
||||
if (owner && owner->GetGUID().GetCounter() == auctionbot->GetAHBplayerGUID())
|
||||
sendNotification = false;
|
||||
if (owner)
|
||||
{
|
||||
bool isAHBot = false;
|
||||
for (AuctionHouseBotCharacter character : auctionbot->AHCharacters)
|
||||
{
|
||||
if (character.CharacterGUID == owner->GetGUID().GetCounter())
|
||||
{
|
||||
isAHBot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isAHBot == true)
|
||||
{
|
||||
sendNotification = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnBeforeAuctionHouseMgrSendAuctionOutbiddedMail(AuctionHouseMgr* /*auctionHouseMgr*/, AuctionEntry* auction, Player* oldBidder, uint32& /*oldBidder_accId*/, Player* newBidder, uint32& newPrice, bool& /*sendNotification*/, bool& /*sendMail*/) override
|
||||
{
|
||||
if (oldBidder && !newBidder)
|
||||
oldBidder->GetSession()->SendAuctionBidderNotification((uint32)auction->GetHouseId(), auction->Id, ObjectGuid::Create<HighGuid::Player>(auctionbot->GetAHBplayerGUID()), newPrice, auction->GetAuctionOutBid(), auction->item_template);
|
||||
//if (oldBidder && !newBidder)
|
||||
// oldBidder->GetSession()->SendAuctionBidderNotification((uint32)auction->GetHouseId(), auction->Id, ObjectGuid::Create<HighGuid::Player>(auctionbot->GetAHBplayerGUID()), newPrice, auction->GetAuctionOutBid(), auction->item_template);
|
||||
}
|
||||
|
||||
void OnBeforeAuctionHouseMgrUpdate() override
|
||||
@@ -65,7 +91,16 @@ public:
|
||||
|
||||
void OnBeforeMailDraftSendMailTo(MailDraft* /*mailDraft*/, MailReceiver const& receiver, MailSender const& sender, MailCheckMask& /*checked*/, uint32& /*deliver_delay*/, uint32& /*custom_expiration*/, bool& deleteMailItemsFromDB, bool& sendMail) override
|
||||
{
|
||||
if (receiver.GetPlayerGUIDLow() == auctionbot->GetAHBplayerGUID())
|
||||
bool isAHBot = false;
|
||||
for (AuctionHouseBotCharacter character : auctionbot->AHCharacters)
|
||||
{
|
||||
if (character.CharacterGUID == receiver.GetPlayerGUIDLow())
|
||||
{
|
||||
isAHBot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isAHBot == true)
|
||||
{
|
||||
if (sender.GetMailMessageType() == MAIL_AUCTION) // auction mail with items
|
||||
deleteMailItemsFromDB = true;
|
||||
|
||||
Reference in New Issue
Block a user