[6984] Update crushing blow chance calculation for 3.0.3.

Required 4 level difference.
Player also can crushing blow if controlled and then considered as creature.
This commit is contained in:
VladimirMangos 2008-12-30 03:58:52 +03:00
parent 71c67a5202
commit 3f397ed035
2 changed files with 8 additions and 4 deletions

View file

@ -2036,10 +2036,14 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
}
}
if ((GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !((Creature*)this)->isPet()))
// mobs can score crushing blows if they're 4 or more levels above victim
if (getLevelForTarget(pVictim) >= pVictim->getLevelForTarget(this) + 4 &&
// can be from by creature (if can) or from controlled player that considered as creature
(GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->isPet() &&
!(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) ||
GetTypeId()==TYPEID_PLAYER && GetCharmerOrOwnerGUID()))
{
// mobs can score crushing blows if they're 3 or more levels above victim
// or when their weapon skill is 15 or more above victim's defense skill
// when their weapon skill is 15 or more above victim's defense skill
tmp = victimDefenseSkill;
int32 tmpmax = victimMaxSkillValueForLevel;
// having defense above your maximum (from items, talents etc.) has no effect