123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782 |
- /*
- * 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.Q00115_TheOtherSideOfTruth;
- 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.quest.Quest;
- import com.l2jserver.gameserver.model.quest.QuestState;
- import com.l2jserver.gameserver.model.quest.State;
- /**
- * The Other Side of Truth (115)
- * @author Adry_85
- */
- public class Q00115_TheOtherSideOfTruth extends Quest
- {
- // NPCs
- private static final int MISA = 32018;
- private static final int RAFFORTY = 32020;
- private static final int ICE_SCULPTURE1 = 32021;
- private static final int KIER = 32022;
- private static final int ICE_SCULPTURE2 = 32077;
- private static final int ICE_SCULPTURE3 = 32078;
- private static final int ICE_SCULPTURE4 = 32079;
- // Items
- private static final int MISAS_LETTER = 8079;
- private static final int RAFFORTYS_LETTER = 8080;
- private static final int PIECE_OF_TABLET = 8081;
- private static final int REPORT_PIECE = 8082;
- // Misc
- private static final int MIN_LEVEL = 53;
-
- public Q00115_TheOtherSideOfTruth()
- {
- super(115, Q00115_TheOtherSideOfTruth.class.getSimpleName(), "The Other Side of Truth");
- addStartNpc(RAFFORTY);
- addTalkId(RAFFORTY, MISA, KIER, ICE_SCULPTURE1, ICE_SCULPTURE2, ICE_SCULPTURE3, ICE_SCULPTURE4);
- registerQuestItems(MISAS_LETTER, RAFFORTYS_LETTER, PIECE_OF_TABLET, REPORT_PIECE);
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- final QuestState st = getQuestState(player, false);
- if (st == null)
- {
- return null;
- }
-
- String htmltext = null;
- switch (event)
- {
- case "32020-02.html":
- {
- st.startQuest();
- htmltext = event;
- break;
- }
- case "32020-07.html":
- {
- if (st.isCond(2))
- {
- st.takeItems(MISAS_LETTER, -1);
- st.setCond(3, true);
- htmltext = event;
- }
- break;
- }
- case "32020-05.html":
- {
- if (st.isCond(2))
- {
- st.takeItems(MISAS_LETTER, -1);
- st.exitQuest(true, true);
- htmltext = event;
- }
- break;
- }
- case "32020-10.html":
- {
- if (st.isCond(3))
- {
- st.setCond(4, true);
- htmltext = event;
- }
- break;
- }
- case "32020-11.html":
- {
- if (st.isCond(3))
- {
- st.setCond(4, true);
- htmltext = event;
- }
- break;
- }
- case "32020-12.html":
- {
- if (st.isCond(3))
- {
- st.exitQuest(true, true);
- htmltext = event;
- }
- break;
- }
- case "32020-08.html":
- case "32020-09.html":
- case "32020-13.html":
- case "32020-14.html":
- {
- htmltext = event;
- break;
- }
- case "32020-15.html":
- {
- if (st.isCond(4))
- {
- st.setCond(5, true);
- st.playSound(QuestSound.AMBSOUND_WINGFLAP);
- htmltext = event;
- }
- break;
- }
- case "32020-23.html":
- {
- if (st.isCond(9))
- {
- st.setCond(10, true);
- htmltext = event;
- }
- break;
- }
- case "finish":
- {
- if (st.isCond(10))
- {
- if (st.hasQuestItems(PIECE_OF_TABLET))
- {
- st.giveAdena(115673, true);
- st.addExpAndSp(493595, 40442);
- st.exitQuest(false, true);
- htmltext = "32020-25.html";
- }
- else
- {
- st.setCond(11, true);
- htmltext = "32020-26.html";
- st.playSound(QuestSound.AMBSOUND_THUNDER);
- }
- }
- break;
- }
- case "finish2":
- {
- if (st.isCond(10))
- {
- if (st.hasQuestItems(PIECE_OF_TABLET))
- {
- st.giveAdena(115673, true);
- st.addExpAndSp(493595, 40442);
- st.exitQuest(false, true);
- htmltext = "32020-27.html";
- }
- else
- {
- st.setCond(11, true);
- htmltext = "32020-28.html";
- st.playSound(QuestSound.AMBSOUND_THUNDER);
- }
- }
- break;
- }
- case "32018-05.html":
- {
- if (st.isCond(6) && (st.hasQuestItems(RAFFORTYS_LETTER)))
- {
- st.takeItems(RAFFORTYS_LETTER, -1);
- st.setCond(7, true);
- htmltext = event;
- }
- break;
- }
- case "32022-02.html":
- {
- if (st.isCond(8))
- {
- st.giveItems(REPORT_PIECE, 1);
- st.setCond(9, true);
- htmltext = event;
- }
- break;
- }
- case "32021-02.html":
- {
- switch (npc.getId())
- {
- case ICE_SCULPTURE1:
- {
- if (st.isCond(7) && ((st.getInt("ex") % 2) <= 1))
- {
- int ex = st.getInt("ex");
- if ((ex == 6) || (ex == 10) || (ex == 12))
- {
- ex++;
- st.set("ex", ex);
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = event;
- }
- }
- break;
- }
- case ICE_SCULPTURE2:
- {
- if (st.isCond(7) && ((st.getInt("ex") % 4) <= 1))
- {
- int ex = st.getInt("ex");
- if ((ex == 5) || (ex == 9) || (ex == 12))
- {
- ex += 2;
- st.set("ex", ex);
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = event;
- }
- }
- break;
- }
- case ICE_SCULPTURE3:
- {
- if (st.isCond(7) && ((st.getInt("ex") % 8) <= 3))
- {
- int ex = st.getInt("ex");
- if ((ex == 3) || (ex == 9) || (ex == 10))
- {
- ex += 4;
- st.set("ex", ex);
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = event;
- }
- }
- break;
- }
- case ICE_SCULPTURE4:
- {
- if (st.isCond(7) && (st.getInt("ex") <= 7))
- {
- int ex = st.getInt("ex");
- if ((ex == 3) || (ex == 5) || (ex == 6))
- {
- ex += 8;
- st.set("ex", ex);
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = event;
- }
- }
- break;
- }
- }
- break;
- }
- case "32021-03.html":
- {
- switch (npc.getId())
- {
- case ICE_SCULPTURE1:
- {
- if (st.isCond(7) && ((st.getInt("ex") % 2) <= 1))
- {
- int ex = st.getInt("ex");
- if ((ex == 6) || (ex == 10) || (ex == 12))
- {
- ex++;
- st.set("ex", ex);
- htmltext = event;
- }
- }
- break;
- }
- case ICE_SCULPTURE2:
- {
- if (st.isCond(7) && ((st.getInt("ex") % 4) <= 1))
- {
- int ex = st.getInt("ex");
- if ((ex == 5) || (ex == 9) || (ex == 12))
- {
- ex += 2;
- st.set("ex", ex);
- htmltext = event;
- }
- }
- break;
- }
- case ICE_SCULPTURE3:
- {
- if (st.isCond(7) && ((st.getInt("ex") % 8) <= 3))
- {
- int ex = st.getInt("ex");
- if ((ex == 3) || (ex == 9) || (ex == 12))
- {
- ex += 4;
- st.set("ex", ex);
- htmltext = event;
- }
- }
- break;
- }
- case ICE_SCULPTURE4:
- {
- if (st.isCond(7) && (st.getInt("ex") <= 7))
- {
- int ex = st.getInt("ex");
- if ((ex == 3) || (ex == 5) || (ex == 6))
- {
- ex += 8;
- st.set("ex", ex);
- htmltext = event;
- }
- }
- break;
- }
- }
- break;
- }
- case "32021-06.html":
- {
- switch (npc.getId())
- {
- case ICE_SCULPTURE1:
- {
- if (st.isCond(7) && (st.getInt("ex") == 14))
- {
- st.setCond(8);
- htmltext = event;
- }
- break;
- }
- case ICE_SCULPTURE2:
- {
- if (st.isCond(7) && (st.getInt("ex") == 13))
- {
- st.setCond(8);
- htmltext = event;
- }
- break;
- }
- case ICE_SCULPTURE3:
- {
- if (st.isCond(7) && (st.getInt("ex") == 11))
- {
- st.setCond(8);
- htmltext = event;
- }
- break;
- }
- case ICE_SCULPTURE4:
- {
- if (st.isCond(7) && (st.getInt("ex") == 7))
- {
- st.setCond(8);
- htmltext = event;
- }
- break;
- }
- }
- break;
- }
- }
- return htmltext;
- }
-
- @Override
- public String onTalk(L2Npc npc, L2PcInstance player)
- {
- final QuestState st = getQuestState(player, true);
- String htmltext = getNoQuestMsg(player);
- if (st == null)
- {
- return htmltext;
- }
-
- switch (st.getState())
- {
- case State.COMPLETED:
- {
- if (npc.getId() == RAFFORTY)
- {
- htmltext = getAlreadyCompletedMsg(player);
- }
- break;
- }
- case State.CREATED:
- {
- htmltext = (player.getLevel() >= MIN_LEVEL) ? "32020-01.htm" : "32020-03.html";
- break;
- }
- case State.STARTED:
- {
- switch (npc.getId())
- {
- case RAFFORTY:
- {
- switch (st.getCond())
- {
- case 1:
- {
- htmltext = "32020-04.html";
- break;
- }
- case 2:
- {
- htmltext = (!st.hasQuestItems(MISAS_LETTER)) ? "32020-05.html" : "32020-06.html";
- break;
- }
- case 3:
- {
- htmltext = "32020-16.html";
- break;
- }
- case 4:
- {
- htmltext = "32020-17.html";
- break;
- }
- case 5:
- {
- st.giveItems(RAFFORTYS_LETTER, 1);
- st.setCond(6, true);
- htmltext = "32020-18.html";
- break;
- }
- case 6:
- {
- if (st.hasQuestItems(RAFFORTYS_LETTER))
- {
- htmltext = "32020-19.html";
- }
- else
- {
- st.giveItems(RAFFORTYS_LETTER, 1);
- htmltext = "32020-20.html";
- }
- break;
- }
- case 7:
- case 8:
- {
- htmltext = "32020-21.html";
- break;
- }
- case 9:
- {
- if (st.hasQuestItems(REPORT_PIECE))
- {
- htmltext = "32020-22.html";
- }
- break;
- }
- case 10:
- {
- htmltext = "32020-24.html";
- break;
- }
- case 11:
- {
- if (!st.hasQuestItems(PIECE_OF_TABLET))
- {
- htmltext = "32020-29.html";
- }
- else
- {
- st.giveAdena(115673, true);
- st.addExpAndSp(493595, 40442);
- st.exitQuest(false, true);
- htmltext = "32020-30.html";
- }
- break;
- }
- }
- break;
- }
- case MISA:
- {
- switch (st.getCond())
- {
- case 1:
- {
- st.giveItems(MISAS_LETTER, 1);
- st.setCond(2, true);
- htmltext = "32018-01.html";
- break;
- }
- case 2:
- {
- htmltext = "32018-02.html";
- break;
- }
- case 3:
- case 4:
- {
- htmltext = "32018-03.html";
- break;
- }
- case 5:
- {
- break;
- }
- case 6:
- {
- if (st.hasQuestItems(RAFFORTYS_LETTER))
- {
- htmltext = "32018-04.html";
- }
- break;
- }
- case 7:
- {
- htmltext = "32018-06.html";
- break;
- }
- }
- break;
- }
- case KIER:
- {
- switch (st.getCond())
- {
- case 8:
- {
- htmltext = "32022-01.html";
- break;
- }
- case 9:
- {
- if (st.hasQuestItems(REPORT_PIECE))
- {
- htmltext = "32022-03.html";
- }
- else
- {
- st.giveItems(REPORT_PIECE, 1);
- htmltext = "32022-04.html";
- }
- break;
- }
- case 11:
- {
- if (!st.hasQuestItems(REPORT_PIECE))
- {
- htmltext = "32022-05.html";
- }
- break;
- }
- }
- break;
- }
- case ICE_SCULPTURE1:
- {
- switch (st.getCond())
- {
- case 7:
- {
- if ((st.getInt("ex") % 2) <= 1)
- {
- int ex = st.getInt("ex");
- if ((ex == 6) || (ex == 10) || (ex == 12))
- {
- htmltext = "32021-01.html";
- }
- else if (ex == 14)
- {
- htmltext = "32021-05.html";
- }
- else
- {
- ex++;
- st.set("ex", ex);
- htmltext = "32021-07.html";
- }
- }
- else
- {
- htmltext = "32021-04.html";
- }
- break;
- }
- case 8:
- {
- htmltext = "32021-08.html";
- break;
- }
- case 11:
- {
- if (!st.hasQuestItems(PIECE_OF_TABLET))
- {
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = "32021-09.html";
- }
- else
- {
- htmltext = "32021-10.html";
- }
- break;
- }
- }
- break;
- }
- case ICE_SCULPTURE2:
- {
- switch (st.getCond())
- {
- case 7:
- {
- if ((st.getInt("ex") % 4) <= 1)
- {
- int ex = st.getInt("ex");
- if ((ex == 5) || (ex == 9) || (ex == 12))
- {
- htmltext = "32021-01.html";
- }
- else if (ex == 13)
- {
- htmltext = "32021-05.html";
- }
- else
- {
- ex += 2;
- st.set("ex", ex);
- htmltext = "32021-07.html";
- }
- }
- else
- {
- htmltext = "32021-04.html";
- }
- break;
- }
- case 8:
- {
- htmltext = "32021-08.html";
- break;
- }
- case 11:
- {
- if (!st.hasQuestItems(PIECE_OF_TABLET))
- {
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = "32021-09.html";
- }
- else
- {
- htmltext = "32021-10.html";
- }
- break;
- }
- }
- break;
- }
- case ICE_SCULPTURE3:
- {
- switch (st.getCond())
- {
- case 7:
- {
- if ((st.getInt("ex") % 8) <= 3)
- {
- int ex = st.getInt("ex");
- if ((ex == 3) || (ex == 9) || (ex == 10))
- {
- htmltext = "32021-01.html";
- }
- else if (ex == 11)
- {
- htmltext = "32021-05.html";
- }
- else
- {
- ex += 4;
- st.set("ex", ex);
- htmltext = "32021-07.html";
- }
- }
- else
- {
- htmltext = "32021-04.html";
- }
- break;
- }
- case 8:
- {
- htmltext = "32021-08.html";
- break;
- }
- case 11:
- {
- if (!st.hasQuestItems(PIECE_OF_TABLET))
- {
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = "32021-09.html";
- }
- else
- {
- htmltext = "32021-10.html";
- }
- break;
- }
- }
- break;
- }
- case ICE_SCULPTURE4:
- {
- switch (st.getCond())
- {
- case 7:
- {
- if (st.getInt("ex") <= 7)
- {
- int ex = st.getInt("ex");
- if ((ex == 3) || (ex == 5) || (ex == 6))
- {
- htmltext = "32021-01.html";
- }
- else if (ex == 7)
- {
- htmltext = "32021-05.html";
- }
- else
- {
- ex += 8;
- st.set("ex", ex);
- htmltext = "32021-07.html";
- }
- }
- else
- {
- htmltext = "32021-04.html";
- }
- break;
- }
- case 8:
- {
- htmltext = "32021-08.html";
- break;
- }
- case 11:
- {
- if (!st.hasQuestItems(PIECE_OF_TABLET))
- {
- st.giveItems(PIECE_OF_TABLET, 1);
- htmltext = "32021-09.html";
- }
- else
- {
- htmltext = "32021-10.html";
- }
- break;
- }
- }
- break;
- }
- }
- break;
- }
- }
- return htmltext;
- }
- }
|