diff options
author | n0n4m3 <none@none> | 2010-04-11 11:18:20 +0400 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-04-11 11:18:20 +0400 |
commit | 17089d38f3624d592f36befe5f5cedfb08b3bbff (patch) | |
tree | 1ab4f70f2796c24bc80118163cc4003e30077e40 /src/game/ItemHandler.cpp | |
parent | be95faff2370db63eedd812ab4e70bb87e34b570 (diff) |
Implement some opcodes. Big thx to TOM_RUS.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ItemHandler.cpp')
-rw-r--r-- | src/game/ItemHandler.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index c3ca61c123c..17f4ac34107 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -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); } |