本文整理汇总了C++中AuctionHouse::SendOwnerListPacket方法的典型用法代码示例。如果您正苦于以下问题:C++ AuctionHouse::SendOwnerListPacket方法的具体用法?C++ AuctionHouse::SendOwnerListPacket怎么用?C++ AuctionHouse::SendOwnerListPacket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuctionHouse
的用法示例。
在下文中一共展示了AuctionHouse::SendOwnerListPacket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAuctionSellItem
//.........这里部分代码省略.........
case 4 * MIN_AUCTION_TIME:
break;
default:
return;
}
Item* items[MAX_AUCTION_ITEMS];
uint32 finalCount = 0;
for (uint32 i = 0; i < itemsCount; ++i)
{
Item* item = _player->GetItemInterface()->GetItemByGUID(itemGUIDs[i]);
if (!item)
{
_player->SendAuctionCommandResult(NULL, AUCTION_CREATE, ERR_AUCTION_ITEM_NOT_FOUND);
return;
}
items[i] = item;
finalCount += count[i];
}
if (!finalCount)
{
_player->SendAuctionCommandResult(NULL, AUCTION_CREATE, ERR_AUCTION_DATABASE_ERROR);
return;
}
for (uint32 i = 0; i < itemsCount; ++i)
{
Item* item = items[i];
if (item->GetStackCount() < finalCount)
{
_player->SendAuctionCommandResult(NULL, AUCTION_CREATE, ERR_AUCTION_DATABASE_ERROR);
return;
}
}
for (uint32 i = 0; i < itemsCount; ++i)
{
Item* item = items[i];
uint32 auctionTime = uint32(etime);
AuctionHouse* ah = pCreature->auctionHouse;
uint32 item_worth = item->GetProto()->SellPrice * item->GetStackCount();
uint32 item_deposit = (uint32)(item_worth * ah->deposit_percent) * (uint32)(etime / 240.0f); // deposit is per 4 hours
if (!_player->HasGold((uint64)item_deposit))
{
_player->SendAuctionCommandResult(NULL, AUCTION_CREATE, ERR_AUCTION_NOT_ENOUGHT_MONEY);
return;
}
_player->TakeGold(-int32(item_deposit));
item = _player->GetItemInterface()->SafeRemoveAndRetreiveItemByGuid(itemGUIDs[i], false);
if (!item)
{
_player->SendAuctionCommandResult(NULL, AUCTION_CREATE, ERR_AUCTION_ITEM_NOT_FOUND);
return;
};
if (item->IsInWorld())
{
item->RemoveFromWorld();
}
item->SetOwner(NULL);
item->m_isDirty = true;
item->SaveToDB(INVENTORY_SLOT_NOT_SET, 0, true, NULL);
// Create auction
Auction* auct = new Auction;
auct->BuyoutPrice = buyout;
auct->ExpiryTime = (uint32)UNIXTIME + (etime * 60);
auct->StartingPrice = bid;
auct->HighestBid = 0;
auct->HighestBidder = 0; // hm
auct->Id = sAuctionMgr.GenerateAuctionId();
auct->Owner = _player->GetLowGUID();
auct->pItem = item;
auct->Deleted = false;
auct->DeletedReason = 0;
auct->DepositAmount = item_deposit;
// Add and save auction to DB
ah->AddAuction(auct);
auct->SaveToDB(ah->GetID());
// Send result packet
_player->SendAuctionCommandResult(NULL, AUCTION_CREATE, ERR_AUCTION_OK);
}
ah->SendOwnerListPacket(_player, &recv_data);
}