@Override
  public String onTalk(L2Npc npc, QuestState st) {
    int npcId = npc.getNpcId();
    int cond = st.getCond();
    L2PcInstance player = st.getPlayer();

    if (npcId == Rafforty) {
      switch (st.getState()) {
        case COMPLETED:
          return "repre_q10283_02.htm";
        case CREATED:
          QuestState prevst = player.getQuestState(_00115_TheOtherSideOfTruth.class);
          return player.getLevel() < 82 || prevst == null || !prevst.isCompleted()
              ? "repre_q10283_03.htm"
              : "repre_q10283_01.htm";
        case STARTED:
          switch (cond) {
            case 1:
              return "repre_q10283_06.htm";
            case 2:
              return "repre_q10283_10.htm";
          }
      }
    }
    return getNoQuestMsg(player);
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(getClass());
    if (st == null) {
      return getNoQuestMsg(player);
    }

    switch (event) {
      case "31331-0.html":
        st.startQuest();
        break;
      case "31331-1.html":
        st.set("raid", "1");
        player.sendPacket(new RadarControl(0, 2, 186304, -43744, -3193));
        break;
      case "31331-2.html":
        st.set("raid", "2");
        player.sendPacket(new RadarControl(0, 2, 134672, -115600, -1216));
        break;
      case "31331-3.html":
        st.set("raid", "3");
        player.sendPacket(new RadarControl(0, 2, 170000, -60000, -3500));
        break;
      case "31331-4.html":
        st.set("raid", "4");
        player.sendPacket(new RadarControl(0, 2, 93296, -75104, -1824));
        break;
      case "31331-5.html":
        st.exitQuest(QuestType.REPEATABLE);
        break;
    }
    return event;
  }
  @Override
  public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) {
    QuestState st = killer.getQuestState(getClass());

    if (npc == null || st == null) {
      return null;
    }

    if (st.getCond() == 1) {
      if (ArrayUtils.contains(ДревниеГерои, npc.getNpcId())) {
        if (killer.getParty() == null) {
          st.giveItem(ПроклятаяСлизь);
          st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
          if (st.getQuestItemsCount(ПроклятаяСлизь) >= 8) {
            st.setCond(2);
            st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
          }
        } else {
          QuestState pst = killer.getParty().getRandomPartyMember().getQuestState(getClass());
          if (pst != null && pst.getCond() == 1) {
            pst.giveItem(ПроклятаяСлизь);
            pst.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
            if (pst.getQuestItemsCount(ПроклятаяСлизь) >= 8) {
              pst.setCond(2);
              pst.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
            }
          }
        }
      }
    }
    return super.onKill(npc, killer, isPet);
  }
