summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/packetsin.inc1
-rw-r--r--src/net/eathena/skillrecv.cpp29
-rw-r--r--src/net/eathena/skillrecv.h1
3 files changed, 31 insertions, 0 deletions
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index eb92c6029..8e847a1cd 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -807,6 +807,7 @@ if (serverVersion > 0)
packet(SMSG_PLAYER_KILLED_BY, 0x0b1d, 6, &PlayerRecv::processKilledBy, 0);
packet(SMSG_SKILL_CASTING2, 0x0b1e, -1, &BeingRecv::processSkillCasting2, 0);
packet(SMSG_PLAYER_ADD_SKILL2, 0x0b1f, -1, &SkillRecv::processSkillAdd2, 0);
+ packet(SMSG_PLAYER_UPDATE_SKILL2, 0x0b20, -1, &SkillRecv::processSkillUpdate2, 0);
// char server
packet(SMSG_CHAR_PASSWORD_RESPONSE, 0x0062, 3, &LoginRecv::processCharPasswordResponse, 0);
diff --git a/src/net/eathena/skillrecv.cpp b/src/net/eathena/skillrecv.cpp
index 96764d2f8..1ce037ff5 100644
--- a/src/net/eathena/skillrecv.cpp
+++ b/src/net/eathena/skillrecv.cpp
@@ -191,6 +191,35 @@ void SkillRecv::processSkillUpdate(Net::MessageIn &msg)
}
}
+void SkillRecv::processSkillUpdate2(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 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, "", level, range, up, inf, sp);
+ }
+ skillDialog->update();
+ if (updateSkill)
+ skillDialog->playUpdateEffect(updateSkill);
+ }
+}
+
void SkillRecv::processSkillDelete(Net::MessageIn &msg)
{
int updateSkill = 0;
diff --git a/src/net/eathena/skillrecv.h b/src/net/eathena/skillrecv.h
index d192b717d..5b22b5a9f 100644
--- a/src/net/eathena/skillrecv.h
+++ b/src/net/eathena/skillrecv.h
@@ -39,6 +39,7 @@ namespace EAthena
void processSkillAdd(Net::MessageIn &msg);
void processSkillAdd2(Net::MessageIn &msg);
void processSkillUpdate(Net::MessageIn &msg);
+ void processSkillUpdate2(Net::MessageIn &msg);
void processSkillDelete(Net::MessageIn &msg);
void processSkillWarpPoint(Net::MessageIn &msg);
void processSkillMemoMessage(Net::MessageIn &msg);