summaryrefslogtreecommitdiff
path: root/src/net/eathena/homunculushandler.cpp
diff options
context:
space:
mode:
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);