예제 #1
0
 /**
  * Removing all buffs from player and pet except BUFFS_WHITELIST
  *
  * @param ch player
  */
 private static final void removeBuffs(L2Character ch) {
   for (L2Effect e : ch.getAllEffects()) {
     if (e == null) continue;
     L2Skill skill = e.getSkill();
     if (skill.isDebuff() || skill.isStayAfterDeath()) continue;
     if (Arrays.binarySearch(BUFFS_WHITELIST, skill.getId()) >= 0) continue;
     e.exit();
   }
   if (ch.getPet() != null) {
     for (L2Effect e : ch.getPet().getAllEffects()) {
       if (e == null) continue;
       L2Skill skill = e.getSkill();
       if (skill.isDebuff() || skill.isStayAfterDeath()) continue;
       if (Arrays.binarySearch(BUFFS_WHITELIST, skill.getId()) >= 0) continue;
       e.exit();
     }
   }
 }