summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-19 19:42:47 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-19 20:13:22 +0300
commitacf778b75de41bd48757b94041b74268cb862158 (patch)
tree3c17abcca25e3a87bec3e0e3ff589e880ed1a16a /src/net/eathena
parent5220fbf360d8fed37f62e9b1cff88fe69c2e7615 (diff)
downloadplus-acf778b75de41bd48757b94041b74268cb862158.tar.gz
plus-acf778b75de41bd48757b94041b74268cb862158.tar.bz2
plus-acf778b75de41bd48757b94041b74268cb862158.tar.xz
plus-acf778b75de41bd48757b94041b74268cb862158.zip
Add packet SMSG_PLAYER_ADD_SKILL2 0x0b1f.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/packetsin.inc1
-rw-r--r--src/net/eathena/skillrecv.cpp30
-rw-r--r--src/net/eathena/skillrecv.h1
3 files changed, 32 insertions, 0 deletions
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index f5b9d5885..eb92c6029 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -806,6 +806,7 @@ if (serverVersion > 0)
packet(SMSG_NPC_SKIN, 0x0b1c, -1, &NpcRecv::processNpcSkin, 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);
// 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 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;
diff --git a/src/net/eathena/skillrecv.h b/src/net/eathena/skillrecv.h
index d40477ab5..d192b717d 100644
--- a/src/net/eathena/skillrecv.h
+++ b/src/net/eathena/skillrecv.h
@@ -37,6 +37,7 @@ namespace EAthena
void processSkillCoolDown(Net::MessageIn &msg);
void processSkillCoolDownList(Net::MessageIn &msg);
void processSkillAdd(Net::MessageIn &msg);
+ void processSkillAdd2(Net::MessageIn &msg);
void processSkillUpdate(Net::MessageIn &msg);
void processSkillDelete(Net::MessageIn &msg);
void processSkillWarpPoint(Net::MessageIn &msg);