Beispiel #4
0
  private void kill(L2PcInstance activeChar, L2Character target) {
    if (target instanceof L2PcInstance) {
      if (!target.isGM()) {
        target.stopAllEffects(); // e.g. invincibility effect
      }
      target.reduceCurrentHp(target.getMaxHp() + target.getMaxCp() + 1, activeChar, null);
    } else {
      boolean targetIsInvul = false;
      if (target.isInvul()) {
        targetIsInvul = true;
        target.setIsInvul(false);
      }

      target.reduceCurrentHp(target.getMaxHp() + 1, activeChar, null);

      if (targetIsInvul) {
        target.setIsInvul(true);
      }
    }
    if (Config.DEBUG) {
      _log.log(
          Level.DEBUG,
          "GM: "
              + activeChar.getName()
              + '('
              + activeChar.getObjectId()
              + ')'
              + " killed character "
              + target.getObjectId());
    }
  }
  @Override
  public String onTalk(L2Npc npc, QuestState st) {
    L2PcInstance player = st.getPlayer();

    if (npc.getNpcId() == Типия) {
      switch (st.getState()) {
        case COMPLETED:
          return "orbis_typia_q10318_03.htm";
        case CREATED:
          QuestState previous = player.getQuestState(_10317_OrbisWitch.class);
          if (previous == null || !previous.isCompleted() || player.getLevel() < 95) {
            st.exitQuest(QuestType.REPEATABLE);
            return "orbis_typia_q10318_02.htm";
          } else {
            return "orbis_typia_q10318_01.htm";
          }
        case STARTED:
          if (st.getCond() == 1) {
            return !st.hasQuestItems(ПроклятаяСлизь)
                ? "orbis_typia_q10318_08.htm"
                : "orbis_typia_q10318_09.htm";
          } else if (st.getCond() == 2 && st.getQuestItemsCount(ПроклятаяСлизь) >= 8) {
            st.addExpAndSp(79260650, 36253450);
            st.giveAdena(5427900, true);
            st.playSound(QuestSound.ITEMSOUND_QUEST_FINISH);
            st.exitQuest(QuestType.ONE_TIME);
            return "orbis_typia_q10318_10.htm";
          }
      }
    }
    return getNoQuestMsg(player);
  }
 public ExValidateLocationInAirShip(L2PcInstance player) {
   _activeChar = player;
   shipId = _activeChar.getAirShip().getObjectId();
   x = player.getInVehiclePosition().getX();
   y = player.getInVehiclePosition().getY();
   z = player.getInVehiclePosition().getZ();
   h = player.getHeading();
 }
Beispiel #7
0
 public boolean isOnline() {
   if (_player == null || !_player.isOnline()) {
     return false;
   }
   if (_player.getClient() == null) {
     return false;
   }
   return !_player.getClient().isDetached();
 }
