From cdd2dd27b61e36a376dc32947fd9e29f0a492d9b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 31 Jan 2017 18:14:44 +0300 Subject: Allow buy multiply items at once from cash shops. --- src/net/eathena/cashshoprecv.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/cashshoprecv.cpp') diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp index 6c75a1052..d9912342f 100644 --- a/src/net/eathena/cashshoprecv.cpp +++ b/src/net/eathena/cashshoprecv.cpp @@ -20,8 +20,12 @@ #include "net/eathena/cashshoprecv.h" +#include "notifymanager.h" + #include "being/playerinfo.h" +#include "enums/resources/notifytypes.h" + #include "gui/windows/buydialog.h" #include "gui/widgets/createwidget.h" @@ -69,11 +73,37 @@ void CashShopRecv::processCashShopOpen(Net::MessageIn &msg) void CashShopRecv::processCashShopBuyAck(Net::MessageIn &msg) { - UNIMPLEMENTEDPACKET; msg.readInt32("cash points"); if (packetVersion >= 20070711) msg.readInt32("kafra points"); - msg.readInt16("error"); + const uint16_t res = msg.readInt16("error"); + switch (res) + { + case 0: + NotifyManager::notify(NotifyTypes::BUY_DONE); + break; + case 1: + NotifyManager::notify(NotifyTypes::BUY_FAILED_NPC_NOT_FOUND); + break; + case 2: + NotifyManager::notify(NotifyTypes::BUY_FAILED_SYSTEM_ERROR); + break; + case 3: + NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); + break; + case 4: + NotifyManager::notify(NotifyTypes::BUY_TRADE_FAILED); + break; + case 5: + NotifyManager::notify(NotifyTypes::BUY_FAILED_WRONG_ITEM); + break; + case 6: + NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); + break; + default: + UNIMPLEMENTEDPACKETFIELD(res); + break; + } } void CashShopRecv::processCashShopPoints(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2