void Player::UpdateDodgePercentage() { const float dodge_cap[MAX_CLASSES] = { 65.631440f, // Warrior 65.631440f, // Paladin 145.560408f, // Hunter 145.560408f, // Rogue 150.375940f, // Priest 65.631440f, // DK 145.560408f, // Shaman 150.375940f, // Mage 150.375940f, // Warlock 145.560408f, // Monk 116.890707f // Druid }; float diminishing = 0.0f, nondiminishing = 0.0f; GetDodgeFromAgility(diminishing, nondiminishing); // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); // Dodge from rating diminishing += GetRatingBonusValue(CR_DODGE); // apply diminishing formula to diminishing dodge chance uint32 pclass = getClass()-1; float value = nondiminishing + (diminishing * dodge_cap[pclass] / (diminishing + dodge_cap[pclass] * m_diminishing_k[pclass])); if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE)) value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value; value = value < 0.0f ? 0.0f : value; SetStatFloatValue(PLAYER_FIELD_DODGE_PERCENTAGE, value); }
void Player::UpdateDodgePercentage() { const float dodge_cap[MAX_CLASSES] = { 88.129021f, // Warrior 88.129021f, // Paladin 145.560408f, // Hunter 145.560408f, // Rogue 150.375940f, // Priest 88.129021f, // DK 145.560408f, // Shaman 150.375940f, // Mage 150.375940f, // Warlock 0.0f, // ?? 116.890707f // Druid }; float diminishing = 0.0f, nondiminishing = 0.0f; GetDodgeFromAgility(diminishing, nondiminishing); // Modify value from defense skill (only bonus from defense rating diminishes) nondiminishing += (GetSkillValue(SKILL_DEFENSE) - GetMaxSkillValueForLevel()) * 0.04f; diminishing += (int32(GetRatingBonusValue(CR_DEFENSE_SKILL))) * 0.04f; // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); // Dodge from rating diminishing += GetRatingBonusValue(CR_DODGE); // apply diminishing formula to diminishing dodge chance uint32 pclass = getClass()-1; float value = nondiminishing + (diminishing * dodge_cap[pclass] / (diminishing + dodge_cap[pclass] * m_diminishing_k[pclass])); value = value < 0.0f ? 0.0f : value; SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value); }
void Player::UpdateDodgePercentage() { // Base dodge float value = (getClass() < MAX_CLASSES) ? PLAYER_BASE_DODGE[getClass()] : 0.0f; // Dodge from agility value += GetDodgeFromAgility(GetStat(STAT_AGILITY)); // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura value += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); // Dodge from rating value += GetRatingBonusValue(CR_DODGE); // Set current dodge chance m_modDodgeChance = value; // Set value for diminishing when in combat m_modDodgeChanceDiminishing = GetDodgeFromAgility((GetStat(STAT_AGILITY) - (GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT]))); m_modDodgeChanceDiminishing += GetRatingBonusValue(CR_DODGE); // Set UI display value: modify value from defense skill against same level target value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f; SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, std::max(0.0f, std::min(value, 100.0f))); }
void Player::UpdateDodgePercentage() { // Dodge from agility float value = GetDodgeFromAgility(); // Modify value from defense skill value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f; // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura value += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); value = value < 0.0f ? 0.0f : value; SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value); }