summaryrefslogtreecommitdiff
path: root/src/net/eathena/skillrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/skillrecv.cpp')
-rw-r--r--src/net/eathena/skillrecv.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/net/eathena/skillrecv.cpp b/src/net/eathena/skillrecv.cpp
index e525fa8a1..96764d2f8 100644
--- a/src/net/eathena/skillrecv.cpp
+++ b/src/net/eathena/skillrecv.cpp
@@ -134,6 +134,36 @@ void SkillRecv::processSkillAdd(Net::MessageIn &msg)
}
}
+void SkillRecv::processSkillAdd2(Net::MessageIn &msg)
+{
+ int updateSkill = 0;
+ msg.readInt16("len"); // for now unused
+ const int skillId = msg.readInt16("skill id");
+ const SkillType::SkillType inf = static_cast<SkillType::SkillType>(
+ msg.readInt32("inf"));
+ msg.readInt32("inf2");
+ const int level = msg.readInt16("skill level");
+ const int sp = msg.readInt16("sp");
+ const int range = msg.readInt16("range");
+ const std::string name = msg.readString(24, "skill name");
+ const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable);
+ const int oldLevel = PlayerInfo::getSkillLevel(skillId);
+ if (oldLevel && oldLevel != level)
+ updateSkill = skillId;
+ PlayerInfo::setSkillLevel(skillId, level);
+ if (skillDialog)
+ {
+ if (!skillDialog->updateSkill(skillId, range, up, inf, sp))
+ {
+ skillDialog->addSkill(SkillOwner::Player,
+ skillId, name, level, range, up, inf, sp);
+ }
+ skillDialog->update();
+ if (updateSkill)
+ skillDialog->playUpdateEffect(updateSkill);
+ }
+}
+
void SkillRecv::processSkillUpdate(Net::MessageIn &msg)
{
int updateSkill = 0;