ZURSULUS L2

Make a Pair of Dress Shoes

ID
33
Название
Make a Pair of Dress Shoes
start_npcs_json
[30838]
npc_ids_json
[30164,30838,31520]
constants_json
{"WOODLEY":30838,"IAN":30164,"LEIKAR":31520,"LEATHER":1882,"THREAD":1868,"ADENA":57,"DRESS_SHOES_BOX":7113}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00033_MakeAPairOfDressShoes/Q00033_MakeAPairOfDressShoes.java

NPC квеста

IDНазваниеСтарт квестаУровень
30164IanНет70
30838WoodleyДа70
31520LeikarНет70

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

if (player.getLevel() >= 60)

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

giveItems(player, DRESS_SHOES_BOX, 1);

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

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

[30164-0.htm] Trader Ian: Come in! What can I do for you? Ah yes, a payment from Woodley! That's 300,000 adena, right? Here it is. [30164-1.htm] Trader Ian: Humph! Only 300,000 adena for the excellent item I made for him? I suppose I'll accept this time! Tell Mr. Woodley that his balance is paid off, but next time, I'll have to charge a late fee! [30164-1a.htm] Trader Ian: So, Mr. Woodley sent you? Where is his payment? Did you drop it by any chance? Please check your pockets! [30164-2.htm] Trader Ian: You haven't seen Mr. Woodley? When you do, tell him that I'll accept his payment this time, but next time he's late, I'll charge him a late fee. [30838-0.htm] Trader Woodley: Welcome. What can I do for you? Looking for formal shoes? If you want the shoes to match the order you placed with Leikar, I need some of the same material. Bring it, then I can start. Quest [30838-0a.htm] Trader Woodley: Welcome. What can I do for you? Looking for formal shoes? If you want the shoes to match the order you placed with Leikar, I need some of the same material. Bring it, then I can start. (This quest may only be undertaken by a character who advanced first in Make Formal Wear quest.) [30838-0b.htm] Trader Woodley: Welcome. What can I do for you? Looking for formal shoes? If you want the shoes to match the order you placed with Leikar, I need some of the same material. Bring it, then I can start. (This quest may only be undertaken by a character of level 60 and above.) [30838-1.htm] Trader Woodley: If you get some of the same material from your order with Leikar, I can make you shoes to match. [30838-2.htm] Trader Woodley: Leikar's short on fabric? It's hard to make something using the color but not the fabric. Can you help? I'll try. [30838-3.htm] Trader Woodley: I need 200 leathers and 600 threads for the shoes. You also have to pay for them. It's about five hundred thousand adena. Don't forget! [30838-4.htm] Trader Woodley: You brought it all! Give me two hundred thousand Adena and we'll call it good. Here's the money and the goods. [30838-4a.htm] Trader Woodley: I know these materials are hard to get now, but hurry! [30838-5.htm] Trader Woodley: This will take a while to make. Deliver three hundred thousand adena to Trader Ian for the materials. [30838-5a.htm] Trader Woodley: I'm still working on the shoes. Did you deliver three hundred thousand Adena to Ian? [30838-6.htm] Trader Woodley: What did Ian say? I'll respect his requests. Can I have the shoes? [30838-7.htm] Trader Woodley: They should be well protected in this box. Be careful! [31520-0.htm] Leikar: Have you already been to Mr. Woodley? Even Mr. Woodley couldn't have made a pair of formal dress shoes so quickly! Did something happen that I need to know about? I need the materials for the formal wear. [31520-1.htm] Leikar: Oh! We need the fabric for the formal wear so that we can match the color of the shoes. Tell Mr. Woodley that I don't have any fabric to give him now and he should use his best judgement regarding the shoes. Tell him to make them the same as before, he'll understand. [31520-1a.htm] Leikar: You haven't left yet? I can't get new fabric... Tell Mr. Woodley to use the same color as before for the shoes.
Исходник условий и наград (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.Q00033_MakeAPairOfDressShoes;

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;

import quests.Q00037_MakeFormalWear.Q00037_MakeFormalWear;

public class Q00033_MakeAPairOfDressShoes extends Quest
{
	// NPCs
	private static final int WOODLEY = 30838;
	private static final int IAN = 30164;
	private static final int LEIKAR = 31520;
	
	// Items
	private static final int LEATHER = 1882;
	private static final int THREAD = 1868;
	private static final int ADENA = 57;
	
	// Rewards
	public static final int DRESS_SHOES_BOX = 7113;
	
	public Q00033_MakeAPairOfDressShoes()
	{
		super(33, "Make a Pair of Dress Shoes");
		addStartNpc(WOODLEY);
		addTalkId(WOODLEY, IAN, LEIKAR);
	}
	
	@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 "30838-1.htm":
			{
				st.startQuest();
				break;
			}
			case "31520-1.htm":
			{
				st.setCond(2, true);
				break;
			}
			case "30838-3.htm":
			{
				st.setCond(3, true);
				break;
			}
			case "30838-5.htm":
			{
				if ((getQuestItemsCount(player, LEATHER) >= 200) && (getQuestItemsCount(player, THREAD) >= 600) && (getQuestItemsCount(player, ADENA) >= 200000))
				{
					st.setCond(4, true);
					takeItems(player, ADENA, 200000);
					takeItems(player, LEATHER, 200);
					takeItems(player, THREAD, 600);
				}
				else
				{
					htmltext = "30838-4a.htm";
				}
				break;
			}
			case "30164-1.htm":
			{
				if (getQuestItemsCount(player, ADENA) >= 300000)
				{
					st.setCond(5, true);
					takeItems(player, ADENA, 300000);
				}
				else
				{
					htmltext = "30164-1a.htm";
				}
				break;
			}
			case "30838-7.htm":
			{
				giveItems(player, DRESS_SHOES_BOX, 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:
			{
				if (player.getLevel() >= 60)
				{
					final QuestState fwear = player.getQuestState(Q00037_MakeFormalWear.class.getSimpleName());
					if ((fwear != null) && fwear.isCond(7))
					{
						htmltext = "30838-0.htm";
					}
					else
					{
						htmltext = "30838-0a.htm";
					}
				}
				else
				{
					htmltext = "30838-0b.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case WOODLEY:
					{
						if (cond == 1)
						{
							htmltext = "30838-1.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30838-2.htm";
						}
						else if (cond == 3)
						{
							if ((getQuestItemsCount(player, LEATHER) >= 200) && (getQuestItemsCount(player, THREAD) >= 600) && (getQuestItemsCount(player, ADENA) >= 200000))
							{
								htmltext = "30838-4.htm";
							}
							else
							{
								htmltext = "30838-4a.htm";
							}
						}
						else if (cond == 4)
						{
							htmltext = "30838-5a.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30838-6.htm";
						}
						break;
					}
					case LEIKAR:
					{
						if (cond == 1)
						{
							htmltext = "31520-0.htm";
						}
						else if (cond > 1)
						{
							htmltext = "31520-1a.htm";
						}
						break;
					}
					case IAN:
					{
						if (cond == 4)
						{
							htmltext = "30164-0.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30164-2.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}