From 83a6463a88b4b5eda003f55b419995c13476d917 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 6 Sep 2014 13:29:42 +0300 Subject: In skills add support for reading mana cost from server. --- src/net/ea/skillhandler.cpp | 7 ++++--- src/net/eathena/skillhandler.cpp | 6 +++--- src/net/tmwa/skillhandler.cpp | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/net') diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp index 8a7f42d82..19f7d4d63 100644 --- a/src/net/ea/skillhandler.cpp +++ b/src/net/ea/skillhandler.cpp @@ -79,7 +79,7 @@ void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg) { const int skillId = msg.readInt16(); const int level = msg.readInt16(); - msg.readInt16(); // sp + const int sp = msg.readInt16(); const int range = msg.readInt16(); const int up = msg.readUInt8(); @@ -88,10 +88,11 @@ void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg) PlayerInfo::setSkillLevel(skillId, level); if (skillDialog) { - if (!skillDialog->updateSkill(skillId, range, up, SkillType::Unknown)) + if (!skillDialog->updateSkill(skillId, range, + up, SkillType::Unknown, sp)) { skillDialog->addSkill(skillId, "", level, - range, up, SkillType::Unknown); + range, up, SkillType::Unknown, sp); } } } diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp index a66987f71..ef0b7d399 100644 --- a/src/net/eathena/skillhandler.cpp +++ b/src/net/eathena/skillhandler.cpp @@ -112,7 +112,7 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) const SkillType::SkillType inf = static_cast( msg.readInt32("inf")); const int level = msg.readInt16("skill level"); - msg.readInt16("sp"); + const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); const std::string name = msg.readString(24, "skill name"); const int up = msg.readUInt8("up flag"); @@ -122,8 +122,8 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) PlayerInfo::setSkillLevel(skillId, level); if (skillDialog) { - if (!skillDialog->updateSkill(skillId, range, up, inf)) - skillDialog->addSkill(skillId, name, level, range, up, inf); + if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) + skillDialog->addSkill(skillId, name, level, range, up, inf, sp); } } if (updateSkill && skillDialog) diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp index 65f86d4bc..da6a04b7e 100644 --- a/src/net/tmwa/skillhandler.cpp +++ b/src/net/tmwa/skillhandler.cpp @@ -113,7 +113,7 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) msg.readInt16()); msg.skip(2); // skill pool flags const int level = msg.readInt16(); - msg.readInt16(); // sp + const int sp = msg.readInt16(); const int range = msg.readInt16(); msg.skip(24); // 0 unused const int up = msg.readUInt8(); @@ -123,8 +123,8 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) PlayerInfo::setSkillLevel(skillId, level); if (skillDialog) { - if (!skillDialog->updateSkill(skillId, range, up, inf)) - skillDialog->addSkill(skillId, "", level, range, up, inf); + if (!skillDialog->updateSkill(skillId, range, up, inf, sp)) + skillDialog->addSkill(skillId, "", level, range, up, inf, sp); } } if (updateSkill && skillDialog) -- cgit v1.2.3-70-g09d2