Esempio n. 1
0
  @Override
  public void onBypassFeedback(Player player, String command) {
    if (!canBypassCheck(player, this)) {
      return;
    }

    if (command.startsWith("start1")) {
      // тут пропускам т.к. это первый этаж, и перемещение на него == вход в инстанс
    } 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);
    }
  }
Esempio n. 2
0
  @Override
  public void onBypassFeedback(Player player, String command) {
    if (!canBypassCheck(player, this)) return;

    if (command.startsWith("ExitSoloKama")) {
      Reflection r = getReflection();
      if (r.getReturnLoc() != null)
        player.teleToLocation(r.getReturnLoc(), ReflectionManager.DEFAULT);
      else player.setReflection(ReflectionManager.DEFAULT);
      player.unsetVar("backCoords");
      r.startCollapseTimer(1000);
    } else if (command.startsWith("ListPossible")) {
      if (getNpcId() == 32484
          && Config.ALT_KAMALOKA_NIGHTMARES_PREMIUM_ONLY
          && !player.hasBonus()) {
        showChatWindow(player, "instance/soloKamaloka/32484-no.htm");
        return;
      }
      // FIXME [G1ta0] исправить, когда будет реализованы индивидуальные параметры спавна
      DomainArea domain = MapRegionManager.getInstance().getRegionData(DomainArea.class, this);
      String htmlpath = "instance/soloKamaloka/" + getNpcId();
      if (domain != null)
        switch (domain.getId()) {
          case 1: // Town of Gludio
            htmlpath += "-gludio";
            break;
          case 2: // Town of Dion
            htmlpath += "-dion";
            break;
          case 4: // Town of Oren
            htmlpath += "-oren";
            break;
          case 6: // Heine
            htmlpath += "-heine";
            break;
          case 8: // Rune Township
            htmlpath += "-rune";
            break;
          case 9: // Town of Schuttgart
            htmlpath += "-schuttgart";
            break;
        }
      htmlpath += ".htm";
      showChatWindow(player, htmlpath);
    } else if (command.startsWith("ShowResults")) {
      String htmlpath = "instance/soloKamaloka/" + getNpcId();
      switch (getRewardRank()) {
        case 0:
          htmlpath += "-F";
          break;
        case 1:
          htmlpath += "-D";
          break;
        case 2:
          htmlpath += "-C";
          break;
        case 3:
          htmlpath += "-B";
          break;
        case 4:
          htmlpath += "-A";
          break;
        case 5:
          htmlpath += "-S";
          break;
        case 6:
          if (getReflection().getInstancedZoneId()
              == INSTANCE_75LVL_ID) // G-Grade награда доступна только в соло камалоке 70-80
            // уровней.
            htmlpath += "-G";
          else htmlpath += "-S";
          break;
      }
      htmlpath += ".htm";
      showChatWindow(player, htmlpath);
    } else if (command.startsWith("SoloKamaReward")) {
      if (!_rewarded) {
        int[][] rewards = getRewardList(getRewardRank(), getReflection().getInstancedZone());
        if (rewards != null)
          for (int[] item : rewards)
            if (item != null) {
              int id = item[0];
              int count = item[1];
              if (id > 0 && count > 0) Functions.addItem(player, id, count);
            }

        _rewarded = true;
      }

      showChatWindow(player, 1);
    } else if (command.startsWith("Chat"))
      try {
        int val = Integer.parseInt(command.substring(5));
        showChatWindow(player, val);
      } catch (NumberFormatException nfe) {
        String filename = command.substring(5).trim();
        if (filename.length() == 0) showChatWindow(player, "npcdefault.htm");
        else showChatWindow(player, filename);
      }
    else if (command.startsWith("solo_kamaloka")) {
      int val = Integer.parseInt(command.substring(14));
      Reflection r = player.getActiveReflection();
      if (r != null) {
        if (player.canReenterInstance(val)) player.teleToLocation(r.getTeleportLoc(), r);
      } else if (player.canEnterInstance(val)) {
        ReflectionUtils.enterReflection(player, new KamalokaNightmare(player), val);
      }
    } else super.onBypassFeedback(player, command);
  }