summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/skilldata.h3
-rw-r--r--src/gui/windows/skilldialog.cpp18
2 files changed, 18 insertions, 3 deletions
diff --git a/src/gui/widgets/skilldata.h b/src/gui/widgets/skilldata.h
index 943aa929c..5885b1ba9 100644
--- a/src/gui/widgets/skilldata.h
+++ b/src/gui/widgets/skilldata.h
@@ -39,9 +39,12 @@ struct SkillData final
std::string particle;
std::string invokeCmd;
+
SoundInfo soundHit;
SoundInfo soundMiss;
+ int updateEffectId;
+
SkillData();
A_DELETE_COPY(SkillData)
~SkillData();
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index bbefbd5a7..2804b8734 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -366,6 +366,8 @@ void SkillDialog::loadXmlFile(const std::string &fileName)
node, "soundMissDelay", 0);
data->invokeCmd = XML::getProperty(
node, "invokeCmd", "");
+ data->updateEffectId = XML::getProperty(
+ node, "levelUpEffectId", -1);
skill->addData(level, data);
}
@@ -576,14 +578,24 @@ void SkillDialog::updateQuest(const int var, const int val)
void SkillDialog::playUpdateEffect(const int id) const
{
- const int effectId = paths.getIntValue("skillLevelUpEffectId");
- if (!effectManager || effectId == -1)
+ if (!effectManager)
return;
const SkillMap::const_iterator it = mSkills.find(id);
if (it != mSkills.end())
{
- if (it->second)
+ SkillInfo *const info = it->second;
+ if (info)
+ {
+ const SkillData *const data = info->data;
+ if (!data)
+ return;
+ int effectId = data->updateEffectId;
+ if (effectId == -1)
+ effectId = paths.getIntValue("skillLevelUpEffectId");
+ if (effectId == -1)
+ return;
effectManager->trigger(effectId, localPlayer);
+ }
}
}