diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-25 17:56:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-25 17:56:16 +0300 |
commit | a8f264a9aad2ec9d90759a65d556cc97d7785fb6 (patch) | |
tree | 09608f0c3f50afa1b20a7d09babea5670e0dd844 /src/net/eathena | |
parent | 5c504a65d5f0e66c653e7bf1085d326f6b636ed6 (diff) | |
download | manaplus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.tar.gz manaplus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.tar.bz2 manaplus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.tar.xz manaplus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.zip |
eathena: add packet SMSG_HOMUNCULUS_SKILL_UP 0x0239.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/homunculushandler.cpp | 28 | ||||
-rw-r--r-- | src/net/eathena/homunculushandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index 5a6d3e5fa..6f7aaaa40 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -48,6 +48,7 @@ HomunculusHandler::HomunculusHandler() : SMSG_HOMUNCULUS_SKILLS, SMSG_HOMUNCULUS_DATA, SMSG_HOMUNCULUS_INFO, + SMSG_HOMUNCULUS_SKILL_UP, 0 }; handledMessages = _messages; @@ -70,6 +71,10 @@ void HomunculusHandler::handleMessage(Net::MessageIn &msg) processHomunculusInfo(msg); break; + case SMSG_HOMUNCULUS_SKILL_UP: + processHomunculusSkillUp(msg); + break; + default: break; } @@ -179,6 +184,29 @@ void HomunculusHandler::processHomunculusInfo(Net::MessageIn &msg) PlayerInfo::setHomunculusBeing(dstBeing); } +void HomunculusHandler::processHomunculusSkillUp(Net::MessageIn &msg) +{ + const int skillId = msg.readInt16("skill id"); + const int level = msg.readInt16("level"); + const int sp = msg.readInt16("sp"); + const int range = msg.readInt16("range"); + const int up = msg.readUInt8("up flag"); + + if (skillDialog && PlayerInfo::getSkillLevel(skillId) != level) + skillDialog->playUpdateEffect(skillId); + PlayerInfo::setSkillLevel(skillId, level); + if (skillDialog) + { + if (!skillDialog->updateSkill(skillId, range, + up, SkillType::Unknown, sp)) + { + skillDialog->addSkill(SkillOwner::Homunculus, + skillId, "", level, + range, up, SkillType::Unknown, sp); + } + } +} + void HomunculusHandler::setName(const std::string &name) const { createOutPacket(CMSG_HOMUNCULUS_SET_NAME); diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h index 3b7a82ace..c86dfb58e 100644 --- a/src/net/eathena/homunculushandler.h +++ b/src/net/eathena/homunculushandler.h @@ -57,6 +57,8 @@ class HomunculusHandler final : public MessageHandler, void processHomunculusData(Net::MessageIn &msg); void processHomunculusInfo(Net::MessageIn &msg); + + void processHomunculusSkillUp(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 13a5f5132..c7a652751 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -261,6 +261,7 @@ #define SMSG_HOMUNCULUS_SKILLS 0x0235 #define SMSG_HOMUNCULUS_DATA 0x0230 #define SMSG_HOMUNCULUS_INFO 0x022e +#define SMSG_HOMUNCULUS_SKILL_UP 0x0239 /********************************** * Packets from client to server * |