/**
   * That method drops current alliance and retrograde badge.<br>
   * If any Varka quest is in progress, it stops the quest (and drop all related qItems) :
   *
   * @param player The player to check.
   */
  private static void testKetraDemote(L2PcInstance player) {
    if (player.isAlliedWithKetra()) {
      // Drop the alliance (old friends become aggro).
      player.setAllianceWithVarkaKetra(0);

      final PcInventory inventory = player.getInventory();

      // Drop by 1 the level of that alliance (symbolized by a quest item).
      for (int i = 7215; i >= 7211; i--) {
        L2ItemInstance item = inventory.getItemByItemId(i);
        if (item != null) {
          // Destroy the badge.
          player.destroyItemByItemId("Quest", i, item.getCount(), player, true);

          // Badge lvl 1 ; no addition of badge of lower level.
          if (i != 7211) player.addItem("Quest", i - 1, 1, player, true);

          break;
        }
      }

      for (String mission : ketraMissions) {
        QuestState pst = player.getQuestState(mission);
        if (pst != null) pst.exitQuest(true);
      }
    }
  }
Example #2
0
  /**
   * @see
   *     net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.actor.L2Playable,
   *     net.sf.l2j.gameserver.model.L2ItemInstance)
   */
  public void useItem(L2Playable playable, L2ItemInstance item) {
    if (!(playable instanceof L2PcInstance)) return;

    playable.sendPacket(new ShowMiniMap(item.getItemId()));
  }