ZURSULUS L2

Ominous News

ID
122
Название
Ominous News
start_npcs_json
[31979]
npc_ids_json
[31979,32017]
constants_json
{"MOIRA":31979,"KARUDA":32017}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00122_OminousNews/Q00122_OminousNews.java

NPC квеста

IDНазваниеСтарт квестаУровень
31979MoiraДа70
32017KarudaНет70

Условия уровней: выражения из Java

htmltext = (player.getLevel() < 20) ? "31979-01.htm" : "31979-02.htm";

Выдача предметов, адены и опыта: выражения из Java

giveAdena(player, 1695, true);

Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.

Тексты квеста

[31979-01.htm] Seer Moira: Are you qualified to receive the blessings of Pa'agrio? (This quest may only be undertaken by a character of level 20 and above.) [31979-02.htm] Seer Moira: Oh, sighing rock! I'd like to end your wandering for good. Do you wish to help me do that? "Do you know the path I have to follow?" [31979-03.htm] Seer Moira: If you follow the path from the western part of the village, you'll meet someone who'll stop your wandering. His name is Karuda. When you meet him, tell him to wait. [32017-01.htm] Karuda: What misfortune brought you here? You don't want any part of what's happening here. This place is in chaos. Trust me, it's best if you just pass on by. "The Seer Moira sent me." [32017-02.htm] Karuda: Seer Moira sent you? Well, I'm sort of busy at the moment. Do you think you could come back again later? I do have a job for you. In fact, here's some money - a deposit to retain your services for the future.
Исходник условий и наград (Java)
/*
 * Copyright (c) 2013 L2jMobius
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package quests.Q00122_OminousNews;

import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.mechanics.script.Quest;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00122_OminousNews extends Quest
{
	// NPCs
	private static final int MOIRA = 31979;
	private static final int KARUDA = 32017;
	
	public Q00122_OminousNews()
	{
		super(122, "Ominous News");
		addStartNpc(MOIRA);
		addTalkId(MOIRA, KARUDA);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("31979-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("32017-02.htm"))
		{
			giveAdena(player, 1695, true);
			st.exitQuest(false, true);
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		String htmltext = getNoQuestMsg(player);
		final QuestState st = getQuestState(player, true);
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				htmltext = (player.getLevel() < 20) ? "31979-01.htm" : "31979-02.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case MOIRA:
					{
						htmltext = "31979-03.htm";
						break;
					}
					case KARUDA:
					{
						htmltext = "32017-01.htm";
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}