ZURSULUS L2

Help the Sister!

ID
43
Название
Help the Sister!
start_npcs_json
[30829]
npc_ids_json
[20171,20197,30097,30829]
constants_json
{"COOPER":30829,"GALLADUCCI":30097,"SPECTER":20171,"SORROW_MAIDEN":20197,"CRAFTED_DAGGER":220,"MAP_PIECE":7550,"MAP":7551,"PET_TICKET":7584}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00043_HelpTheSister/Q00043_HelpTheSister.java

NPC квеста

IDНазваниеСтарт квестаУровень
20171SpecterНет26
20197Sorrow MaidenНет27
30097GalladucciНет70
30829CooperДа70

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

htmltext = (player.getLevel() < 26) ? "30829-00a.htm" : "30829-00.htm";

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

giveItems(player, MAP, 1);
giveItems(player, PET_TICKET, 1);
giveItems(player, MAP_PIECE, 1);

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

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

[30097-05.htm] Trader Galladucci: The map traces some very important merchandise! To think it would end up there! Thank you! Did you find it? What? Pet Manager Cooper? Well, OK... Can you take him a message for me? "Sure, no problem!" [30097-06.htm] Trader Galladucci: Ask him to come back when I have more money. I'll treat him! Let's see... Next Tera's period would be good for me! I think I'll have some time around then! [30097-06a.htm] Trader Galladucci: Did you talk to Cooper? [30829-00.htm] Pet Manager Cooper: This stuff makes me crazy! What? Oh, sorry! I was thinking of something else... Do you have any extra adena? "Straight to the point, eh?" [30829-00a.htm] Pet Manager Cooper: You don't seem like the type that would have much extra adena... Come back when you've gotten some! (This quest may only be undertaken by a character of level 26 and above.) [30829-01.htm] Pet Manager Cooper: If you can, please bring me a crafted dagger. I need one badly! They sell them at the store nearby, but I don't have enough adena! [30829-01a.htm] Pet Manager Cooper: Please bring me a crafted dagger. I really need one. [30829-02.htm] Pet Manager Cooper: Oh, wonderful! You survivied! Frankly, even though I often say that I want to move away, it's hard to leave the big city! I must have adena to live in the territory right now! I was saving up a little every day, but when I returned home one day, I found that my sister had disappeared! She left a note saying that she was going out in the world to help me! I couldn't do much as her older brother, but I've heard that her name is on a list of graduates from Talking Island. I must see her, if only to give her a sword! I hate to ask you this so suddenly, but... Can you help me? "What do you want me to do?" [30829-03.htm] Pet Manager Cooper: I could just send a sword to my sister, but I'm worried about her. I'm afraid she's in great danger on the road to Giran! Hunt specters and sorrow maidens on the Execution Ground. Please kill at least 30. Last night I dreamed that specters and sorrow maidens were chasing my sister. The more you kill, the better her chances are! [30829-03a.htm] Pet Manager Cooper: Please catch the ghosts in the Execution Ground! I cannot sleep like this, because I feel insecure. [30829-04.htm] Pet Manager Cooper: Good job with those monsters in the Execution Ground! You got at least 30 of them, right? What's that? A piece of a map? Hmm... Let me try something...? "Here it is." [30829-05.htm] Pet Manager Cooper: The two pieces create a strange map. I remeber that the famous Galladucci said that he was waiting for an important map to be delivered, and it was running late. Is this it? [30829-05a.htm] Pet Manager Cooper: Please take the map to Galladucci at the Boutique Shop. [30829-06.htm] Pet Manager Cooper: Is it the one he was looking for? Good. Thank you so much! "Don't mention it!" [30829-07.htm] Pet Manager Cooper: All I asked was for you to make the path safer for my sister... And you've actually brought the map! Mr. Galladucci was very pleased! You shall be well-rewarded for this, my friend. This is the most valuable thing I own. It was originally reserved for those of the upper class... But this one is yours! It's a coupon you can exchange for a pet. It won't be easy to raise. You must be very careful!
Исходник условий и наград (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.Q00043_HelpTheSister;

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 Q00043_HelpTheSister extends Quest
{
	// NPCs
	private static final int COOPER = 30829;
	private static final int GALLADUCCI = 30097;
	
	// Monsters
	private static final int SPECTER = 20171;
	private static final int SORROW_MAIDEN = 20197;
	
	// Items
	private static final int CRAFTED_DAGGER = 220;
	private static final int MAP_PIECE = 7550;
	private static final int MAP = 7551;
	private static final int PET_TICKET = 7584;
	
	public Q00043_HelpTheSister()
	{
		super(43, "Help the Sister!");
		registerQuestItems(MAP_PIECE, MAP);
		addStartNpc(COOPER);
		addTalkId(COOPER, GALLADUCCI);
		addKillId(SPECTER, SORROW_MAIDEN);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		switch (event)
		{
			case "30829-01.htm":
			{
				st.startQuest();
				break;
			}
			case "30829-03.htm":
			{
				if (hasQuestItems(player, CRAFTED_DAGGER))
				{
					st.setCond(2, true);
					takeItems(player, CRAFTED_DAGGER, 1);
				}
				break;
			}
			case "30829-05.htm":
			{
				st.setCond(4, true);
				takeItems(player, MAP_PIECE, 30);
				giveItems(player, MAP, 1);
				break;
			}
			case "30097-06.htm":
			{
				st.setCond(5, true);
				takeItems(player, MAP, 1);
				break;
			}
			case "30829-07.htm":
			{
				giveItems(player, PET_TICKET, 1);
				st.exitQuest(false, true);
				break;
			}
		}
		
		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() < 26) ? "30829-00a.htm" : "30829-00.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case COOPER:
					{
						if (cond == 1)
						{
							htmltext = (!hasQuestItems(player, CRAFTED_DAGGER)) ? "30829-01a.htm" : "30829-02.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30829-03a.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30829-04.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30829-05a.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30829-06.htm";
						}
						break;
					}
					case GALLADUCCI:
					{
						if (cond == 4)
						{
							htmltext = "30097-05.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30097-06a.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isSummon)
	{
		final QuestState qs = getQuestState(player, false);
		if ((qs != null) && qs.isCond(2))
		{
			giveItems(player, MAP_PIECE, 1);
			if (getQuestItemsCount(player, MAP_PIECE) == 30)
			{
				qs.setCond(3, true);
			}
			else
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
	}
}