Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. float Player::GetDodgeChance()
  2. {
  3.     uint32 pClass = (uint32)getClass();
  4.     float chance;
  5.  
  6.     // Base dodge chance
  7.     chance = baseDodge[pClass];
  8.  
  9.     // Dodge from agility
  10.     chance += float( GetStat(STAT_AGILITY) / dodgeRatio[getLevel()-1][pClass] );
  11.  
  12.     // Dodge from dodge rating
  13.     chance += CalcRating( PLAYER_RATING_MODIFIER_DODGE );
  14.  
  15.     // Dodge from spells
  16.     chance += GetDodgeFromSpell();
  17.  
  18.     return max( chance, 0.0f ); // Make sure we don't have a negative chance
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement