From dfefb83dedc4491ace627dc204f841ef8c6d7052 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Apr 2017 23:18:17 +0300 Subject: Add workaround to open npc buy shop if npc invisible. For hercules it lost npc type. --- src/net/eathena/npchandler.cpp | 8 ++++++++ src/net/eathena/npchandler.h | 2 ++ 2 files changed, 10 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index 6cb30bb81..5f2da7255 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -133,6 +133,14 @@ void NpcHandler::buy(const Being *const being) const EAthena::NpcRecv::mNpcTypeId = being->getSubType(); } +void NpcHandler::buy(const BeingId beingId) const +{ + createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); + outMsg.writeBeingId(beingId, "npc id"); + outMsg.writeInt8(0, "action"); + EAthena::NpcRecv::mNpcTypeId = BeingTypeId_zero; +} + void NpcHandler::sell(const BeingId beingId) const { createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h index d13d0f0cc..a2962eea0 100644 --- a/src/net/eathena/npchandler.h +++ b/src/net/eathena/npchandler.h @@ -52,6 +52,8 @@ class NpcHandler final : public Ea::NpcHandler void buy(const Being *const being) const override final; + void buy(const BeingId beingId) const override final; + void sell(const BeingId beingId) const override final; void buyItem(const BeingId beingId, -- cgit v1.2.3-70-g09d2