Beispiel #8
0
  @Override
  protected void runImpl() {
    L2PcInstance player = getClient().getActiveChar();
    if (player == null) {
      return;
    }
    if (player.getClan() == null) {
      player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER);
      return;
    }
    if (!player.isClanLeader()) {
      player.sendPacket(SystemMessageId.ONLY_CLAN_LEADER_WITHDRAW_ALLY);
      return;
    }
    L2Clan clan = player.getClan();
    if (clan.getAllyId() == 0) {
      player.sendPacket(SystemMessageId.NO_CURRENT_ALLIANCES);
      return;
    }
    if (clan.getClanId() == clan.getAllyId()) {
      player.sendPacket(SystemMessageId.ALLIANCE_LEADER_CANT_WITHDRAW);
      return;
    }

    long currentTime = System.currentTimeMillis();
    clan.setAllyId(0);
    clan.setAllyName(null);
    clan.changeAllyCrest(0, true);
    clan.setAllyPenaltyExpiryTime(
        currentTime + Config.ALT_ALLY_JOIN_DAYS_WHEN_LEAVED * 86400000L,
        L2Clan.PENALTY_TYPE_CLAN_LEAVED); // 24*60*60*1000 = 86400000
    clan.updateClanInDB();

    player.sendPacket(SystemMessageId.YOU_HAVE_WITHDRAWN_FROM_ALLIANCE);
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    QuestState st = player.getQuestState(getClass());
    if (st == null || player.getLevel() < 79) {
      return htmltext;
    }
    int cond = st.getCond();

    if (npc.getNpcId() == WOOD) {
      QuestState first = player.getQuestState(_00196_SevenSignSealOfTheEmperor.class);
      if (first != null
          && first.getState() == COMPLETED
          && st.getState() == CREATED
          && player.getLevel() >= 79) {
        htmltext = "32593-01.htm";
      } else if (cond == 0) {
        htmltext = "32593-00.htm";
        st.exitQuest(QuestType.REPEATABLE);
      } else if (cond == 1) {
        htmltext = "32593-05.htm";
      } else if (cond == 6) {
        htmltext = "32593-06.htm";
      }
    } else if (npc.getNpcId() == ORVEN) {
      if (cond == 1) {
        htmltext = "30857-01.htm";
      } else if (cond == 2) {
        htmltext = "30857-05.htm";
      }
    } else if (npc.getNpcId() == LEOPARD) {
      if (cond == 2) {
        htmltext = "32594-01.htm";
      } else if (cond == 3) {
        htmltext = "32594-04.htm";
      }
    } else if (npc.getNpcId() == LAWRENCE) {
      if (cond == 3) {
        htmltext = "32595-01.htm";
      } else if (cond == 4) {
        htmltext = "32595-05.htm";
      } else if (cond == 5) {
        htmltext = "32595-09.htm";
      }
    } else if (npc.getNpcId() == SOFIA) {
      if (cond == 5) {
        htmltext = "32596-01.htm";
      } else if (cond == 6) {
        htmltext = "32596-05.htm";
      }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(getClass());
    if (st == null) {
      return null;
    }

    switch (event) {
      case "32593-04.htm":
        st.startQuest();
        break;
      case "30857-04.htm":
        st.setCond(2);
        st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
        break;
      case "32594-03.htm":
        st.setCond(3);
        st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
        break;
      case "32595-04.htm":
        L2Npc monster = addSpawn(SHILENSEVIL, 152520, -57685, -3438, 0, false, 60000, true);
        monster.broadcastPacket(
            new NS(
                monster.getObjectId(),
                ChatType.NPC_ALL,
                monster.getNpcId(),
                NpcStringId.YOU_ARE_NOT_THE_OWNER_OF_THAT_ITEM));
        monster.setRunning();
        monster.getAttackable().attackCharacter(player);
        break;
      case "32595-08.htm":
        st.setCond(5);
        st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
        break;
      case "32596-04.htm":
        st.setCond(6);
        st.giveItems(TEXT, 1);
        st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
        break;
      case "32593-08.htm":
        if (player.isSubClassActive()) {
          return "subclass_forbidden.htm";
        }
        st.takeItems(TEXT, 1);
        st.takeItems(SCULPTURE, 1);
        st.addExpAndSp(10000000, 2500000);
        st.unset("cond");
        st.exitQuest(QuestType.ONE_TIME);
        st.playSound(QuestSound.ITEMSOUND_QUEST_FINISH);
        break;
    }
    return event;
  }
  @Override
  protected void runImpl() {
    L2PcInstance player = getClient().getActiveChar();
    if (player == null || !player.getOlympiadController().isHero()) {
      return;
    }

    if (_heroWords == null || _heroWords.length() > 300) {
      return;
    }

    HeroManager.getInstance().setHeroMessage(player, _heroWords);
  }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   QuestState st = player.getQuestState(getClass());
   if (st == null) {
     return getNoQuestMsg(player);
   }
   if (event.equalsIgnoreCase("glyvka_q0134_03.htm") && st.getState() == CREATED) {
     st.startQuest();
   } else if (event.equalsIgnoreCase("glyvka_q0134_06.htm") && st.getState() == STARTED) {
     st.setCond(2);
     st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
   } else if (event.equalsIgnoreCase("glyvka_q0134_11.htm")
       && st.getState() == STARTED
       && st.getCond() == 5) {
     st.playSound(QuestSound.ITEMSOUND_QUEST_FINISH);
     st.unset("Report");
     st.giveAdena(15100, true);
     st.giveItems(Badge_Temple_Missionary, 1);
     st.addExpAndSp(30000, 2000);
     st.exitQuest(QuestType.ONE_TIME);
   } else if (event.equalsIgnoreCase("scroll_seller_rouke_q0134_03.htm")
       && st.getState() == STARTED) {
     st.setCond(3);
     st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
   } else if (event.equalsIgnoreCase("scroll_seller_rouke_q0134_09.htm")
       && st.getState() == STARTED
       && st.getInt("Report") == 1) {
     st.setCond(5);
     st.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
     st.giveItems(Roukes_Report, 1);
     st.unset("Report");
   }
   return event;
 }
Beispiel #13
0
  public String getApprenticeOrSponsorName() {
    if (_player != null) {
      _apprentice = _player.getApprentice();
      _sponsor = _player.getSponsor();
    }

    if (_apprentice != 0) {
      L2ClanMember apprentice = _clan.getClanMember(_apprentice);
      return apprentice != null ? apprentice.getName() : "Error";
    }
    if (_sponsor != 0) {
      L2ClanMember sponsor = _clan.getClanMember(_sponsor);
      return sponsor != null ? sponsor.getName() : "Error";
    }
    return "";
  }
Beispiel #14
0
 public L2ClanMember(L2Clan clan, L2PcInstance player) {
   _clan = clan;
   _name = player.getName();
   _level = player.getLevel();
   _classId = player.getBaseClassId();
   _objectId = player.getObjectId();
   _pledgeType = player.getPledgeType();
   _powerGrade = player.getPowerGrade();
   _title = player.getTitle();
   _sponsor = 0;
   _apprentice = 0;
   _sex = player.getAppearance().getSex();
   _raceOrdinal = player.getRace().ordinal();
 }
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    if (player.getClan() == null) {
      return null;
    }

    QuestState st = null;

    if (player.isClanLeader()) {
      st = player.getQuestState(getClass());
    } else {
      L2PcInstance pleader = player.getClan().getLeader().getPlayerInstance();
      if (pleader != null && player.isInsideRadius(pleader, 1500, true, false)) {
        st = pleader.getQuestState(getClass());
      }
    }

    if (st != null && st.isStarted()) {
      int raid = st.getInt("raid");
      if (REWARD_POINTS.containsKey(raid)) {
        if (npc.getNpcId() == REWARD_POINTS.get(raid)[0]
            && !st.hasQuestItems(REWARD_POINTS.get(raid)[1])) {
          st.rewardItems(REWARD_POINTS.get(raid)[1], 1);
          st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
        }
      }
    }
    return null;
  }
 @Override
 protected void writeImpl() {
   writeD(_activeChar.getObjectId());
   writeD(shipId);
   writeD(x);
   writeD(y);
   writeD(z);
   writeD(h);
 }
Beispiel #17
0
 public void setPledgeType(int pledgeType) {
   _pledgeType = pledgeType;
   if (_player != null) {
     _player.setPledgeType(pledgeType);
   } else {
     // db save if char not logged in
     updatePledgeType();
   }
 }
Beispiel #18
0
 /** @param powerGrade */
 public void setPowerGrade(int powerGrade) {
   _powerGrade = powerGrade;
   if (_player != null) {
     _player.setPowerGrade(powerGrade);
   } else {
     // db save if char not logged in
     updatePowerGrade();
   }
 }
 @Override
 protected void runImpl() {
   L2PcInstance player = getClient().getActiveChar();
   if (player == null) {
     return;
   }
   FastList<String> manorsName = new FastList<>();
   manorsName.add("gludio");
   manorsName.add("dion");
   manorsName.add("giran");
   manorsName.add("oren");
   manorsName.add("aden");
   manorsName.add("innadril");
   manorsName.add("goddard");
   manorsName.add("rune");
   manorsName.add("schuttgart");
   ExSendManorList manorlist = new ExSendManorList(manorsName);
   player.sendPacket(manorlist);
 }
  @Override
  public String onTalk(L2Npc npc, QuestState st) {
    L2PcInstance player = st.getPlayer();
    int npcId = npc.getNpcId();
    QuestStateType id = st.getState();
    if (npcId == WILBERT && id == CREATED) {
      if (player.getLevel() >= 50) {
        return "Wilbert_start.htm";
      } else {

        st.exitQuest(QuestType.REPEATABLE);
        return "<html><body>Этот квест доступен персонажам, достигшим 50 уровня.</body></html>";
      }
    }
    if (npcId == WILBERT && id == STARTED) {
      return "Wilbert_QuestInProgress.htm";
    }
    return null;
  }
 @Override
 public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
   QuestState st = player.getQuestState(getClass());
   if (st == null) {
     return null;
   }
   if (npc.getNpcId() == SHILENSEVIL && st.getCond() == 3) {
     npc.broadcastPacket(
         new NS(
                 npc.getObjectId(),
                 ChatType.NPC_ALL,
                 npc.getNpcId(),
                 NpcStringId.S1_YOU_MAY_HAVE_WON_THIS_TIME_BUT_NEXT_TIME_I_WILL_SURELY_CAPTURE_YOU)
             .addStringParameter(player.getName()));
     st.giveItems(SCULPTURE, 1);
     st.setCond(4);
   }
   return null;
 }
  @Override
  public String onTalk(L2Npc npc, QuestState st) {
    L2PcInstance player = st.getPlayer();

    L2Clan clan = player.getClan();

    switch (st.getState()) {
      case CREATED:
        return clan == null || !player.isClanLeader() || clan.getLevel() < 6
            ? "31331-0a.htm"
            : "31331-0b.htm";
      case STARTED:
        if (clan == null || !player.isClanLeader()) {
          st.exitQuest(QuestType.REPEATABLE);
          return "31331-6.html";
        }

        int raid = st.getInt("raid");

        if (REWARD_POINTS.containsKey(raid)) {
          if (st.hasQuestItems(REWARD_POINTS.get(raid)[1])) {
            st.playSound(QuestSound.ITEMSOUND_QUEST_FANFARE_1);
            st.takeItems(REWARD_POINTS.get(raid)[1], -1);
            clan.addReputationScore(REWARD_POINTS.get(raid)[2], true);
            player.sendPacket(
                SystemMessage.getSystemMessage(
                        SystemMessageId.CLAN_QUEST_COMPLETED_AND_S1_POINTS_GAINED)
                    .addNumber(REWARD_POINTS.get(raid)[2]));
            clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
            return "31331-" + raid + "b.html";
          } else {
            return "31331-" + raid + "a.html";
          }
        } else {
          return "31331-0.html";
        }
    }
    return null;
  }
  @Override
  public String onTalk(L2Npc npc, QuestState st) {
    L2PcInstance player = st.getPlayer();

    if (st.isNowAvailable() && st.isCompleted()) {
      st.setState(CREATED);
    }
    switch (st.getState()) {
      case CREATED:
        return player.getLevel() >= 82 ? "32768-01.htm" : "32768-nolvl.htm";
      case STARTED:
        if (st.getCond() == 1) {
          return "32768-12.htm";
        }
        if (st.getCond() == 2) {
          return "32768-13.htm";
        }
        break;
      case COMPLETED:
        return "32768-noday.htm";
    }
    return null;
  }
Beispiel #24
0
  @Override
  public String onAsk(L2PcInstance player, L2Npc npc, int ask, int reply) {
    if (npc.getNpcId() == NPC) {
      if (ask == 100) {
        if (reply == 1) {
          if (player.getItemsCount(Shield) > 0) {
            if (player.getAdenaCount() >= 5000) {
              player.exchangeItemsById(ProcessType.NPC, npc, Shield, 1, ShieldImproved, 1, true);
              player.getInventory().reduceAdena(ProcessType.NPC, 5000, player, npc);
              return "orbis_rykus009.htm";
            } else {
              return "orbis_rykus011.htm";
            }
          } else {
            return "orbis_rykus012.htm";
          }
        } else if (reply == 2) {
          long shieldsCount = player.getItemsCount(Shield);
          long adenaCount = player.getAdenaCount();

          if (shieldsCount > 0) {
            long availableShields = adenaCount / 5000;
            if (availableShields > 0) {
              player.exchangeItemsById(
                  ProcessType.NPC,
                  npc,
                  Shield,
                  availableShields,
                  ShieldImproved,
                  availableShields,
                  true);
              player
                  .getInventory()
                  .reduceAdena(ProcessType.NPC, 5000 * availableShields, player, npc);
              return "orbis_rykus010.htm";
            } else {
              return "orbis_rykus011.htm";
            }
          } else {
            return "orbis_rykus012.htm";
          }
        }
      }
    }
    return null;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(getClass());

    if (st == null) {
      return event;
    }

    if (npc.getNpcId() == EDRIC) {
      if (event.equalsIgnoreCase("32527-05.htm")) {
        st.startQuest();
        st.unset("timeDiff"); // if any
      }
    }
    return event;
  }
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    QuestState st = player.getQuestState(getClass());
    if (st == null) {
      return null;
    }

    int npcId = npc.getNpcId();
    if (ArrayUtils.contains(MOBS, npcId)) {
      if (st.getState() == STARTED) {
        st.dropQuestItems(SPIRIT_BEAD, 1, -1, DROP_CHANCE, true);
      } else {
        return null;
      }
    }
    return super.onKill(npc, player, isPet);
  }
  @Override
  public String onTalk(L2Npc npc, QuestState st) {
    L2PcInstance player = st.getPlayer();

    if (npc.getNpcId() == EDRIC) {
      if (player.getLevel() < 75) {
        return "32527-00.htm";
      } else if (st.isCreated()) {
        return "32527-01.htm";
      } else if (player.isGM()) {
        st.startQuest();
        return "32527-10.html";
      } else if (st.getCond() == 1) {
        L2Party party = player.getParty();
        if (st.getInt("timeDiff") > 0) {
          if (giveReward(st, st.getInt("timeDiff"))) {
            // Clear quest
            st.unset("timeDiff");
            st.unset("cond");
            st.playSound(QuestSound.ITEMSOUND_QUEST_FINISH);
            st.exitQuest(QuestType.REPEATABLE);
            return "32527-reward.html";
          } else {
            // Clear quest
            st.unset("timeDiff");
            st.unset("cond");
            st.playSound(QuestSound.ITEMSOUND_QUEST_FINISH);
            st.exitQuest(QuestType.REPEATABLE);
            return "32527-noreward.html";
          }
        } else if (party == null) {
          return "32527-noparty.html";
        } else if (!party.getLeader().equals(player)) {
          return prepareHtml(player, "32527-noleader.html", party.getLeader().getName());
        } else {
          for (L2PcInstance pm : party.getMembers()) {
            QuestState state = pm.getQuestState(getClass());
            if (state == null || state.getCond() != 1) {
              return prepareHtml(player, "32527-noquest.html", pm.getName());
            }
          }
          return "32527-10.html";
        }
      }
    }
    return null;
  }
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    QuestState qs = player.getQuestState(getClass());
    if (qs == null) {
      return null;
    }

    if (qs.getState() == STARTED && qs.getCond() == 3) {
      if (npc.getNpcId() == Cruma_Marshlands_Traitor) {
        qs.giveItems(Giants_Technology_Report, 1);
        if (qs.getQuestItemsCount(Giants_Technology_Report) < 3) {
          qs.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
        } else {
          qs.playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
          qs.setCond(4);
        }
      } else if (qs.getQuestItemsCount(Giants_Experimental_Tool) < 1) {
        if (Rnd.getChance(Giants_Experimental_Tool_Fragment_chance)) {
          qs.giveItems(Giants_Experimental_Tool_Fragment, 1);
        }
      } else {
        qs.takeItems(Giants_Experimental_Tool, 1);
        if (Rnd.getChance(Cruma_Marshlands_Traitor_spawnchance)) {
          qs.addSpawn(
              Cruma_Marshlands_Traitor,
              qs.getPlayer().getX(),
              qs.getPlayer().getY(),
              qs.getPlayer().getZ(),
              0,
              true,
              900000);
        }
      }
    }
    return null;
  }
Beispiel #29
0
  @Override
  public boolean useAdminCommand(String command, L2PcInstance activeChar) {
    if (activeChar == null || !activeChar.getPcAdmin().canUseAdminCommand()) {
      return false;
    }

    if (command.startsWith("admin_kill")) {
      StringTokenizer st = new StringTokenizer(command, " ");
      st.nextToken(); // skip command

      if (st.hasMoreTokens()) {
        String firstParam = st.nextToken();
        L2PcInstance plyr = WorldManager.getInstance().getPlayer(firstParam);
        if (plyr != null) {
          if (st.hasMoreTokens()) {
            try {
              int radius = Integer.parseInt(st.nextToken());
              for (L2Character knownChar : plyr.getKnownList().getKnownCharactersInRadius(radius)) {
                if (knownChar instanceof L2ControllableMobInstance
                    || knownChar.equals(activeChar)) {
                  continue;
                }

                kill(activeChar, knownChar);
              }

              activeChar.sendMessage("Killed all characters within a " + radius + " unit radius.");
              return true;
            } catch (NumberFormatException e) {
              activeChar.sendMessage("Invalid radius.");
              return false;
            }
          } else {
            kill(activeChar, plyr);
          }
        } else {
          try {
            int radius = Integer.parseInt(firstParam);

            for (L2Character knownChar :
                activeChar.getKnownList().getKnownCharactersInRadius(radius)) {
              if (knownChar instanceof L2ControllableMobInstance || knownChar.equals(activeChar)) {
                continue;
              }
              kill(activeChar, knownChar);
            }

            activeChar.sendMessage("Killed all characters within a " + radius + " unit radius.");
            return true;
          } catch (NumberFormatException e) {
            activeChar.sendMessage("Usage: //kill <player_name | radius>");
            return false;
          }
        }
      } else {
        L2Object obj = activeChar.getTarget();
        if (obj instanceof L2ControllableMobInstance || !(obj instanceof L2Character)) {
          activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
        } else {
          kill(activeChar, (L2Character) obj);
        }
      }
    }
    return true;
  }
  @Override
  public String onAsk(L2PcInstance player, L2Npc npc, int ask, int reply) {
    int ownerId;
    if (ask == -1724) {
      switch (reply) {
        case 1: // Взойти на корабль
          if (player.isTransformed()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_TRANSFORMED);
            return null;
          }
          if (player.isParalyzed()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_PETRIFIED);
            return null;
          }
          if (player.isDead() || player.isFakeDeath()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_DEAD);
            return null;
          }
          if (player.isFishing()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_FISHING);
            return null;
          }
          if (player.isInCombat()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_IN_BATTLE);
            return null;
          }
          if (player.isInDuel()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_IN_A_DUEL);
            return null;
          }
          if (player.isSitting()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_SITTING);
            return null;
          }
          if (player.isCastingNow()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_CASTING);
            return null;
          }
          if (player.isCursedWeaponEquipped()) {
            player.sendPacket(
                SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_A_CURSED_WEAPON_IS_EQUIPPED);
            return null;
          }
          if (player.isCombatFlagEquipped()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_HOLDING_A_FLAG);
            return null;
          }
          if (!player.getPets().isEmpty() || player.isMounted()) {
            player.sendPacket(
                SystemMessageId.YOU_CANNOT_BOARD_AN_AIRSHIP_WHILE_A_PET_OR_A_SERVITOR_IS_SUMMONED);
            return null;
          }
          if (player.isFlyingMounted()) {
            player.sendPacket(SystemMessageId.YOU_CANNOT_BOARD_NOT_MEET_REQUEIREMENTS);
            return null;
          }

          if (_dockedShip != null) {
            _dockedShip.addPassenger(player);
          }
          break;
        case 2: // Призвать корабль
          if (_dockedShip != null) {
            if (_dockedShip.isOwner(player)) {
              player.sendPacket(SystemMessageId.THE_AIRSHIP_IS_ALREADY_EXISTS);
            }
            return null;
          }
          if (_isBusy) {
            player.sendPacket(SystemMessageId.ANOTHER_AIRSHIP_ALREADY_SUMMONED);
            return null;
          }
          if ((player.getClanPrivileges() & L2Clan.CP_CL_SUMMON_AIRSHIP)
              != L2Clan.CP_CL_SUMMON_AIRSHIP) {
            player.sendPacket(SystemMessageId.THE_AIRSHIP_NO_PRIVILEGES);
            return null;
          }
          ownerId = player.getClanId();
          if (!AirShipManager.getInstance().hasAirShipLicense(ownerId)) {
            player.sendPacket(SystemMessageId.THE_AIRSHIP_NEED_LICENSE_TO_SUMMON);
            return null;
          }
          if (AirShipManager.getInstance().hasAirShip(ownerId)) {
            player.sendPacket(SystemMessageId.THE_AIRSHIP_ALREADY_USED);
            return null;
          }
          if (!player.destroyItemByItemId(ProcessType.CONSUME, STARSTONE, SUMMON_COST, npc, true)) {
            player.sendPacket(
                SystemMessage.getSystemMessage(SystemMessageId.THE_AIRSHIP_NEED_MORE_S1)
                    .addItemName(STARSTONE));
            return null;
          }

          _isBusy = true;
          L2AirShipInstance ship =
              AirShipManager.getInstance()
                  .getNewAirShip(_shipSpawnX, _shipSpawnY, _shipSpawnZ, _shipHeading, ownerId);
          if (ship != null) {
            if (_arrivalPath != null) {
              ship.executePath(_arrivalPath);
            }

            if (_arrivalMessage == null) {
              _arrivalMessage =
                  new NS(
                      npc.getObjectId(),
                      ChatType.SHOUT,
                      npc.getNpcId(),
                      NpcStringId
                          .THE_AIRSHIP_HAS_BEEN_SUMMONED_IT_WILL_AUTOMATICALLY_DEPART_IN_5_MINUTES);
            }

            npc.broadcastPacket(_arrivalMessage);
          } else {
            _isBusy = false;
          }
          break;
        case 3: // Подать заявку
          if (player.getClan() == null || player.getClan().getLevel() < 5) {
            player.sendPacket(SystemMessageId.THE_AIRSHIP_NEED_CLANLVL_5_TO_SUMMON);
            return null;
          }
          if (!player.isClanLeader()) {
            player.sendPacket(SystemMessageId.THE_AIRSHIP_NO_PRIVILEGES);
            return null;
          }
          ownerId = player.getClanId();
          if (AirShipManager.getInstance().hasAirShipLicense(ownerId)) {
            player.sendPacket(SystemMessageId.THE_AIRSHIP_SUMMON_LICENSE_ALREADY_ACQUIRED);
            return null;
          }
          if (!player.destroyItemByItemId(ProcessType.CONSUME, LICENSE, 1, npc, true)) {
            player.sendPacket(
                SystemMessage.getSystemMessage(SystemMessageId.THE_AIRSHIP_NEED_MORE_S1)
                    .addItemName(STARSTONE));
            return null;
          }

          AirShipManager.getInstance().registerLicense(ownerId);
          player.sendPacket(SystemMessageId.THE_AIRSHIP_SUMMON_LICENSE_ENTERED);
          break;
      }
    } else if (ask == -2011) {
      switch (reply) {
        case 1: // Отправиться в Семя Бессмертия
          player.teleToLocation(-212808, 209672, 4257);
          return null;
        case 2: // Отправиться в Семя Разрушения
          player.teleToLocation(-248536, 250280, 4311);
          return null;
        case 3: // Отправиться в Семя Уничтожения
          player.teleToLocation(-175512, 154488, 2689);
          return null;
        case 4:
          player.teleToLocation(-149406, 255247, -80);
          return null;
        case 5: // Отправиться в Семя Индустриализции
          if (player.getLevel() >= 95) {
            player.teleToLocation(-147348, 152615, -14048);
            return null;
          }
      }
    }
    return null;
  }