summaryrefslogtreecommitdiff
path: root/src/gui/buy.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-31 15:11:26 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-31 15:11:26 -0600
commit37432edac65a6b85c7a3414a421f2afd3e67a14e (patch)
treea4dc561371fab9d1800aec72960d7f86a1e88135 /src/gui/buy.cpp
parent2c5f308192d18b5447a5b0e2ee3428984c1f1b78 (diff)
downloadmana-37432edac65a6b85c7a3414a421f2afd3e67a14e.tar.gz
mana-37432edac65a6b85c7a3414a421f2afd3e67a14e.tar.bz2
mana-37432edac65a6b85c7a3414a421f2afd3e67a14e.tar.xz
mana-37432edac65a6b85c7a3414a421f2afd3e67a14e.zip
Add first draft of net handlers
eAthena NPC handler has been implemented and is being used for NPC interraction.
Diffstat (limited to 'src/gui/buy.cpp')
-rw-r--r--src/gui/buy.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 6d336e4c..7cefa3e5 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -37,8 +37,7 @@
#ifdef TMWSERV_SUPPORT
#include "net/tmwserv/gameserver/player.h"
#else
-#include "net/messageout.h"
-#include "net/ea/protocol.h"
+#include "net/ea/npchandler.h"
#endif
#include "resources/iteminfo.h"
@@ -188,14 +187,12 @@ void BuyDialog::action(const gcn::ActionEvent &event)
else if (event.getId() == "buy" && mAmountItems > 0 &&
mAmountItems <= mMaxItems)
{
+ // Net::getNpcHandler()->buyItem(current_npc, mShopItems->at(selectedItem)->getId(), mAmountItems);
#ifdef TMWSERV_SUPPORT
Net::GameServer::Player::tradeWithNPC
(mShopItems->at(selectedItem)->getId(), mAmountItems);
#else
- MessageOut outMsg(CMSG_NPC_BUY_REQUEST);
- outMsg.writeInt16(8);
- outMsg.writeInt16(mAmountItems);
- outMsg.writeInt16(mShopItems->at(selectedItem)->getId());
+ npcHandler->buyItem(current_npc, mShopItems->at(selectedItem)->getId(), mAmountItems);
#endif
// Update money and adjust the max number of items that can be bought