[11434] Implemented diminishing returns (DR) for dodge and parry chances.

Also updated base dodge and agility=>dodge conversion values for 3.2 and later

Base stats and percentage based talents/buffs are not affected by DR,
it basically prevents items and stat buffs becoming disproportionally
powerful in terms of survivability as characters approach 100% avoidance.

TODO: implement DR for chance to be missed from defense rating
This commit is contained in:
Lynx3d 2011-05-07 20:11:58 +02:00
parent 8807af4a18
commit 3f531024f7
4 changed files with 109 additions and 43 deletions

View file

@ -5100,35 +5100,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, // Paladin
-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
};
uint32 level = getLevel();
@ -5136,13 +5138,17 @@ 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()