diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-19 20:35:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-19 20:35:33 +0300 |
commit | 7f60ef4ea6e7af5781e31337001f2cce61099db7 (patch) | |
tree | 63570c6ad1283786907adbfdbf72b7274bd56151 /src/net/eathena/skillrecv.cpp | |
parent | acf778b75de41bd48757b94041b74268cb862158 (diff) | |
download | manaplus-7f60ef4ea6e7af5781e31337001f2cce61099db7.tar.gz manaplus-7f60ef4ea6e7af5781e31337001f2cce61099db7.tar.bz2 manaplus-7f60ef4ea6e7af5781e31337001f2cce61099db7.tar.xz manaplus-7f60ef4ea6e7af5781e31337001f2cce61099db7.zip |
Add packet SMSG_PLAYER_UPDATE_SKILL2 0x0b20.
Diffstat (limited to 'src/net/eathena/skillrecv.cpp')
-rw-r--r-- | src/net/eathena/skillrecv.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
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; |