From 37432edac65a6b85c7a3414a421f2afd3e67a14e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Tue, 31 Mar 2009 15:11:26 -0600 Subject: Add first draft of net handlers eAthena NPC handler has been implemented and is being used for NPC interraction. --- src/gui/buy.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/gui/buy.cpp') 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 -- cgit v1.2.3-60-g2f50