aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-31 16:49:29 -0700
committermaximius <none@none>2009-10-31 16:49:29 -0700
commitd2e138afaf6248483e50df6fdbe3fa6a434453bc (patch)
tree98acd8e86bab0ad545e437531d3a236c89388281 /src/game/Unit.cpp
parent72ed3ff12d4069436c2ff99f3b18fdd80e691c0c (diff)
*Apply SPELL_AURA_MOD_EXPERTISE in related hit chance calculations, thanks Sisif
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 70ecf782e37..88bc426aa2a 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -2319,6 +2319,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
// Reduce dodge chance by attacker expertise rating
if (GetTypeId() == TYPEID_PLAYER)
dodge_chance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100);
+ else
+ dodge_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25;
// Modify dodge chance by attacker SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
dodge_chance+= GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE)*100;
@@ -2345,7 +2347,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
{
// Reduce parry chance by attacker expertise rating
if (GetTypeId() == TYPEID_PLAYER)
- parry_chance-= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100);
+ parry_chance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType)*100);
+ else
+ parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25;
if(pVictim->GetTypeId() == TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY) )
{
@@ -2738,7 +2742,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
dodgeChance = int32 (float (dodgeChance) * GetTotalAuraMultiplier(SPELL_AURA_MOD_ENEMY_DODGE));
// Reduce dodge chance by attacker expertise rating
if (GetTypeId() == TYPEID_PLAYER)
- dodgeChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
+ dodgeChance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
+ else
+ dodgeChance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25;
if (dodgeChance < 0)
dodgeChance = 0;
@@ -2753,7 +2759,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
int32 parryChance = int32(pVictim->GetUnitParryChance()*100.0f) - skillDiff * 4;
// Reduce parry chance by attacker expertise rating
if (GetTypeId() == TYPEID_PLAYER)
- parryChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
+ parryChance -= int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
+ else
+ parryChance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE)*25;
if (parryChance < 0)
parryChance = 0;