Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1.     [PropertyCalculator(eProperty.StunDuration)]
  2.     public class StunDurationPercentCalculator : PropertyCalculator
  3.     {
  4.         public override int CalcValue(GameLiving living, eProperty property)
  5.         {
  6.             int percent = 100
  7.                 - living.BaseBuffBonusCategory[(int)property] // buff reduce the duration
  8.                 + living.DebuffCategory[(int)property]
  9.                 - living.ItemBonus[(int)property]
  10.                 - living.AbilityBonus[(int)property];
  11.  
  12.             if (living.HasAbility(Abilities.Stoicism))
  13.                 percent -= 25;
  14.  
  15.             return Math.Max(1, percent);
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement