Skip to content

Commit

Permalink
Correct defense value used for crushing.
Browse files Browse the repository at this point in the history
Consider actual defense skill of victim, not the base skill of that
level
Unless the defense skill is higher then base skill for that level, then
use base skill for that level
  • Loading branch information
Phatcat committed Jun 28, 2016
1 parent d9a6f14 commit 9c97643
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/game/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2815,11 +2815,13 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* pVictim, WeaponAttackT
return MELEE_HIT_CRIT;
}

tmp = (victimDefenseSkill < victimMaxSkillValueForLevel) ? victimDefenseSkill : victimMaxSkillValueForLevel;

// mobs can score crushing blows if they're 4 or more levels above victim
// having defense above your maximum (from items, talents etc.) has no effect
// mob's level * 5 - player's current defense skill - add 2% chance per lacking skill point, min. is 20%
if ((getLevel() - 4) >= pVictim->getLevel() && !IsNonMeleeSpellCasted(false) /* It should have been !spellCasted but wrath doesn't have that? */
&& roll < (tmp = (((attackerMaxSkillValueForLevel - victimMaxSkillValueForLevel) * 200) - 2000)))
&& roll < (tmp = (((attackerMaxSkillValueForLevel - tmp) * 200) - 2000)))
{
uint32 typeId = GetTypeId();
/* It should have been !(((Creature*)this)->GetCreatureInfo()->ExtraFlags & CREATURE_EXTRA_FLAG_NO_CRUSH) but wrath doesn't have that? */
Expand Down

0 comments on commit 9c97643

Please sign in to comment.