summaryrefslogtreecommitdiff
path: root/src/net/eathena/homunculushandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-25 17:56:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-25 17:56:16 +0300
commita8f264a9aad2ec9d90759a65d556cc97d7785fb6 (patch)
tree09608f0c3f50afa1b20a7d09babea5670e0dd844 /src/net/eathena/homunculushandler.cpp
parent5c504a65d5f0e66c653e7bf1085d326f6b636ed6 (diff)
downloadplus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.tar.gz
plus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.tar.bz2
plus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.tar.xz
plus-a8f264a9aad2ec9d90759a65d556cc97d7785fb6.zip
eathena: add packet SMSG_HOMUNCULUS_SKILL_UP 0x0239.
Diffstat (limited to 'src/net/eathena/homunculushandler.cpp')
-rw-r--r--src/net/eathena/homunculushandler.cpp28
1 files changed, 28 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);