mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 22:49:39 -04:00
Implement some opcodes. Big thx to TOM_RUS.
--HG-- branch : trunk
This commit is contained in:
@@ -854,17 +854,30 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||
|
||||
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
|
||||
|
||||
WorldPacket data(SMSG_BUY_BANK_SLOT_RESULT, 4);
|
||||
|
||||
if (!slotEntry)
|
||||
{
|
||||
data << uint32(ERR_BANKSLOT_FAILED_TOO_MANY);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 price = slotEntry->price;
|
||||
|
||||
if (_player->GetMoney() < price)
|
||||
{
|
||||
data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
_player->SetBankBagSlotCount(slot);
|
||||
_player->ModifyMoney(-int32(price));
|
||||
|
||||
data << uint32(ERR_BANKSLOT_OK);
|
||||
SendPacket(&data);
|
||||
|
||||
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user