Example #1
0
 public static final boolean hasSpecialIngredient(int id, long amount, L2PcInstance player) {
   switch (id) {
     case CLAN_REPUTATION:
       if (player.getClan() == null) {
         player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER);
         break;
       }
       if (!player.isClanLeader()) {
         player.sendPacket(SystemMessageId.ONLY_THE_CLAN_LEADER_IS_ENABLED);
         break;
       }
       if (player.getClan().getReputationScore() < amount) {
         player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_SCORE_IS_TOO_LOW);
         break;
       }
       return true;
     case FAME:
       if (player.getFame() < amount) {
         player.sendPacket(SystemMessageId.NOT_ENOUGH_FAME_POINTS);
         break;
       }
       return true;
   }
   return false;
 }
Example #2
0
 public static final void giveSpecialProduct(int id, long amount, L2PcInstance player) {
   switch (id) {
     case CLAN_REPUTATION:
       player.getClan().addReputationScore((int) amount, true);
       break;
     case FAME:
       player.setFame((int) (player.getFame() + amount));
       player.sendPacket(new UserInfo(player));
       player.sendPacket(new ExBrExtraUserInfo(player));
       break;
   }
 }
Example #3
0
 public static final boolean takeSpecialIngredient(int id, long amount, L2PcInstance player) {
   switch (id) {
     case CLAN_REPUTATION:
       player.getClan().takeReputationScore((int) amount, true);
       SystemMessage smsg =
           SystemMessage.getSystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
       smsg.addLong(amount);
       player.sendPacket(smsg);
       return true;
     case FAME:
       player.setFame(player.getFame() - (int) amount);
       player.sendPacket(new UserInfo(player));
       player.sendPacket(new ExBrExtraUserInfo(player));
       return true;
   }
   return false;
 }