summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/eathena/homunculushandler.cpp28
-rw-r--r--src/net/eathena/homunculushandler.h2
-rw-r--r--src/net/eathena/protocol.h1
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 *