mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
Implemented SMSG_BUY_BANK_SLOT_RESULT opcode.
This commit is contained in:
parent
d131f137cc
commit
a248015501
2 changed files with 21 additions and 0 deletions
|
|
@ -844,17 +844,30 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||||
|
|
||||||
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
|
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
|
||||||
|
|
||||||
|
WorldPacket data(SMSG_BUY_BANK_SLOT_RESULT, 4);
|
||||||
|
|
||||||
if(!slotEntry)
|
if(!slotEntry)
|
||||||
|
{
|
||||||
|
data << uint32(ERR_BANKSLOT_FAILED_TOO_MANY);
|
||||||
|
SendPacket(&data);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 price = slotEntry->price;
|
uint32 price = slotEntry->price;
|
||||||
|
|
||||||
if (_player->GetMoney() < price)
|
if (_player->GetMoney() < price)
|
||||||
|
{
|
||||||
|
data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS);
|
||||||
|
SendPacket(&data);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_player->SetBankBagSlotCount(slot);
|
_player->SetBankBagSlotCount(slot);
|
||||||
_player->ModifyMoney(-int32(price));
|
_player->ModifyMoney(-int32(price));
|
||||||
|
|
||||||
|
data << uint32(ERR_BANKSLOT_OK);
|
||||||
|
SendPacket(&data);
|
||||||
|
|
||||||
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
|
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,14 @@ enum PlayerUnderwaterState
|
||||||
UNDERWATER_EXIST_TIMERS = 0x10
|
UNDERWATER_EXIST_TIMERS = 0x10
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum BuyBankSlotResult
|
||||||
|
{
|
||||||
|
ERR_BANKSLOT_FAILED_TOO_MANY = 0,
|
||||||
|
ERR_BANKSLOT_INSUFFICIENT_FUNDS = 1,
|
||||||
|
ERR_BANKSLOT_NOTBANKER = 2,
|
||||||
|
ERR_BANKSLOT_OK = 3
|
||||||
|
};
|
||||||
|
|
||||||
enum PlayerSpellState
|
enum PlayerSpellState
|
||||||
{
|
{
|
||||||
PLAYERSPELL_UNCHANGED = 0,
|
PLAYERSPELL_UNCHANGED = 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue