123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- /*
- * Copyright (C) 2004-2015 L2J DataPack
- *
- * This file is part of L2J DataPack.
- *
- * L2J DataPack is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * L2J DataPack is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package quests.Q00411_PathOfTheAssassin;
- import com.l2jserver.gameserver.enums.QuestSound;
- import com.l2jserver.gameserver.model.actor.L2Npc;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jserver.gameserver.model.base.ClassId;
- import com.l2jserver.gameserver.model.quest.Quest;
- import com.l2jserver.gameserver.model.quest.QuestState;
- import com.l2jserver.gameserver.network.serverpackets.SocialAction;
- import com.l2jserver.gameserver.util.Util;
- /**
- * Path Of The Assassin (411)
- * @author ivantotov
- */
- public final class Q00411_PathOfTheAssassin extends Quest
- {
- // NPCs
- private static final int TRISKEL = 30416;
- private static final int GUARD_LEIKAN = 30382;
- private static final int ARKENIA = 30419;
- // Items
- private static final int SHILENS_CALL = 1245;
- private static final int ARKENIAS_LETTER = 1246;
- private static final int LEIKANS_NOTE = 1247;
- private static final int MOONSTONE_BEASTS_MOLAR = 1248;
- private static final int SHILENS_TEARS = 1250;
- private static final int ARKENIAS_RECOMMENDATION = 1251;
- // Reward
- private static final int IRON_HEART = 1252;
- // Monster
- private static final int MOONSTONE_BEAST = 20369;
- // Quest Monster
- private static final int CALPICO = 27036;
- // Misc
- private static final int MIN_LEVEL = 18;
-
- public Q00411_PathOfTheAssassin()
- {
- super(411, Q00411_PathOfTheAssassin.class.getSimpleName(), "Path Of The Assassin");
- addStartNpc(TRISKEL);
- addTalkId(TRISKEL, GUARD_LEIKAN, ARKENIA);
- addKillId(MOONSTONE_BEAST, CALPICO);
- registerQuestItems(SHILENS_CALL, ARKENIAS_LETTER, LEIKANS_NOTE, MOONSTONE_BEASTS_MOLAR, SHILENS_TEARS, ARKENIAS_RECOMMENDATION);
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- final QuestState qs = getQuestState(player, false);
- if (qs == null)
- {
- return null;
- }
-
- String htmltext = null;
- switch (event)
- {
- case "ACCEPT":
- {
- if (player.getClassId() == ClassId.darkFighter)
- {
- if (player.getLevel() >= MIN_LEVEL)
- {
- if (hasQuestItems(player, IRON_HEART))
- {
- htmltext = "30416-04.htm";
- }
- else
- {
- qs.startQuest();
- giveItems(player, SHILENS_CALL, 1);
- htmltext = "30416-05.htm";
- }
- }
- else
- {
- htmltext = "30416-03.htm";
- }
- }
- else if (player.getClassId() == ClassId.assassin)
- {
- htmltext = "30416-02a.htm";
- }
- else
- {
- htmltext = "30416-02.htm";
- }
- break;
- }
- case "30382-02.html":
- case "30382-04.html":
- {
- htmltext = event;
- break;
- }
- case "30382-03.html":
- {
- if (hasQuestItems(player, ARKENIAS_LETTER))
- {
- takeItems(player, ARKENIAS_LETTER, 1);
- giveItems(player, LEIKANS_NOTE, 1);
- qs.setCond(3, true);
- htmltext = event;
- }
- break;
- }
- case "30419-02.html":
- case "30419-03.html":
- case "30419-04.html":
- case "30419-06.html":
- {
- htmltext = event;
- break;
- }
- case "30419-05.html":
- {
- if (hasQuestItems(player, SHILENS_CALL))
- {
- takeItems(player, SHILENS_CALL, 1);
- giveItems(player, ARKENIAS_LETTER, 1);
- qs.setCond(2, true);
- htmltext = event;
- }
- break;
- }
- }
- return htmltext;
- }
-
- @Override
- public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
- {
- final QuestState qs = getQuestState(killer, false);
- if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
- {
- switch (npc.getId())
- {
- case MOONSTONE_BEAST:
- {
- if (hasQuestItems(killer, LEIKANS_NOTE) && (getQuestItemsCount(killer, MOONSTONE_BEASTS_MOLAR) < 10))
- {
- giveItems(killer, MOONSTONE_BEASTS_MOLAR, 1);
- if (getQuestItemsCount(killer, MOONSTONE_BEASTS_MOLAR) == 10)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- }
- break;
- }
- case CALPICO:
- {
- if (!hasQuestItems(killer, SHILENS_TEARS))
- {
- giveItems(killer, SHILENS_TEARS, 1);
- qs.setCond(6, true);
- }
- break;
- }
- }
- }
- return super.onKill(npc, killer, isSummon);
- }
-
- @Override
- public String onTalk(L2Npc npc, L2PcInstance player)
- {
- final QuestState qs = getQuestState(player, true);
- String htmltext = getNoQuestMsg(player);
- if (qs.isCreated() || qs.isCompleted())
- {
- if (npc.getId() == TRISKEL)
- {
- if (!hasQuestItems(player, IRON_HEART))
- {
- htmltext = "30416-01.htm";
- }
- else
- {
- htmltext = "30416-04.htm";
- }
- }
- }
- else if (qs.isStarted())
- {
- switch (npc.getId())
- {
- case TRISKEL:
- {
- if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, IRON_HEART) && hasQuestItems(player, ARKENIAS_RECOMMENDATION))
- {
- giveAdena(player, 163800, true);
- giveItems(player, IRON_HEART, 1);
- final int level = player.getLevel();
- if (level >= 20)
- {
- addExpAndSp(player, 320534, 35830);
- }
- else if (level == 19)
- {
- addExpAndSp(player, 456128, 35830);
- }
- else
- {
- addExpAndSp(player, 591724, 42528);
- }
- qs.exitQuest(false, true);
- player.sendPacket(new SocialAction(player.getObjectId(), 3));
- qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
- htmltext = "30416-06.html";
- }
- else if (!hasAtLeastOneQuestItem(player, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, ARKENIAS_LETTER))
- {
- htmltext = "30416-07.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, LEIKANS_NOTE))
- {
- htmltext = "30416-08.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL))
- {
- htmltext = "30416-09.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, SHILENS_TEARS))
- {
- htmltext = "30416-10.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART) && hasQuestItems(player, SHILENS_CALL))
- {
- htmltext = "30416-11.html";
- }
- break;
- }
- case GUARD_LEIKAN:
- {
- if (!hasAtLeastOneQuestItem(player, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL, MOONSTONE_BEASTS_MOLAR) && hasQuestItems(player, ARKENIAS_LETTER))
- {
- htmltext = "30382-01.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL, MOONSTONE_BEASTS_MOLAR) && hasQuestItems(player, LEIKANS_NOTE))
- {
- htmltext = "30382-05.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, LEIKANS_NOTE))
- {
- if (hasQuestItems(player, MOONSTONE_BEASTS_MOLAR) && (getQuestItemsCount(player, MOONSTONE_BEASTS_MOLAR) < 10))
- {
- htmltext = "30382-06.html";
- }
- else
- {
- takeItems(player, LEIKANS_NOTE, 1);
- takeItems(player, MOONSTONE_BEASTS_MOLAR, -1);
- qs.setCond(5, true);
- htmltext = "30382-07.html";
- }
- }
- else if (hasQuestItems(player, SHILENS_TEARS))
- {
- htmltext = "30382-08.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL, MOONSTONE_BEASTS_MOLAR))
- {
- htmltext = "30382-09.html";
- }
- break;
- }
- case ARKENIA:
- {
- if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART) && hasQuestItems(player, SHILENS_CALL))
- {
- htmltext = "30419-01.html";
- }
- else if (!hasAtLeastOneQuestItem(player, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, ARKENIAS_LETTER))
- {
- htmltext = "30419-07.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, SHILENS_TEARS))
- {
- takeItems(player, SHILENS_TEARS, 1);
- giveItems(player, ARKENIAS_RECOMMENDATION, 1);
- qs.setCond(7, true);
- htmltext = "30419-08.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, ARKENIAS_RECOMMENDATION))
- {
- htmltext = "30419-09.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL) && hasQuestItems(player, LEIKANS_NOTE))
- {
- htmltext = "30419-10.html";
- }
- else if (!hasAtLeastOneQuestItem(player, ARKENIAS_LETTER, LEIKANS_NOTE, SHILENS_TEARS, ARKENIAS_RECOMMENDATION, IRON_HEART, SHILENS_CALL))
- {
- htmltext = "30419-11.html";
- }
- break;
- }
- }
- }
- return htmltext;
- }
- }
|