Implement player's pet resilience, also fix DoT case. by VladimirMangos and thx tali

--HG--
branch : trunk
This commit is contained in:
n0n4m3 committed 2009-12-19 18:46:51 +01:00
1 parent 5f0c623f8a
commit 1d79bc51ea
6 files changed
+81 -93

No files matched your search

-50
View File
@@ -5124,56 +5124,6 @@ float Player::GetRatingBonusValue(CombatRating cr) const
return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) / GetRatingCoefficient(cr);
}
uint32 Player::GetMeleeCritDamageReduction(uint32 damage) const
{
float melee = GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*2.2f;
if (melee>33.0f) melee = 33.0f;
return uint32 (melee * damage /100.0f);
}
uint32 Player::GetMeleeDamageReduction(uint32 damage) const
{
float rate = GetRatingBonusValue(CR_CRIT_TAKEN_MELEE);
// Resilience not limited (limit it by 100%)
if (rate > 100.0f)
rate = 100.0f;
return uint32 (rate * damage / 100.0f);
}
uint32 Player::GetRangedCritDamageReduction(uint32 damage) const
{
float ranged = GetRatingBonusValue(CR_CRIT_TAKEN_RANGED)*2.2f;
if (ranged>33.0f) ranged=33.0f;
return uint32 (ranged * damage /100.0f);
}
uint32 Player::GetRangedDamageReduction(uint32 damage) const
{
float rate = GetRatingBonusValue(CR_CRIT_TAKEN_RANGED);
// Resilience not limited (limit it by 100%)
if (rate > 100.0f)
rate = 100.0f;
return uint32 (rate * damage / 100.0f);
}
uint32 Player::GetSpellCritDamageReduction(uint32 damage) const
{
float spell = GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2.2f;
// In wow script resilience limited to 33%
if (spell>33.0f)
spell = 33.0f;
return uint32 (spell * damage / 100.0f);
}
uint32 Player::GetSpellDamageReduction(uint32 damage) const
{
float rate = GetRatingBonusValue(CR_CRIT_TAKEN_SPELL);
// Resilience not limited (limit it by 100%)
if (rate > 100.0f)
rate = 100.0f;
return uint32 (rate * damage / 100.0f);
}
float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
{
switch (attType)