ZURSULUS L2

Fruit of the Mothertree

ID
161
Название
Fruit of the Mothertree
start_npcs_json
[30362]
npc_ids_json
[30362,30371]
constants_json
{"ANDELLIA":30362,"THALIA":30371,"ANDELLIA_LETTER":1036,"MOTHERTREE_FRUIT":1037}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00161_FruitOfTheMotherTree/Q00161_FruitOfTheMotherTree.java

NPC квеста

IDНазваниеСтарт квестаУровень
30362AndelliaДа70
30371ThaliaНет70

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

else if (player.getLevel() < 3)

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

giveItems(player, ANDELLIA_LETTER, 1);
giveAdena(player, 1000, true);
addExpAndSp(player, 1000, 0);
giveItems(player, MOTHERTREE_FRUIT, 1);

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

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

[30362-00.htm] Andellia: Stranger from foreign lands, you are welcome as a guest to our town. It is not polite to ask favors of our guests. Please make yourself comfortable and find rest under the shade of the Mother Tree. (This quest may only be undertaken by Elf characters.) [30362-02.htm] Andellia: My sisters and I are in charge of taking care of the young Mother Trees in the forest. This task lets us see the changes to the Mother Trees and the Elven woods in all four seasons, and we find it a delightful task. The nectar that gives we children of the forest our nearly eternal lives is made from the fruit of the Mother Tree. Fruit harvests have been gradually decreasing lately, and I think it is because of the spores that spread to our woods from the Sea of Spores on the other side of the mountain. At this rate, we may not be able to make nectar anymore. My sister Thalia is the protector of the Mother Tree near Lake Iris, and has said that the Mother Tree there may soon bear fruit. Do you think you could go and get the fruit from her when it is ready? (This quest may only be undertaken by an Elven character of level 3 and above.) [30362-03.htm] Andellia: My sisters and I are in charge of taking care of the young Mother Trees in the forest. It is our joy in life to take care of the Mother Trees in all four seasons while keeping company with the creatures of the beautiful Elven Forest. The nectar that gives us children of the forest our nearly eternal lives is made from the Fruit of The Mother Tree. Fruit harvests have been gradually decreasing lately, and I think it is because of the spores that spread to our woods from the Sea of Spores on the other side of the mountain. A few days ago, I received a letter from my younger sister, Thalia, that the Mother Tree near Lake Iris had borne fruit. We sisters cannot travel far from our Mother Trees, as we must stay close and maintain our tie to it. My sister has probably finished her harvest by now. Would you be able to travel there and bring back the fruit from her? No one but us sisters may harvest the Mother Tree's fruits, and it is a rare opportunity to be able to see a real Mother Tree fruit in person. Say you will perform the task [30362-04.htm] Andellia: Thank you so much. First, take this letter. Show it to Thalia and she will know that I sent you. Get the Mother Tree fruit from her and bring it back to me. Please hurry, as the fruit may spoil. We cannot make nectar from spoiled fruit. Just follow the southern path from the village to reach Lake Iris. My sister Thalia lives in the small observatory on the eastern lake shore. Thank you in advance and please send her my regards. [30362-05.htm] Andellia: Oh, you haven't left yet. Take my letter to my sister Thalia and bring back the Mother Tree fruit. Follow the southern path from the village to reach Lake Iris. My sister Thalia lives in the small observatory around the lake on the eastern shore. Please hurry, as the fruit may spoil. Thank you. [30362-06.htm] Andellia: Thank you. You have performed an important deed, not only for my sisters and I, but for all of the children of the forest. I will give you this as a token of our thanks. It will be useful someday. Kind traveler, may Eva's smile light your path. [30371-01.htm] Thalia: My sister Andellia has sent you, I see. This is the Mother Tree fruit I harvested this year. It is a very precious fruit, the only one that has been harvested this year. Please deliver it safely to my sister Andellia in the village. Ask about the geography around Lake Iris [30371-02.htm] Thalia: Haven't you left yet? Please deliver this Mother Tree fruit to Andellia. You need to get there before the fruit spoils ... Ask about the geography around Lake Iris [30371-03.htm] Thalia: Lake Iris has an irregular shape. North of the lake is the Elven Village, while the falls are located to the northwest. To the west is the Underground Elven Fortress. Beyond the Misty Mountains to the north, there is a place which was formerly a battlefield ... But now, everything there has become deformed due to magical influences, only the poisonous Sea of Spores remains.
Исходник условий и наград (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.Q00161_FruitOfTheMotherTree;

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

public class Q00161_FruitOfTheMotherTree extends Quest
{
	// NPCs
	private static final int ANDELLIA = 30362;
	private static final int THALIA = 30371;
	
	// Items
	private static final int ANDELLIA_LETTER = 1036;
	private static final int MOTHERTREE_FRUIT = 1037;
	
	public Q00161_FruitOfTheMotherTree()
	{
		super(161, "Fruit of the Mothertree");
		registerQuestItems(ANDELLIA_LETTER, MOTHERTREE_FRUIT);
		addStartNpc(ANDELLIA);
		addTalkId(ANDELLIA, THALIA);
	}
	
	@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("30362-04.htm"))
		{
			st.startQuest();
			giveItems(player, ANDELLIA_LETTER, 1);
		}
		
		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:
			{
				if (player.getRace() != Race.ELF)
				{
					htmltext = "30362-00.htm";
				}
				else if (player.getLevel() < 3)
				{
					htmltext = "30362-02.htm";
				}
				else
				{
					htmltext = "30362-03.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case ANDELLIA:
					{
						if (cond == 1)
						{
							htmltext = "30362-05.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30362-06.htm";
							takeItems(player, MOTHERTREE_FRUIT, 1);
							giveAdena(player, 1000, true);
							addExpAndSp(player, 1000, 0);
							st.exitQuest(false, true);
						}
						break;
					}
					case THALIA:
					{
						if (cond == 1)
						{
							htmltext = "30371-01.htm";
							st.setCond(2, true);
							takeItems(player, ANDELLIA_LETTER, 1);
							giveItems(player, MOTHERTREE_FRUIT, 1);
						}
						else if (cond == 2)
						{
							htmltext = "30371-02.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}