Exemplo n.º 1
0
  /**
   * Method checkAllDestroyed.
   *
   * @return boolean
   */
  private static boolean checkAllDestroyed() {
    if (!GameObjectsStorage.getAllByNpcId(25600, true).isEmpty()) {
      return false;
    }

    if (!GameObjectsStorage.getAllByNpcId(25601, true).isEmpty()) {
      return false;
    }

    if (!GameObjectsStorage.getAllByNpcId(25602, true).isEmpty()) {
      return false;
    }

    return true;
  }
Exemplo n.º 2
0
  /**
   * Method onBypassFeedback.
   *
   * @param npc NpcInstance
   * @param player Player
   * @param command String
   * @see lineage2.gameserver.handlers.IBypassHandler#onBypassFeedback(NpcInstance, Player, String)
   */
  @Override
  public void onBypassFeedback(NpcInstance npc, Player player, String command) {
    int val = Integer.parseInt(command.substring(16));
    NpcInstance npcInst = GameObjectsStorage.getByNpcId(val);

    if (npcInst != null) {
      player.sendPacket(new RadarControl(2, 2, npcInst.getLoc()));
      player.sendPacket(new RadarControl(0, 1, npcInst.getLoc()));
    }
  }
Exemplo n.º 3
0
  /**
   * Method onTimeElapsed.
   *
   * @param task ExecutedTask
   */
  @Override
  public void onTimeElapsed(ExecutedTask task) {
    _log.info("Recommendation Global Task: launched.");

    for (Player player : GameObjectsStorage.getAllPlayersForIterate()) {
      player.restartRecom();
    }

    _log.info("Recommendation Global Task: completed.");
  }
Exemplo n.º 4
0
 void checkInRadius(int id, QuestState st, NpcInstance npc) {
   NpcInstance quest0457 = GameObjectsStorage.getByNpcId(id);
   if (npc.getRealDistance3D(quest0457) <= 150.0D) {
     st.setCond(2);
     if (_followTask != null) {
       _followTask.cancel(false);
     }
     _followTask = null;
     npc.stopMove();
   }
 }
Exemplo n.º 5
0
  @Override
  public void onBypassFeedback(Player player, String command) {
    if (!canBypassCheck(player, this)) {
      return;
    }

    if (command.startsWith("start1")) {
      Reflection r = player.getActiveReflection();
      if (r != null) {
        if (player.canReenterInstance(instanceId)) {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      } else if (player.canEnterInstance(193)) {
        ReflectionUtils.enterReflection(player, new AltarShilen(), instanceId);
      }
    } else if (command.startsWith("start2")) {

      for (Player party : GameObjectsStorage.getAllPlayersForIterate()) {
        party.unsetVar("Altar1");
        party.setVar("Altar2", "true", -1);
        party.teleToLocation(FLOOR2, player.getReflection());
      }
    } else if (command.startsWith("start3")) {
      for (Player party : GameObjectsStorage.getAllPlayersForIterate()) {
        party.unsetVar("Altar2");
        party.setVar("Altar3", "true", -1);
        party.teleToLocation(FLOOR3, player.getReflection());
      }

    } else if (command.startsWith("exit")) {
      for (Player party : GameObjectsStorage.getAllPlayersForIterate()) {
        party.unsetVar("Altar3");
        party.teleToLocation(OFF, 0);
      }
    } else {
      super.onBypassFeedback(player, command);
    }
  }
Exemplo n.º 6
0
 /** Method runImpl. */
 @Override
 public void runImpl() {
   for (NpcInstance npc : GameObjectsStorage.getAllByNpcId(TeleportCube, true)) {
     npc.deleteMe();
   }
 }
 /**
  * Method announce.
  *
  * @param sm SystemMessage
  */
 private void announce(SystemMessage sm) {
   for (Player player : GameObjectsStorage.getAllPlayersForIterate()) {
     player.sendPacket(sm);
   }
 }