Advertisement
hitplusone

block value cap

Jul 6th, 2011
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.98 KB | None | 0 0
  1. \src\server\game\Entities\Player\Player.cpp
  2. -- uint32 Player::GetShieldBlockValue() const
  3. ++ uint32 Player::GetShieldBlockValue(bool ForDamagingSpell) const
  4. {
  5.     float value = (m_auraBaseMod[SHIELD_BLOCK_VALUE][FLAT_MOD] + GetStat(STAT_STRENGTH) * 0.5f - 10)*m_auraBaseMod[SHIELD_BLOCK_VALUE][PCT_MOD];
  6.  
  7.         if (ForDamagingSpell == true)
  8.         {
  9.             uint8 level = getLevel();
  10.             uint16 softCap = level * 30;
  11.             float hardCap = level * 34.5f;
  12.             float hardCapBaseBlockValue = level * 39.5f;
  13.  
  14.             //If value less than softCap then don't have to modify.
  15.            
  16.             if(HasAura(2565)) //double BV if Shield Block active
  17.             {  
  18.                 if (value >= hardCapBaseBlockValue)
  19.                     value = hardCap * 2;
  20.                 else if (value > softCap)
  21.                     value = (softCap + 0.95f * (value - softCap) - 0.000625f * pow(value - softCap, 2)) *2 ;
  22.             }
  23.             else
  24.             {
  25.                 if (value >= hardCapBaseBlockValue)
  26.                     value = hardCap;
  27.                 else if (value > softCap)
  28.                     value = softCap + 0.95f * (value - softCap) - 0.000625f * pow(value - softCap, 2);
  29.             }
  30.            
  31.         }
  32.  
  33.     value = (value < 0) ? 0 : value;
  34.  
  35.     return uint32(value);
  36. }
  37.  
  38. \src\server\game\Entities\Player\Player.h
  39. -- uint32 GetShieldBlockValue() const;                 // overwrite Unit version (virtual)
  40. ++ uint32 GetShieldBlockValue(bool ForDamagingSpell = false) const;
  41.  
  42. \src\server\game\Entities\Unit\Unit.h
  43. -- virtual uint32 GetShieldBlockValue() const =0;
  44. ++ virtual uint32 GetShieldBlockValue(bool ForDamagingSpell = false) const =0;
  45.  
  46. \src\server\game\Spells\SpellEffects.cpp
  47. -- damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(m_caster->GetShieldBlockValue())));
  48. ++ damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(m_caster->GetShieldBlockValue(true))));
  49.  
  50. -- damage += CalculatePctN(m_caster->GetShieldBlockValue(), SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_1));
  51. ++ damage += CalculatePctN(m_caster->GetShieldBlockValue(true), SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement