From a6c1e29279d28b18012e1a87d23ff114302bd610 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 24 Nov 2015 00:13:24 +0300 Subject: Impliment packet SMSG_SPIRIT_BALLS. --- src/being/being.cpp | 1 + src/being/being.h | 7 +++++++ src/net/eathena/beingrecv.cpp | 17 +++++------------ src/net/eathena/beingrecv.h | 1 - src/net/eathena/packetsin.inc | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/being/being.cpp b/src/being/being.cpp index bca500fe8..58fb9b2b7 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -224,6 +224,7 @@ Being::Being(const BeingId id, mCriticalHit(0), mPvpRank(0), mNumber(100), + mSpiritBalls(0U), mUsageCounter(1), mKarma(0), mManner(0), diff --git a/src/being/being.h b/src/being/being.h index 461a8626f..10e1b8482 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -920,6 +920,12 @@ class Being notfinal : public ActorSprite, std::string getBuyBoard() const A_WARN_UNUSED { return mBuyBoard; } + + void setSpiritBalls(const unsigned int balls) + { mSpiritBalls = balls; } + + unsigned int getSpiritBalls() const A_WARN_UNUSED + { return mSpiritBalls; } #endif void setKarma(const int karma) @@ -1154,6 +1160,7 @@ class Being notfinal : public ActorSprite, int mCriticalHit; unsigned int mPvpRank; unsigned int mNumber; + unsigned int mSpiritBalls; int mUsageCounter; int mKarma; int mManner; diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 56fc0fbf2..f536f1c15 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -1436,18 +1436,11 @@ void BeingRecv::processClassChange(Net::MessageIn &msg) void BeingRecv::processSpiritBalls(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - - msg.readBeingId("being id"); - msg.readInt16("spirits amount"); -} - -void BeingRecv::processSpiritBallSingle(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - - msg.readBeingId("being id"); - msg.readInt16("spirits amount"); + Being *const dstBeing = actorManager->findBeing( + msg.readBeingId("being id")); + const int balls = msg.readInt16("spirits amount"); + if (dstBeing) + dstBeing->setSpiritBalls(balls); } void BeingRecv::processBladeStop(Net::MessageIn &msg) diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h index 0714f2114..08e2e4f40 100644 --- a/src/net/eathena/beingrecv.h +++ b/src/net/eathena/beingrecv.h @@ -91,7 +91,6 @@ namespace EAthena void processMonsterInfo(Net::MessageIn &msg); void processClassChange(Net::MessageIn &msg); void processSpiritBalls(Net::MessageIn &msg); - void processSpiritBallSingle(Net::MessageIn &msg); void processBladeStop(Net::MessageIn &msg); void processComboDelay(Net::MessageIn &msg); void processWddingEffect(Net::MessageIn &msg); diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 1e36f156b..b7618b3ae 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -404,7 +404,7 @@ packet(SMSG_SKILL_UNIT_UPDATE, 0x01ac, 6, &SkillRecv::processSkill packet(SMSG_SKILL_WARP_POINT, 0x011c, 68, &SkillRecv::processSkillWarpPoint); packet(SMSG_SOLVE_CHAR_NAME, 0x0194, 30, &BeingRecv::processSolveCharName); packet(SMSG_SPIRIT_BALLS, 0x01d0, 8, &BeingRecv::processSpiritBalls); -packet(SMSG_SPIRIT_BALL_SINGLE, 0x01e1, 8, &BeingRecv::processSpiritBallSingle); +packet(SMSG_SPIRIT_BALL_SINGLE, 0x01e1, 8, &BeingRecv::processSpiritBalls); packet(SMSG_STARS_KILL, 0x020e, 32, &BeingRecv::processStarsKill); packet(SMSG_TAEKWON_RANKS_LIST, 0x0226, 282, &BeingRecv::processTaekwonRanksList); packet(SMSG_TRADE_CANCEL, 0x00ee, 2, &Ea::TradeRecv::processTradeCancel); -- cgit v1.2.3-60-g2f50