ZURSULUS L2

Guardians of the Holy Grail

ID
639
Название
Guardians of the Holy Grail
start_npcs_json
[31350]
npc_ids_json
[31350,32008,32028]
constants_json
{"DOMINIC":31350,"GREMORY":32008,"HOLY_GRAIL":32028,"SCRIPTURE":8069,"WATER_BOTTLE":8070,"HOLY_WATER_BOTTLE":8071}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00639_GuardiansOfTheHolyGrail/Q00639_GuardiansOfTheHolyGrail.java

NPC квеста

IDНазваниеСтарт квестаУровень
31350DominicДа70
32008GremoryНет70
32028Holy GrailНет70

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

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

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

giveAdena(player, (1625 * count) + ((count >= 10) ? 33940 : 0), true);
giveItems(player, WATER_BOTTLE, 1);
rewardItems(player, 959, 1);
rewardItems(player, 960, 1);
giveItems(player, HOLY_WATER_BOTTLE, 1);

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

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

[31350-01.htm] Priest Dominic: Do you know of a place called the Monastery of Silence? It may call itself a monastery, but it is more like a social club; few are admitted, and they are inclined to attack anyone they suspect of intruding upon that which they protect, that which Saint Solina left behind. "What did Saint Solina leave behind?" [31350-02.htm] Priest Dominic: Have you heard tell of a place called the Monastery of Silence? Well, they are suspicious of strangers and quick to attack intruders. Why? Well, there's a reason... But hold. I think it would be better to tell you this later on, when you have grown stronger and more skillful. (This quest may only be undertaken by a character of level 73 and above.) [31350-03.htm] Priest Dominic: Well, that's not really important for you to know, is it? I'm sorry, but that's a secret I'm sworn to keep. Suffice it to say that it is something my order needs enough to hire you to get it. Sadly, the monastery is just as intent on keeping it, and their resistance was stronger than we expected. We failed to get it, and so I am here asking you to succeed where we have failed. You will have to defeat them totally; nothing less will allow my order to retrieve what we need from them. Tell him you will do it. [31350-04.htm] Priest Dominic: Very good! Then go to the Monastery of Silence and defeat its monks. I will give you a reward if you bring me the Scripture of Monk as proof that you eliminated them. Oh, yes...one more thing. We have a man on the inside, an agent named Gremory who infiltrated the Monastery of Silence. He has done brave work, and if you can help him to escape, that would be best. He can be of great assistance to you. [31350-05.htm] Priest Dominic: Fine work. Haha! Thank you for eliminating those pesky monks. So, would you like to collect your just reward? Don't collect the reward now. Get the reward in exchange for the Scripture of Monk you brought. [31350-06.htm] Priest Dominic: Here's the quest: Go to the Monastery of Silence and vanquish the monks. I will give you a reward if you bring me the Scripture of Monk as proof that you have defeated them. I hope, of course, that they surrender to you, but if they do not, you may kill them in good conscience; we will pray for their souls. Oh, here's something that may help you: we have a man on the inside. Our brave Gremory has managed to infiltrate the monastery, a task many had thought impossible. Please help him to escape if possible; the poor man has done more than enough, and he may be of help to you. Continue the job. Quit the job. [31350-07.htm] Priest Dominic: Fine, then. Keep up the good work... until we retake from those pestilent monks what is ours by right! [31350-08.htm] Priest Dominic: Here, then, is your payment. You have done excellent work. [31350-09.htm] Priest Dominic: Oh, very well. I can't make you do it. But do be careful, now; I wouldn't want to see you side with those pestilential monks. Who knows what might happen to you if you did? You might just...die, of remorse and shame. Heh. If you change your mind, you know where to find me. [32008-01.htm] Priest Gremory: Curses! I've been unmasked! How did you find me, damn you? My disguise was perfect. Well, question me all you like; my lips are sealed. What? Dominic sent you? Oh, thank the gods. For a moment I feared the worst! "Why are you here?" [32008-02.htm] Priest Gremory: I infiltrated this order to find the Grail of Splendor they keep hidden here in the Monastery of Silence. Now that's a mission for a man! I wouldn't blame you for envying me. Wait - if you were sent by Dominic, then you report to me now! Hahaha! Yes, I've been expecting this. I have served here so long, so very long... the pressures, you wouldn't understand them. You couldn't. And now he finally recognizes my service and my abilities! Very well, servant. Your first task will be to massage my shoulders. I'm weary from hiding in this narrow space for so long... "I'm not your underling. I'm here to help you fulfill your mission." [32008-03.htm] Priest Gremory: What? Damn it all! I have needed an underling for so long... Well, never mind that now. Let's talk business. In my searches within the monastery, I have found a broken bridge. Across the bridge, there is a chamber called the Room of Splendor. I don't know what that name means, but... they say the Holy Grail lies within. That's the place to go. "A broken bridge? How do I cross it?" [32008-04.htm] Priest Gremory: The broken bridge? It is simply an optical illusion. Just step out onto it and you'll find the bridge is intact and whole. I have a fear of heights, so I cannot manage the crossing myself. It has been my one and only failure as an agent. Get me that Grail, and I will trade you some unique items which form a part of the Scripture of Monk that you are collecting. Do we have a deal? "OK, what do I have to do?" [32008-05.htm] Priest Gremory: Then we understand each other. Go to the Room of Splendor and pour water into the Holy Grail. Then pour that water back into a jar and bring it to me. Thus can we verify the genuineness of the Holy Grail. Be careful, though; the Grail may be guarded. One more thing: the Room of Splendor is locked. You will need a key to enter there. Some monks have such keys to perform their duties, so I suggest that you overcome one of them and take his key. [32008-06.htm] Priest Gremory: Go to the Room of Splendor and pour a measure of water into the Holy Grail. Then pour the water back into a jar and bring it to me. We can test the water to determine if the Grail is the real thing or not. Be careful when you do this; the room may be guarded. Oh, another thing. The Room of Splendor is locked, and you'll need a key to enter it. Some of the monks carry a key to that room; I suggest that you overcome of one of them and take his key. [32008-08.htm] Priest Gremory: Nice! You got away clean, did you? Well, let's test the water. Alas! The water fails the test. They must keep the real Grail somewhere else! Well, thank you, I suppose. It was worth knowing about the false lead. Now leave me; I must return to my task of finding the real Grail. Go quickly, before they discover us! "That wasn't the deal. You promised us a part of the Scripture of Monk in exchange for what we found." [32008-09.htm] Priest Gremory: Ah, that's true, that's true. Such forgetfulness is rare in a spy of my caliber, I assure you! Well, I am a man of my word, so here you go. I assume that takes care of our deal, yes? What's more, I'll make another deal with you: If you bring me 4000 or 400 Monk Scriptures, I will exchange them for an S-grade Enchant Weapon Scroll or an S-grade Enchant Armor Scroll, respectively. Come back after you slay those bothersome monks. [32008-10.htm] Priest Gremory: The Grail, the Grail...o, where is the blasted thing? A spy of my stature should surely have found it by now! Does it even exist? ...Huh? Ah, it's you again! Did you bring me any Monk Scriptures? Exchange 4000 Monk Scriptures for an S-grade Enchant Weapon Scroll. Exchange 400 Monk Scriptures for an S-grade Enchant Armor Scroll. [32008-11.htm] Priest Gremory: Here you go: one S-grade Enchant Weapon Scroll. Do you like it? You'd better appreciate it; it's a gift from me, after all! Hahaha! And here are my Scriptures. Once I show Dominic all of the Scriptures, he'll finally appreciate my abilities properly. Of course, he'll think I collected them myself... but in a sense I did, didn't I? [32008-12.htm] Priest Gremory: Huh? You need more of the Monk Scriptures to meet my terms! What is this, some sort of con game? You'll never fool me that easily. Kill the monks, as many as you need to, and bring me more scriptures. Understood? [32008-13.htm] Priest Gremory: Here is the S-grade Enchant Armor Scroll I promised you, then. Do you like it? You'd better appreciate it, fellow; it's a gift from Gremory the spy! Hahaha! And here are my Scriptures. Once I show Dominic my collection of Scriptures, he'll properly appreciate my abilities. He'll think I collected them myself... but in a sense I did, didn't I? [32008-14.htm] Priest Gremory: Oh, nonsense. You know very well that these aren't enough Scriptures. What is this, some sort of inept con game? You'll need more than that to trick me, my friend. You're dealing with Gremory, understand? Go kill the monks and bring me more Scriptures. Understood? [32028-01.htm] The Grail of Splendor: Gremory's instructions were to pour some water into the Grail, then pour that water into a bottle and bring it to him. Pour the water. [32028-02.htm] The Grail of Splendor: I pour the water into the Grail. I see no change... Now, I'll pour the water into this bottle and return to Gremory. [32028-03.htm] The Grail of Splendor: I have completed what Gremory asked of me, so now I will go to see him.
Исходник условий и наград (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.Q00639_GuardiansOfTheHolyGrail;

import java.util.HashMap;
import java.util.Map;

import org.l2jmobius.commons.util.Rnd;
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 Q00639_GuardiansOfTheHolyGrail extends Quest
{
	// NPCs
	private static final int DOMINIC = 31350;
	private static final int GREMORY = 32008;
	private static final int HOLY_GRAIL = 32028;
	
	// Items
	private static final int SCRIPTURE = 8069;
	private static final int WATER_BOTTLE = 8070;
	private static final int HOLY_WATER_BOTTLE = 8071;
	private static final Map<Integer, Integer> CHANCES = new HashMap<>();
	static
	{
		CHANCES.put(22122, 760000);
		CHANCES.put(22123, 750000);
		CHANCES.put(22124, 590000);
		CHANCES.put(22125, 580000);
		CHANCES.put(22126, 590000);
		CHANCES.put(22127, 580000);
		CHANCES.put(22128, 170000);
		CHANCES.put(22129, 590000);
		CHANCES.put(22130, 850000);
		CHANCES.put(22131, 920000);
		CHANCES.put(22132, 580000);
		CHANCES.put(22133, 930000);
		CHANCES.put(22134, 230000);
		CHANCES.put(22135, 580000);
	}
	
	public Q00639_GuardiansOfTheHolyGrail()
	{
		super(639, "Guardians of the Holy Grail");
		registerQuestItems(SCRIPTURE, WATER_BOTTLE, HOLY_WATER_BOTTLE);
		addStartNpc(DOMINIC);
		addTalkId(DOMINIC, GREMORY, HOLY_GRAIL);
		addKillId(CHANCES.keySet());
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, false);
		String htmltext = null;
		if (qs == null)
		{
			return htmltext;
		}
		
		switch (event)
		{
			case "31350-03.htm":
			case "31350-07.htm":
			case "32008-02.htm":
			case "32008-03.htm":
			case "32008-04.htm":
			{
				htmltext = event;
				break;
			}
			case "31350-04.htm":
			{
				qs.startQuest();
				htmltext = event;
				break;
			}
			case "31350-08.htm":
			{
				final int count = getQuestItemsCount(player, SCRIPTURE);
				takeItems(player, SCRIPTURE, -1);
				giveAdena(player, (1625 * count) + ((count >= 10) ? 33940 : 0), true);
				htmltext = event;
				break;
			}
			case "31350-09.htm":
			{
				qs.exitQuest(true, true);
				htmltext = event;
				break;
			}
			case "32008-05.htm":
			{
				qs.setCond(2, true);
				giveItems(player, WATER_BOTTLE, 1);
				htmltext = event;
				break;
			}
			case "32008-09.htm":
			{
				qs.setCond(4, true);
				takeItems(player, HOLY_WATER_BOTTLE, 1);
				htmltext = event;
				break;
			}
			case "32008-12.htm":
			{
				if (getQuestItemsCount(player, SCRIPTURE) >= 4000)
				{
					takeItems(player, SCRIPTURE, 4000);
					rewardItems(player, 959, 1);
					htmltext = "32008-11.htm";
				}
				else
				{
					htmltext = event;
				}
				break;
			}
			case "32008-14.htm":
			{
				if (getQuestItemsCount(player, SCRIPTURE) >= 400)
				{
					takeItems(player, SCRIPTURE, 400);
					rewardItems(player, 960, 1);
					htmltext = "32008-13.htm";
				}
				else
				{
					htmltext = event;
				}
				break;
			}
			case "32028-02.htm":
			{
				qs.setCond(3, true);
				takeItems(player, WATER_BOTTLE, 1);
				giveItems(player, HOLY_WATER_BOTTLE, 1);
				htmltext = event;
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		
		switch (qs.getState())
		{
			case State.CREATED:
			{
				htmltext = player.getLevel() < 73 ? "31350-02.htm" : "31350-01.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case DOMINIC:
					{
						htmltext = hasQuestItems(player, SCRIPTURE) ? "31350-05.htm" : "31350-06.htm";
						break;
					}
					case GREMORY:
					{
						switch (qs.getCond())
						{
							case 1:
							{
								htmltext = "32008-01.htm";
								break;
							}
							case 2:
							{
								htmltext = "32008-06.htm";
								break;
							}
							case 3:
							{
								htmltext = "32008-08.htm";
								break;
							}
							case 4:
							{
								htmltext = "32008-10.htm";
								break;
							}
						}
						break;
					}
					case HOLY_GRAIL:
					{
						if (qs.isCond(2))
						{
							htmltext = "32028-01.htm";
						}
						else if (qs.getCond() > 2)
						{
							htmltext = "32028-03.htm";
						}
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getRandomPartyMemberState(killer, 1, 3, npc);
		if ((qs != null) && (Rnd.get(1000000) < CHANCES.get(npc.getId())))
		{
			giveItemRandomly(qs.getPlayer(), npc, SCRIPTURE, 1, 0, 1, true);
		}
	}
}