Advertisement
elasticpwnz

Untitled

Mar 13th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1.     public static void calcSkillMastery(L2Skill skill, L2Character cha)
  2.     {
  3.         //Skill id 330 for fighters, 331 for mages
  4.         //Actually only GM can have 2 skill masteries, so let's make them more lucky ^^
  5.         if(cha.getSkillLevel(331) > 0 && cha.calcStat(Stats.SKILLMASTERY_RATE, cha.getINT(), null, null) >= Rnd.get(10000) || cha.getSkillLevel(330) > 0 && cha.calcStat(Stats.SKILLMASTERY_RATE, cha.getSTR(), null, null) >= Rnd.get(10000))
  6.         {
  7.             //byte mastery level, 0 = no skill mastery, 1 = no reuseTime, 2 = buff duration*2
  8.             byte masteryLevel;
  9.             if(skill.isBuff() && skill.getAbnormalTime() > 0 || skill.isSongDance()) //Hope i didn't forget skills to multiply their time
  10.                 masteryLevel = 2;
  11.             else
  12.                 masteryLevel = 1;
  13.  
  14.             if(masteryLevel > 0)
  15.                 cha.setSkillMastery(skill.getId(), masteryLevel);
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement