Ejemplo n.º 1
0
  /**
   * 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);
      }
    }
  }
Ejemplo n.º 2
0
 public CharSelectInfoPackage(int objectId, String name) {
   setObjectId(objectId);
   _name = name;
   _paperdoll = PcInventory.restoreVisibleInventory(objectId);
 }