@Override public String onTalk(L2Npc npc, QuestState st) { if (st == null) { return null; } int cond = st.getCond(); switch (npc.getNpcId()) { case ELIYAH: if (st.isCompleted()) { return "priest_eliyah_q10388_03.htm"; } if (st.isCreated()) { if (st.getPlayer().getLevel() >= 97 && !st.isCompleted()) { return "priest_eliyah_q10388_01.htm"; } else { st.exitQuest(QuestType.REPEATABLE); return "priest_eliyah_q10388_02.htm"; } } if (cond >= 1) { return "priest_eliyah_q10388_09.htm"; } break; case KARGOS: if (cond == 1) { return "kargos_q10388_02.htm"; } if (cond >= 2) { return "kargos_q10388_06.htm"; } break; case KITCHEN: if (cond == 2) { return "kitchen_q10388_01.htm"; } if (cond == 3 && !st.getPlayer().getInventory().hasItems(VISITOR_BADGE)) { st.giveItem(VISITOR_BADGE); return "kitchen_q10388_03.htm"; } if (cond == 3) { return "kitchen_q10388_04.htm"; } break; case RAZEN: if (st.isCompleted()) { return getAlreadyCompletedMsg(st.getPlayer(), QuestType.ONE_TIME); } if (cond == 3) { return "razen_q10388_01.htm"; } break; } return getNoQuestMsg(st.getPlayer()); }
@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; }