Merge pull request #2931 from Chaplain/cleanup
Core/Mechanic: Implement Diminishing Returns for miss\parry\dodge. Original author for parry\dodge case Lynx3d.
This commit is contained in:
@@ -5755,35 +5755,37 @@ float Player::GetMeleeCritFromAgility()
|
||||
return crit*100.0f;
|
||||
}
|
||||
|
||||
float Player::GetDodgeFromAgility()
|
||||
void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing)
|
||||
{
|
||||
// Table for base dodge values
|
||||
float dodge_base[MAX_CLASSES] = {
|
||||
0.0075f, // Warrior
|
||||
0.00652f, // Paladin
|
||||
-0.0545f, // Hunter
|
||||
-0.0059f, // Rogue
|
||||
0.03183f, // Priest
|
||||
0.0114f, // DK
|
||||
0.0167f, // Shaman
|
||||
0.034575f, // Mage
|
||||
0.02011f, // Warlock
|
||||
const float dodge_base[MAX_CLASSES] =
|
||||
{
|
||||
0.036640f, // Warrior
|
||||
0.034943f, // Paladi
|
||||
-0.040873f, // Hunter
|
||||
0.020957f, // Rogue
|
||||
0.034178f, // Priest
|
||||
0.036640f, // DK
|
||||
0.021080f, // Shaman
|
||||
0.036587f, // Mage
|
||||
0.024211f, // Warlock
|
||||
0.0f, // ??
|
||||
-0.0187f // Druid
|
||||
0.056097f // Druid
|
||||
};
|
||||
// Crit/agility to dodge/agility coefficient multipliers
|
||||
float crit_to_dodge[MAX_CLASSES] = {
|
||||
1.1f, // Warrior
|
||||
1.0f, // Paladin
|
||||
1.6f, // Hunter
|
||||
2.0f, // Rogue
|
||||
1.0f, // Priest
|
||||
1.0f, // DK?
|
||||
1.0f, // Shaman
|
||||
1.0f, // Mage
|
||||
1.0f, // Warlock
|
||||
0.0f, // ??
|
||||
1.7f // Druid
|
||||
// Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15%
|
||||
const float crit_to_dodge[MAX_CLASSES] =
|
||||
{
|
||||
0.85f/1.15f, // Warrior
|
||||
1.00f/1.15f, // Paladin
|
||||
1.11f/1.15f, // Hunter
|
||||
2.00f/1.15f, // Rogue
|
||||
1.00f/1.15f, // Priest
|
||||
0.85f/1.15f, // DK
|
||||
1.60f/1.15f, // Shaman
|
||||
1.00f/1.15f, // Mage
|
||||
0.97f/1.15f, // Warlock (?)
|
||||
0.0f, // ??
|
||||
2.00f/1.15f // Druid
|
||||
};
|
||||
|
||||
uint8 level = getLevel();
|
||||
@@ -5792,13 +5794,18 @@ float Player::GetDodgeFromAgility()
|
||||
if (level > GT_MAX_LEVEL)
|
||||
level = GT_MAX_LEVEL;
|
||||
|
||||
// Dodge per agility for most classes equal crit per agility (but for some classes need apply some multiplier)
|
||||
// Dodge per agility is proportional to crit per agility, which is available from DBC files
|
||||
GtChanceToMeleeCritEntry const *dodgeRatio = sGtChanceToMeleeCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
|
||||
if (dodgeRatio == NULL || pclass > MAX_CLASSES)
|
||||
return 0.0f;
|
||||
return;
|
||||
|
||||
float dodge=dodge_base[pclass-1] + GetStat(STAT_AGILITY) * dodgeRatio->ratio * crit_to_dodge[pclass-1];
|
||||
return dodge*100.0f;
|
||||
// TODO: research if talents/effects that increase total agility by x% should increase non-diminishing part
|
||||
float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
|
||||
float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
|
||||
|
||||
// calculate diminishing (green in char screen) and non-diminishing (white) contribution
|
||||
diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1];
|
||||
nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
|
||||
}
|
||||
|
||||
float Player::GetSpellCritFromIntellect()
|
||||
|
||||
@@ -1875,7 +1875,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void UpdateDefenseBonusesMod();
|
||||
inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
|
||||
float GetMeleeCritFromAgility();
|
||||
float GetDodgeFromAgility();
|
||||
void GetDodgeFromAgility(float &diminishing, float &nondiminishing);
|
||||
float GetMissPercentageFromDefence() const;
|
||||
float GetSpellCritFromIntellect();
|
||||
float OCTRegenHPPerSpirit();
|
||||
float OCTRegenMPPerSpirit();
|
||||
|
||||
Reference in New Issue
Block a user