ZURSULUS L2

Sacrifice to the Sea

ID
154
Название
Sacrifice to the Sea
start_npcs_json
[30312]
npc_ids_json
[30051,30055,30312]
constants_json
{"ROCKSWELL":30312,"CRISTEL":30051,"ROLFE":30055,"FOX_FUR":1032,"FOX_FUR_YARN":1033,"MAIDEN_DOLL":1034,"EARING":113}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00154_SacrificeToTheSea/Q00154_SacrificeToTheSea.java

NPC квеста

IDНазваниеСтарт квестаУровень
30051CristelНет70
30055RolfeНет70
30312RockswellДа70

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

htmltext = (player.getLevel() < 2) ? "30312-02.htm" : "30312-03.htm";

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

giveItems(player, EARING, 1);
addExpAndSp(player, 100, 0);
giveItems(player, FOX_FUR_YARN, 1);
giveItems(player, MAIDEN_DOLL, 1);

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

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

[30051-01.htm] Cristel: Ah, you've been sent by Rockswell. Such fine, soft fur. But this is not enough for me to spin into yarn. I think ten of these furs would be enough... please gather a few more. [30051-01a.htm] Cristel: Ah, you've been sent by Rockswell. But where is the furs? I think ten furs would be enough. [30051-02.htm] Cristel: Ah, you've been sent by Rockswell. Such fine, soft fur. I think we have plenty here. Please wait a moment, I will spin you that yarn right now. Here is your spool of yarn. I wonder, is Rockswell about to sew or something... Ah, and please tell Mr. Rockswell that I am knitting a woolen coat for him to wear this winter. It must be hard for him to weather the cold sea winds and guard the lighthouse all alone. Tsk tsk. [30051-03.htm] Cristel: I see you still have the yarn that I gave you. Please deliver it to Rockswell. [30051-04.htm] Cristel: Oh my ... What a beautiful doll! Did Rolfe make it? What a talented person he is. Is that a gift for someone? [30055-01.htm] Warehouse Keeper Rolfe: Ho, that's some nice yarn you've got there. Keltir fur? I can tell at a single glance. Right now, I am stationed here and managing the warehouse because of my guild work, but my main trade is as a tailor. The most affluent merchants in all of Giran were my clients... ahem. Huh? What? The doll that Rockswell wanted? Ah, yes! It must have slipped my mind. I must make the doll's hair from the yarn you have brought me. Wait just a moment. I'll be done soon. Wonderful! All done. A beautiful Maiden Doll with orange hair. Wait, did Rockswell have a granddaughter? [30055-02.htm] Warehouse Keeper Rolfe: Please deliver the doll that I gave to you to Lighthouse Keeper Rockswell. I don't know what it'll be used for, but make sure it gets to him, because it was a special-request item. [30055-03.htm] Warehouse Keeper Rolfe: Some time ago, Rockswell asked me to craft a doll in the shape of a maiden. He must be giving it as a gift to his granddaughter or something. But I can't make the hair yet, as I don't have any yarn. Rockswell said that he would find me some yarn spun from the fur of the keltir... [30312-02.htm] Lighthouse Keeper Rockswell: The goddess of the seas must be angry this year. The waves are particularly fierce, and that recent storm didn't look normal. Plus, they say that trade ships going to Giran have been shipwrecked in these parts. Tsk tsk ... This is all because people have started to believe in that Einhasad religion or whatever, and stopped making offerings to the goddess who rules the seas. (This quest may only be undertaken by a character of level 2 and above.) [30312-03.htm] Lighthouse Keeper Rockswell: The goddess of the seas must be really angry this year. The recent storms were fierce, unlike anything ever seen before. They say that trade ships sailing to Giran have been shipwrecked in these parts ... the waves don't seem normal this year. You know, this is all because they haven't made offerings to Shilen, goddess of the sea. From long, long ago our ancestors who lived on this island made a sacrifice to Shilen, goddess of the deep seas, every year for the safety of all ships that sail into these harbors. But now most of the residents have forgotten this tradition. I'm sure that is what has made the goddess so angry. Fallius, the Wharf Manager, and I still continue this ceremony every year. We have not been able to hold the ritual this year yet, as the newly appointed Priest to the island doesn't like it. But see what happens? I think it would be best to hold the ceremony, even if it means doing it in secret. That is the only way to calm the raging waves and violent waters. Do you think you can help? I need the help of someone else in order to prepare for the ceremony. Say you will help [30312-04.htm] Lighthouse Keeper Rockswell: Long ago, they say they sacrificed virgins to the sea, but times have changed and there is no sailor who keeps this tradition. Instead, we set afloat a boat that contains a doll in the shape of a Human maiden. Now we have to make that doll. I've asked Warehouse Keeper Rolfe, who is handy with his hands, to make the doll, but we still have to make the doll's long hair. For that, I need high quality fur yarn. Hunt the keltirs on the island and gather about ten bundles of fur, then take them to Cristel in the next village. You can find her at the well in front of the village warehouse. Give the fur to Cristel, and she will spin it into yarn. Take the yarn and give it to Warehouse Keeper Rolfe. He will probably finish the doll on the spot. As soon as the doll is finished, bring it back to me. I will give you generous reward for your labor. [30312-05.htm] Lighthouse Keeper Rockswell: You still don't have enough keltir furs. If you collect ten pelts of keltir fur and go see Cristel, she will make them into yarn for you. You can meet Cristel at the well in front of the village warehouse. Then, take the yarn she gives you and go find Rolfe. You can meet Rolfe at the warehouse. [30312-06.htm] Lighthouse Keeper Rockswell: So Cristel has spun the yarn for me. I am always grateful to her. Give this yarn to Rolfe. You can find Rolfe at the warehouse. [30312-07.htm] Lighthouse Keeper Rockswell: So this is the doll that Rolfe has made. Indded he lives up to his fame as a tailor, with such delicate handiwork. These Glass Eyes give the impression that it is alive. It is perfect for the ceremony to Shilen of the deep seas. Anyway, you have done well. As promised, here is your pay. May the blessings of the sea be with you. [30312-08.htm] Lighthouse Keeper Rockswell: So you've gathered ten keltir furs. Take them to Cristel. You can find her at the well in front of the warehouse. She will spin yarn from the keltir fur. Take the keltir fur yarn to Rolfe. You can find Rolfe at the warehouse.
Исходник условий и наград (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.Q00154_SacrificeToTheSea;

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 Q00154_SacrificeToTheSea extends Quest
{
	// NPCs
	private static final int ROCKSWELL = 30312;
	private static final int CRISTEL = 30051;
	private static final int ROLFE = 30055;
	
	// Items
	private static final int FOX_FUR = 1032;
	private static final int FOX_FUR_YARN = 1033;
	private static final int MAIDEN_DOLL = 1034;
	
	// Reward
	private static final int EARING = 113;
	
	public Q00154_SacrificeToTheSea()
	{
		super(154, "Sacrifice to the Sea");
		registerQuestItems(FOX_FUR, FOX_FUR_YARN, MAIDEN_DOLL);
		addStartNpc(ROCKSWELL);
		addTalkId(ROCKSWELL, CRISTEL, ROLFE);
		addKillId(20481, 20544, 20545); // Following Keltirs can be found near Talking Island.
	}
	
	@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("30312-04.htm"))
		{
			st.startQuest();
		}
		
		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() < 2) ? "30312-02.htm" : "30312-03.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case ROCKSWELL:
					{
						if (cond == 1)
						{
							htmltext = "30312-05.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30312-08.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30312-06.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30312-07.htm";
							takeItems(player, MAIDEN_DOLL, -1);
							giveItems(player, EARING, 1);
							addExpAndSp(player, 100, 0);
							st.exitQuest(false, true);
						}
						break;
					}
					case CRISTEL:
					{
						if (cond == 1)
						{
							htmltext = (hasQuestItems(player, FOX_FUR)) ? "30051-01.htm" : "30051-01a.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30051-02.htm";
							st.setCond(3, true);
							takeItems(player, FOX_FUR, -1);
							giveItems(player, FOX_FUR_YARN, 1);
						}
						else if (cond == 3)
						{
							htmltext = "30051-03.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30051-04.htm";
						}
						break;
					}
					case ROLFE:
					{
						if (cond < 3)
						{
							htmltext = "30055-03.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30055-01.htm";
							st.setCond(4, true);
							takeItems(player, FOX_FUR_YARN, 1);
							giveItems(player, MAIDEN_DOLL, 1);
						}
						else if (cond == 4)
						{
							htmltext = "30055-02.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				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, FOX_FUR, 1, 10, 0.4, true))
		{
			qs.setCond(2);
		}
	}
}