Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \src\server\game\Entities\Player\Player.cpp
- -- uint32 Player::GetShieldBlockValue() const
- ++ uint32 Player::GetShieldBlockValue(bool ForDamagingSpell) const
- {
- float value = (m_auraBaseMod[SHIELD_BLOCK_VALUE][FLAT_MOD] + GetStat(STAT_STRENGTH) * 0.5f - 10)*m_auraBaseMod[SHIELD_BLOCK_VALUE][PCT_MOD];
- if (ForDamagingSpell == true)
- {
- uint8 level = getLevel();
- uint16 softCap = level * 30;
- float hardCap = level * 34.5f;
- float hardCapBaseBlockValue = level * 39.5f;
- //If value less than softCap then don't have to modify.
- if(HasAura(2565)) //double BV if Shield Block active
- {
- if (value >= hardCapBaseBlockValue)
- value = hardCap * 2;
- else if (value > softCap)
- value = (softCap + 0.95f * (value - softCap) - 0.000625f * pow(value - softCap, 2)) *2 ;
- }
- else
- {
- if (value >= hardCapBaseBlockValue)
- value = hardCap;
- else if (value > softCap)
- value = softCap + 0.95f * (value - softCap) - 0.000625f * pow(value - softCap, 2);
- }
- }
- value = (value < 0) ? 0 : value;
- return uint32(value);
- }
- \src\server\game\Entities\Player\Player.h
- -- uint32 GetShieldBlockValue() const; // overwrite Unit version (virtual)
- ++ uint32 GetShieldBlockValue(bool ForDamagingSpell = false) const;
- \src\server\game\Entities\Unit\Unit.h
- -- virtual uint32 GetShieldBlockValue() const =0;
- ++ virtual uint32 GetShieldBlockValue(bool ForDamagingSpell = false) const =0;
- \src\server\game\Spells\SpellEffects.cpp
- -- damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(m_caster->GetShieldBlockValue())));
- ++ damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(m_caster->GetShieldBlockValue(true))));
- -- damage += CalculatePctN(m_caster->GetShieldBlockValue(), SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_1));
- ++ damage += CalculatePctN(m_caster->GetShieldBlockValue(true), SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement