summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-09 17:53:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-09 17:53:52 +0300
commit4fe5fd9a471760c8ce54c71c8cdf3f27c8fb27ae (patch)
tree4efae7d8e5ef3f60b5b8dd9231fa2770492908a0 /src/being/being.cpp
parent0de391b6566f347d546be4dc56999b3c502fa46b (diff)
downloadmanaverse-4fe5fd9a471760c8ce54c71c8cdf3f27c8fb27ae.tar.gz
manaverse-4fe5fd9a471760c8ce54c71c8cdf3f27c8fb27ae.tar.bz2
manaverse-4fe5fd9a471760c8ce54c71c8cdf3f27c8fb27ae.tar.xz
manaverse-4fe5fd9a471760c8ce54c71c8cdf3f27c8fb27ae.zip
On skill attacks on target for show effect use skill attribute skillHitEffectId.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index fbdd6fc79..71265d9ac 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -561,8 +561,11 @@ void Being::setSpeech(const std::string &text, const std::string &channel,
}
}
-void Being::takeDamage(Being *const attacker, const int amount,
- const AttackType::Type type, const int attackId)
+void Being::takeDamage(Being *const attacker,
+ const int amount,
+ const AttackType::Type type,
+ const int attackId,
+ const int level)
{
if (!userPalette || !attacker)
return;
@@ -705,7 +708,10 @@ void Being::takeDamage(Being *const attacker, const int amount,
if (effectManager)
{
- const int hitEffectId = getHitEffect(attacker, type, attackId);
+ const int hitEffectId = getHitEffect(attacker,
+ type,
+ attackId,
+ level);
if (hitEffectId >= 0)
effectManager->trigger(hitEffectId, this);
}
@@ -715,7 +721,9 @@ void Being::takeDamage(Being *const attacker, const int amount,
if (effectManager)
{
const int hitEffectId = getHitEffect(attacker,
- AttackType::MISS, attackId);
+ AttackType::MISS,
+ attackId,
+ level);
if (hitEffectId >= 0)
effectManager->trigger(hitEffectId, this);
}
@@ -724,7 +732,9 @@ void Being::takeDamage(Being *const attacker, const int amount,
}
int Being::getHitEffect(const Being *const attacker,
- const AttackType::Type type, const int attackId) const
+ const AttackType::Type type,
+ const int attackId,
+ const int level) const
{
if (!effectManager)
return 0;
@@ -781,8 +791,14 @@ int Being::getHitEffect(const Being *const attacker,
}
else
{
- // move skills effects to +100000 in effects list
hitEffectId = attackId + 100000;
+ SkillData *const data = skillDialog->getSkillDataByLevel(
+ attackId, level);
+ if (!data)
+ return -1;
+ hitEffectId = data->hitEffectId;
+ if (hitEffectId == -1)
+ hitEffectId = paths.getIntValue("skillHitEffectId");
}
BLOCK_END("Being::getHitEffect")
return hitEffectId;