ZURSULUS L2

An Obvious Lie

ID
32
Название
An Obvious Lie
start_npcs_json
[30120]
npc_ids_json
[30094,30120,31706]
constants_json
{"GENTLER":30094,"MAXIMILIAN":30120,"MIKI_THE_CAT":31706,"SUEDE":1866,"THREAD":1868,"SPIRIT_ORE":3031,"MAP":7165,"MEDICINAL_HERB":7166,"CAT_EARS":6843,"RACOON_EARS":7680,"RABBIT_EARS":7683}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00032_AnObviousLie/Q00032_AnObviousLie.java

NPC квеста

IDНазваниеСтарт квестаУровень
30094GentlerНет70
30120MaximilianДа70
31706Miki the CatНет70

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

htmltext = (player.getLevel() < 45) ? "30120-0a.htm" : "30120-0.htm";

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

giveItems(player, MAP, 1);
giveItems(player, CAT_EARS, 1);
giveItems(player, RACOON_EARS, 1);
giveItems(player, RABBIT_EARS, 1);

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

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

[30094-0.htm] Magic Trader Gentler: Welcome. What can I do for you? Ah yes, I'd love to fulfill the high priest's request, but I don't think I can make that medicine. I sent Miki the Cat looking for Moretti's herbs, but I lost contact with him. Should I look for him? [30094-1.htm] Magic Trader Gentler: If you can find him for me, I'll give you a great reward. Actually, Miki the cat gets lost easily, so I got him a map, but he forgot it. Last I heard from him he was at the entrance to Devil's Isle. He went to get some other herbs, and hasn't been back. If you see him, give him this map and bring me the herbs! [30094-10.htm] Magic Trader Gentler: I'm not lying! Call the guards, you still won't get any. I'll make you a very valuable ornament instead. Just find the raw materials. I'll need 1000 Threads and 500 Suedes. I have the rest. You can't find this just anywhere, it fetches a high price! [30094-11.htm] Magic Trader Gentler: I requested 1000 Threads and 500 Suedes. [30094-12.htm] Magic Trader Gentler: Now let me have them. Still don't trust me? It'll be worth it! What'll it be? Take them! But don't trick me again, or else! [30094-13.htm] Magic Trader Gentler: Be patient! Still don't trust me? What kind of shape do you want? Please pick one. Cat's Ear. Raccoon's Ear Rabbit's Ear [30094-14.htm] Magic Trader Gentler: I made this accessory to redeem my debts. They have now been paid. Goodbye. [30094-2.htm] Magic Trader Gentler: You forgot where the last message came from, didn't you? Miki the Cat was last seen at the entrance to Devil's Isle. Start your search there! Good luck! [30094-3.htm] Magic Trader Gentler: You found him? I was right! I was wandering about. May I have the herbs? Here are the herbs. [30094-4.htm] Trader Gentler: Thank you. Now I can make the medicine. First grind this herb into a fine powder. Then, I need to add some Spirit Ore powder. Rats! I don't have any Spirit Ore left. I'm sorry. Can you get 500 Spirit Ore for me? If I don't grind it in soon, the medicine will lose potency. Can you help? [30094-5.htm] Trader Gentler: If you don't bring the ore quickly, I'll lose the medicine. You'll have to pay for my loss! Go! [30094-6.htm] Trader Gentler: Good, your brought back 500 Spirit Ore. Let me finish here. Let me have the ore. Here it is. [30094-7.htm] Trader Gentler: You finally finished, huh? What are you still doing here? You want payment? You should talk to Miki the cat about your payment. It's not my responsibility! By the terms of the contract, he's responsible for all additional costs due to any delay in delivery! [30094-8.htm] Trader Gentler: The contract says Miki the Cat should pay for any additional expenses. Bother him, not me! [30094-9.htm] Trader Gentler: What can I do for you? I think I told you to visit Miki the Cat. Hmm. Did you meet him? Then, why did you come to me? Oh! You're smarter than I thought. I have to agree with that. However, I have no Adena to pay with. Are you cheating me again? [30120-0.htm] High Priest Maximilian: By the grace of Einhasad, you're here! Would you help me? What can I do? [30120-0a.htm] High Priest Maximilian: By the grace of Einhasad, you're here! Would you help me? (This quest may only be undertaken by a character of level 45 and above.) [30120-1.htm] High Priest Maximilian: I asked Trader Gentler of Giran Castle Town to mix a batch of medicine for me, but he's having trouble acquiring some key ingredients. Help him find them. [30120-2.htm] High Priest Maximilian: Talk to Trader Gentler of Giran Castle Town for more information. [31706-0.htm] Miki the Cat: Meow~! Did Gentler send anything with you? Oh, I'm late! Meow~! Here's the map. [31706-1.htm] Miki the Cat: He did send me the map! Meow~! Thank you for delivering it. I don't have any Moretti's herb for him, I lost it while wandering around. I'll tell you where to get some, though. Will you get it for me? I'm sure Gentler will give you a proper reward. You can get them from alligators on Alligator Island. They eat the herbs for digestion. Hunt alligators, get 20 herbs and go straight to Gentler when you're done. [31706-2.htm] Miki the Cat: Meow~! You can find the herb in the stomachs of alligators on Alligator Island. Meow~! Gentler needs 20 of them. Meow~! [31706-3.htm] Miki the Cat: What now? Meow~! I'd like my payment now! [31706-4.htm] Miki the Cat: What are you talking about? Are you saying Gentler told you to get the payment for the runestone from me? I never signed such a contract! Our agreement was that I would bring the herbs on time and he would pay me for them. He probably thought he wouldn't see me again because I wander about so much. Go back to Gentler and get the reward from him! [31706-5.htm] Miki the Cat: See Gentler for your reward. Meow~! Quickly, before he leaves! Meow~!
Исходник условий и наград (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.Q00032_AnObviousLie;

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 Q00032_AnObviousLie extends Quest
{
	// NPCs
	private static final int GENTLER = 30094;
	private static final int MAXIMILIAN = 30120;
	private static final int MIKI_THE_CAT = 31706;
	
	// Items
	private static final int SUEDE = 1866;
	private static final int THREAD = 1868;
	private static final int SPIRIT_ORE = 3031;
	private static final int MAP = 7165;
	private static final int MEDICINAL_HERB = 7166;
	
	// Rewards
	private static final int CAT_EARS = 6843;
	private static final int RACOON_EARS = 7680;
	private static final int RABBIT_EARS = 7683;
	
	public Q00032_AnObviousLie()
	{
		super(32, "An Obvious Lie");
		registerQuestItems(MAP, MEDICINAL_HERB);
		addStartNpc(MAXIMILIAN);
		addTalkId(MAXIMILIAN, GENTLER, MIKI_THE_CAT);
		addKillId(20135); // Alligator
	}
	
	@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 "30120-1.htm":
			{
				st.startQuest();
				break;
			}
			case "30094-1.htm":
			{
				st.setCond(2, true);
				giveItems(player, MAP, 1);
				break;
			}
			case "31706-1.htm":
			{
				st.setCond(3, true);
				takeItems(player, MAP, 1);
				break;
			}
			case "30094-4.htm":
			{
				st.setCond(5, true);
				takeItems(player, MEDICINAL_HERB, 20);
				break;
			}
			case "30094-7.htm":
			{
				if (getQuestItemsCount(player, SPIRIT_ORE) < 500)
				{
					htmltext = "30094-5.htm";
				}
				else
				{
					st.setCond(6, true);
					takeItems(player, SPIRIT_ORE, 500);
				}
				break;
			}
			case "31706-4.htm":
			{
				st.setCond(7, true);
				break;
			}
			case "30094-10.htm":
			{
				st.setCond(8, true);
				break;
			}
			case "30094-13.htm":
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
				break;
			}
			case "cat":
			{
				if ((getQuestItemsCount(player, THREAD) < 1000) || (getQuestItemsCount(player, SUEDE) < 500))
				{
					htmltext = "30094-11.htm";
				}
				else
				{
					htmltext = "30094-14.htm";
					takeItems(player, SUEDE, 500);
					takeItems(player, THREAD, 1000);
					giveItems(player, CAT_EARS, 1);
					st.exitQuest(false, true);
				}
				break;
			}
			case "racoon":
			{
				if ((getQuestItemsCount(player, THREAD) < 1000) || (getQuestItemsCount(player, SUEDE) < 500))
				{
					htmltext = "30094-11.htm";
				}
				else
				{
					htmltext = "30094-14.htm";
					takeItems(player, SUEDE, 500);
					takeItems(player, THREAD, 1000);
					giveItems(player, RACOON_EARS, 1);
					st.exitQuest(false, true);
				}
				break;
			}
			case "rabbit":
			{
				if ((getQuestItemsCount(player, THREAD) < 1000) || (getQuestItemsCount(player, SUEDE) < 500))
				{
					htmltext = "30094-11.htm";
				}
				else
				{
					htmltext = "30094-14.htm";
					takeItems(player, SUEDE, 500);
					takeItems(player, THREAD, 1000);
					giveItems(player, RABBIT_EARS, 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() < 45) ? "30120-0a.htm" : "30120-0.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case MAXIMILIAN:
					{
						htmltext = "30120-2.htm";
						break;
					}
					case GENTLER:
					{
						if (cond == 1)
						{
							htmltext = "30094-0.htm";
						}
						else if ((cond == 2) || (cond == 3))
						{
							htmltext = "30094-2.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30094-3.htm";
						}
						else if (cond == 5)
						{
							htmltext = (getQuestItemsCount(player, SPIRIT_ORE) < 500) ? "30094-5.htm" : "30094-6.htm";
						}
						else if (cond == 6)
						{
							htmltext = "30094-8.htm";
						}
						else if (cond == 7)
						{
							htmltext = "30094-9.htm";
						}
						else if (cond == 8)
						{
							htmltext = ((getQuestItemsCount(player, THREAD) < 1000) || (getQuestItemsCount(player, SUEDE) < 500)) ? "30094-11.htm" : "30094-12.htm";
						}
						break;
					}
					case MIKI_THE_CAT:
					{
						if (cond == 2)
						{
							htmltext = "31706-0.htm";
						}
						else if ((cond > 2) && (cond < 6))
						{
							htmltext = "31706-2.htm";
						}
						else if (cond == 6)
						{
							htmltext = "31706-3.htm";
						}
						else if (cond > 6)
						{
							htmltext = "31706-5.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, 3, 3, npc);
		if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, MEDICINAL_HERB, 1, 20, 1, true))
		{
			qs.setCond(4, true);
		}
	}
}