ZURSULUS L2

Seekers of the Holy Grail

ID
638
Название
Seekers of the Holy Grail
start_npcs_json
[31328]
npc_ids_json
[31328]
constants_json
{"INNOCENTIN":31328,"PAGAN_TOTEM":8068}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00638_SeekersOfTheHolyGrail/Q00638_SeekersOfTheHolyGrail.java

NPC квеста

IDНазваниеСтарт квестаУровень
31328InnocentinДа70

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

htmltext = (player.getLevel() < 73) ? "31328-00.htm" : "31328-01.htm";

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

rewardItems(player, 959, 1);
rewardItems(player, 960, 1);
giveAdena(player, 3576000, true);

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

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

[31328-00.htm] High Priest Innocentin: Recent activities at the Pagan Temple have raised my concerns. Considering the shenanigans that normally go on there, you must surely understand the peril! Would you consider coming back to help me when you've had more experience? (This quest may only be undertaken by a character of level 73 and above.) [31328-01.htm] High Priest Innocentin: Recent activities at the Pagan Temple have raised my concerns. Considering the shenanigans that normally go on there, you must surely understand the peril! You see, they've set their sights on Saint Solina's Grail of Splendor! I'm sure that if we don`t stop them, something terrible and irrevocable will happen! Will you help us in our time of need? "I'll do it." [31328-02.htm] High Priest Innocentin: Splendid! Please go to the Pagan Temple and defeat the evil ones that inhabit it! After you've destroyed them, bring me their Pagan Totems. You'll be well-rewarded if you bring me more than 2000 of them! Of course, our definitions of large rewards might differ... As you must have guessed, the Pagan Temple is heavily defended and will not be easily overtaken. Priest Eliyah could give you guidance on how to penetrate their defenses. [31328-03.htm] High Priest Innocentin: If you bring me more, I shall reward you again. [31328-04.htm] High Priest Innocentin: Please go to the Pagan Temple and defeat the evil ones that inhabit it! After you've destroyed them, bring me their Pagan Totems. You'll be well-rewarded if you bring more that 2000 of them! Of course, our definitions of large rewards might differ... As you must have guessed, the Pagan Temple is heavily defended and will not easily overtaken. Priest Eliyah could give you guidance on how to penetrate their defence. "I'll continue." "I want to quit." [31328-05.htm] High Priest Innocentin: Thank you! [31328-06.htm] High Priest Innocentin: Oh, I'm sorry to see you go! Your efforts have done much to thwart the evil plans of the Pagans! If you have some spare time in the future, come back and help us again!
Исходник условий и наград (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.Q00638_SeekersOfTheHolyGrail;

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.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00638_SeekersOfTheHolyGrail extends Quest
{
	// NPC
	private static final int INNOCENTIN = 31328;
	
	// Item
	private static final int PAGAN_TOTEM = 8068;
	
	public Q00638_SeekersOfTheHolyGrail()
	{
		super(638, "Seekers of the Holy Grail");
		registerQuestItems(PAGAN_TOTEM);
		addStartNpc(INNOCENTIN);
		addTalkId(INNOCENTIN);
		for (int i = 22138; i < 22175; i++)
		{
			addKillId(i);
		}
	}
	
	@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("31328-02.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31328-06.htm"))
		{
			st.exitQuest(true, 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() < 73) ? "31328-00.htm" : "31328-01.htm";
				break;
			}
			case State.STARTED:
			{
				if (getQuestItemsCount(player, PAGAN_TOTEM) >= 2000)
				{
					htmltext = "31328-03.htm";
					playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
					takeItems(player, PAGAN_TOTEM, 2000);
					
					final int chance = getRandom(3);
					if (chance == 0)
					{
						rewardItems(player, 959, 1);
					}
					else if (chance == 1)
					{
						rewardItems(player, 960, 1);
					}
					else
					{
						giveAdena(player, 3576000, true);
					}
				}
				else
				{
					htmltext = "31328-04.htm";
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
		if (qs != null)
		{
			giveItemRandomly(qs.getPlayer(), npc, PAGAN_TOTEM, 1, 0, 1, true);
		}
	}
}