Ejemplo n.º 1
0
 public String DialogAppend_30827(Integer val) {
   if (val == 0) {
     Player player = getSelf();
     return player.isLangRus()
         ? "<br>[scripts_services.RideHire:ride_prices|Взять на прокат ездовое животное.]"
         : "<br>[scripts_services.RideHire:ride_prices|Ride hire mountable pet.]";
   }
   return "";
 }
Ejemplo n.º 2
0
  public void rideOver() {
    Player player = getSelf();
    if (player == null) return;

    unRide(player);
    show(
        player.isLangRus()
            ? "Время проката закончилось. Приходите еще!"
            : "Ride time is over.<br><br>Welcome back again!",
        player);
  }
Ejemplo n.º 3
0
  private static boolean CheckCondition(Player player) {
    if (player == null) {
      return false;
    }

    if (player.isInOlympiadMode()) {
      if (player.isLangRus()) {
        player.sendMessage("Во время Олимпиады нельзя использовать данную функцию.");
      } else {
        player.sendMessage("During the Olympics you can not use this feature.");
      }
      return false;
    }

    if (player.getReflection().getId() != 0 && !Config.COMMUNITYBOARD_INSTANCE_ENABLED) {
      if (player.isLangRus()) {
        player.sendMessage("Сервис доступен только в обычном мире.");
      } else {
        player.sendMessage("Service is only available in the real world.");
      }
      return false;
    }
    return true;
  }
Ejemplo n.º 4
0
  public void ride(String[] args) {
    Player player = getSelf();
    NpcInstance npc = getNpc();
    if (player == null || npc == null) return;

    boolean ru = player.isLangRus();
    if (args.length != 3) {
      show(ru ? "Некорректные данные" : "Incorrect input", player, npc);
      return;
    }

    if (!NpcInstance.canBypassCheck(player, npc)) return;

    if (player.getActiveWeaponFlagAttachment() != null) {
      player.sendPacket(Msg.YOU_CANNOT_MOUNT_BECAUSE_YOU_DO_NOT_MEET_THE_REQUIREMENTS);
      return;
    }

    if (player.getTransformation() != 0) {
      show(
          ru
              ? "Вы не можете взять пета в прокат, пока находитесь в режиме трансформации."
              : "Can't ride while in transformation mode.",
          player,
          npc);
      return;
    }

    if (player.getSummonList().size() > 0 || player.isMounted()) {
      player.sendPacket(Msg.YOU_ALREADY_HAVE_A_PET);
      return;
    }

    int npc_id;

    switch (Integer.parseInt(args[0])) {
      case 1:
        npc_id = PetDataTable.WYVERN_ID;
        break;
      case 2:
        npc_id = PetDataTable.STRIDER_WIND_ID;
        break;
      case 3:
        npc_id = PetDataTable.WGREAT_WOLF_ID;
        break;
      case 4:
        npc_id = PetDataTable.WFENRIR_WOLF_ID;
        break;
      default:
        show(ru ? "У меня нет таких питомцев!" : "Unknown pet.", player, npc);
        return;
    }

    if ((npc_id == PetDataTable.WYVERN_ID || npc_id == PetDataTable.STRIDER_WIND_ID)
        && !SiegeUtils.getCanRide()) {
      show(
          ru
              ? "Прокат виверн/страйдеров не работает во время осады."
              : "Can't ride wyvern/strider while Siege in progress.",
          player,
          npc);
      return;
    }

    Integer time = Integer.parseInt(args[1]);
    Long price = Long.parseLong(args[2]);

    if (time > 1800) {
      show(ru ? "Слишком большое время." : "Too long time to ride.", player, npc);
      return;
    }

    if (player.getAdena() < price) {
      player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
      return;
    }

    player.reduceAdena(price, true);

    doLimitedRide(player, npc_id, time);
  }