Created
September 4, 2016 07:19
-
-
Save dagochen/d0000eb18e2a1c110b3ef75241d7385f to your computer and use it in GitHub Desktop.
Parry
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) | |
{ | |
tmp = parry_chance - skillBonus; | |
// check if unit _can_ parry | |
if ((pVictim->GetTypeId() == TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->ExtraFlags & CREATURE_EXTRA_FLAG_NO_PARRY)) && 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