summaryrefslogtreecommitdiff
path: root/src/net/ea/skillhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-24 17:42:28 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-24 17:42:28 +0300
commit466829aef10af6b95d0f443226e8549f4399b567 (patch)
tree2b0e790cad32c16a7b283e82732820032efe9b91 /src/net/ea/skillhandler.cpp
parenta5f9e965323ad4b211405736eda7557cbe6a013a (diff)
downloadmv-466829aef10af6b95d0f443226e8549f4399b567.tar.gz
mv-466829aef10af6b95d0f443226e8549f4399b567.tar.bz2
mv-466829aef10af6b95d0f443226e8549f4399b567.tar.xz
mv-466829aef10af6b95d0f443226e8549f4399b567.zip
Add particle effect support for skill levelup.
New option skillLevelUpEffectId
Diffstat (limited to 'src/net/ea/skillhandler.cpp')
-rw-r--r--src/net/ea/skillhandler.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp
index 45177f7e6..5a7268a6e 100644
--- a/src/net/ea/skillhandler.cpp
+++ b/src/net/ea/skillhandler.cpp
@@ -81,6 +81,7 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
{
msg.readInt16(); // length
const int skillCount = (msg.getLength() - 4) / 37;
+ int updateSkill = 0;
for (int k = 0; k < skillCount; k++)
{
@@ -92,7 +93,9 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
const int range = msg.readInt16();
msg.skip(24); // 0 unused
const int up = msg.readInt8();
-
+ const int oldLevel = PlayerInfo::getStatBase(skillId);
+ if (oldLevel && oldLevel != level)
+ updateSkill = skillId;
PlayerInfo::setStatBase(skillId, level);
if (skillDialog)
{
@@ -100,6 +103,8 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg)
skillDialog->addSkill(skillId, level, range, up);
}
}
+ if (updateSkill && skillDialog)
+ skillDialog->playUpdateEffect(updateSkill);
}
void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg)
@@ -110,6 +115,8 @@ void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg)
const int range = msg.readInt16();
const int up = msg.readInt8();
+ if (skillDialog && PlayerInfo::getStatBase(skillId) != level)
+ skillDialog->playUpdateEffect(skillId);
PlayerInfo::setStatBase(skillId, level);
if (skillDialog)
{