Auction house changes:
- Stop storing guid for auctioneer. - Store instead house ID - No separate ID for various houses. Only Horde, Alliance and Neutral. - Removed non-needed faction checks. - Use enum for auction house IDs NOTE: This will expire all current auctions and return item to player (or award to high bidder) in order to prepare database for the changes.
This commit is contained in:
1 parent
fcc6ef6b18
commit
01ae5c4bf6
7 files changed
+83
-68
No files matched your search
@@ -154,7 +154,6 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
@@ -259,9 +258,26 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
AuctionEntry* AH = new AuctionEntry();
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
|
||||
AH->auctioneer = 23442; ///@TODO - HARDCODED DB GUID, BAD BAD BAD
|
||||
AH->houseId = AUCTIONHOUSE_NEUTRAL;
|
||||
else
|
||||
AH->auctioneer = auctioneer.GetCounter();
|
||||
{
|
||||
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(creature->GetSpawnId());
|
||||
if (!auctioneerData)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Data for auctioneer not found (%s)", auctioneer.ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
|
||||
if (!auctioneerInfo)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Non existing auctioneer (%s)", auctioneer.ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
const AuctionHouseEntry* AHEntry = sAuctionMgr->GetAuctionHouseEntry(auctioneerInfo->faction);
|
||||
AH->houseId = AHEntry->houseId;
|
||||
}
|
||||
|
||||
// Required stack size of auction matches to current item stack size, just move item to auctionhouse
|
||||
if (itemsCount == 1 && item->GetCount() == count[0])
|
||||
@@ -285,8 +301,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
AH->deposit = deposit;
|
||||
AH->auctionHouseEntry = auctionHouseEntry;
|
||||
|
||||
TC_LOG_INFO("network", "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
|
||||
_player->GetName().c_str(), _player->GetGUID().GetCounter(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUID().GetCounter(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
|
||||
TC_LOG_INFO("network", "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
|
||||
_player->GetName().c_str(), _player->GetGUID().GetCounter(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUID().GetCounter(), item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
|
||||
sAuctionMgr->AddAItem(item);
|
||||
auctionHouse->AddAuction(AH);
|
||||
|
||||
@@ -333,8 +349,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
AH->deposit = deposit;
|
||||
AH->auctionHouseEntry = auctionHouseEntry;
|
||||
|
||||
TC_LOG_INFO("network", "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
|
||||
_player->GetName().c_str(), _player->GetGUID().GetCounter(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUID().GetCounter(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
|
||||
TC_LOG_INFO("network", "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u",
|
||||
_player->GetName().c_str(), _player->GetGUID().GetCounter(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUID().GetCounter(), newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
|
||||
sAuctionMgr->AddAItem(newItem);
|
||||
auctionHouse->AddAuction(AH);
|
||||
|
||||
|
||||
Reference in new issue
Block a user