From Cobalt Pheasant, 2 Years ago, written in Diff-output.
Embed
  1. diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
  2. index 59001fc..9b29b3f 100644
  3. --- a/src/server/game/Entities/Unit/StatSystem.cpp
  4. +++ b/src/server/game/Entities/Unit/StatSystem.cpp
  5. @@ -118,15 +118,28 @@ bool Player::UpdateStats(Stats stat)
  6.  
  7.  void Player::UpdatePvpPower()
  8.  {
  9. -    float precision = 100.0f;
  10. +    uint16 DamagePct, HealPct = 0;
  11. +    
  12. +    if (GetActiveSpec() == IsHealSpecType())
  13. +    {
  14. +        HealPct = 100;
  15. +    }
  16. +    else if (GetActiveSpec() == HaveHealOffSpecType())
  17. +    {
  18. +        DamagePct = 100;
  19. +        HealPct = 70;
  20. +    }
  21. +    else
  22. +    {
  23. +        DamagePct = 100;
  24. +        HealPct = 40;
  25. +    }
  26. +
  27.      float value = GetRatingBonusValue(CR_PVP_POWER);
  28.      value += GetTotalAuraModifier(SPELL_AURA_MOD_RATING);
  29. -
  30. -    float pvpHealing = value / precision;
  31. -    float pvpDamage = value / precision;
  32. -
  33. -    SetFloatValue(PLAYER_FIELD_PVP_POWER_HEALING, pvpHealing);
  34. -    SetFloatValue(PLAYER_FIELD_PVP_POWER_DAMAGE, pvpDamage);
  35. +    
  36. +    SetFloatValue(PLAYER_FIELD_PVP_POWER_HEALING, CalculatePct(value, HealPct));
  37. +    SetFloatValue(PLAYER_FIELD_PVP_POWER_DAMAGE, CalculatePct(value, DamagePct));
  38.  }
  39.  
  40.  void Player::ApplySpellPowerBonus(int32 amount, bool apply)
  41.  
  42.  
  43. diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
  44. index 86a5fba..8d54df4 100644
  45. --- a/src/server/game/Entities/Player/Player.h
  46. +++ b/src/server/game/Entities/Player/Player.h
  47. @@ -2150,6 +2150,10 @@ class Player : public Unit, public GridObject<Player>
  48.      uint32 GetRoleForGroup(uint32 specializationId);
  49.      float GetMasterySpellCoefficient() const;
  50.  
  51. +    uint32 IsHealSpecType() const { return SPEC_PRIEST_HOLY || SPEC_PRIEST_DISCIPLINE || SPEC_PALADIN_HOLY || SPEC_DRUID_RESTORATION || SPEC_MONK_MISTWEAVER || SPEC_SHAMAN_RESTORATION; }
  52. +    uint32 HaveHealOffSpecType() const { return SPEC_PRIEST_SHADOW || SPEC_PALADIN_RETRIBUTION || SPEC_SHAMAN_ELEMENTAL || SPEC_SHAMAN_ENHANCEMENT || SPEC_MONK_WINDWALKER || SPEC_DRUID_BALANCE || SPEC_DRUID_FERAL; }
  53. +    uint32 IsTankSpecType() const { return SPEC_DEATH_KNIGHT_BLOOD || SPEC_DRUID_GUARDIAN || SPEC_MONK_BREWMASTER || SPEC_PALADIN_PROTECTION || SPEC_WARRIOR_PROTECTION; }
  54. +
  55.      void SendInspectResult(Player const* player);
  56.  
  57.      bool ResetTalents(bool noCost = false, bool resetTalents = true, bool resetSpecialization = true);