aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiberate <tbaart@gmail.com>2011-10-19 13:00:22 +0200
committerLiberate <tbaart@gmail.com>2011-10-19 13:00:22 +0200
commitb268b51d0ef991b73c140a680aebca582fc10e00 (patch)
tree288c8426cf91bccf567d37be6468b78a96e5e425 /src
parent8f8949fcf0cfaca286c723ab60e94b62f04998a6 (diff)
Core/Spells: Add Block Value cap to Shield Slam and Shield of Righteousness.
Fixes #599 Fixes #2119
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h14
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp10
2 files changed, 22 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index d35298b9963..064542bb013 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1503,6 +1503,20 @@ class Unit : public WorldObject
}
virtual uint32 GetShieldBlockValue() const =0;
+ uint32 GetShieldBlockValue(uint32 soft_cap, uint32 hard_cap) const
+ {
+ uint32 value = GetShieldBlockValue();
+ if (value >= hard_cap)
+ {
+ value = (soft_cap + hard_cap) / 2;
+ }
+ else if (value > soft_cap)
+ {
+ value = soft_cap + ((value - soft_cap) / 2);
+ }
+
+ return value;
+ }
uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
uint32 GetDefenseSkillValue(Unit const* target = NULL) const;
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 8d68569ecb1..bffe9a1871a 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -456,7 +456,11 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
// Shield Slam
else if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
- damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(m_caster->GetShieldBlockValue())));
+ {
+ uint8 level = m_caster->getLevel();
+ uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f));
+ damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(block_value)));
+ }
// Victory Rush
else if (m_spellInfo->SpellFamilyFlags[1] & 0x100)
ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
@@ -716,7 +720,9 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
// Shield of Righteousness
if (m_spellInfo->SpellFamilyFlags[EFFECT_1] & 0x100000)
{
- damage += CalculatePctN(m_caster->GetShieldBlockValue(), m_spellInfo->Effects[EFFECT_1].CalcValue());
+ uint8 level = m_caster->getLevel();
+ uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 29.5f), uint32(float(level) * 39.5f));
+ damage += CalculatePctN(block_value, m_spellInfo->Effects[EFFECT_1].CalcValue());
break;
}
break;