Created
September 4, 2016 07:25
-
-
Save dagochen/3f8d25a4ec3ac9879ab167e445736022 to your computer and use it in GitHub Desktop.
Parry 2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parry chances | |
// check if attack comes from behind, nobody can parry or block if attacker is behind | |
if (!from_behind && (pVictim->GetTypeId() == TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->ExtraFlags & CREATURE_EXTRA_FLAG_NO_PARRY))) | |
{ | |
tmp = parry_chance - skillBonus; | |
// check if unit _can_ parry | |
if (roll < (sum += tmp)) | |
{ | |
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "RollMeleeOutcomeAgainst: PARRY %d)", tmp); | |
return MELEE_HIT_PARRY; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment