ZURSULUS L2

Go to the Pastureland!

ID
19
Название
Go to the Pastureland!
start_npcs_json
[31302]
npc_ids_json
[31302,31537]
constants_json
{"VLADIMIR":31302,"TUNATUN":31537,"YOUNG_WILD_BEAST_MEAT":7547}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00019_GoToThePastureland/Q00019_GoToThePastureland.java

NPC квеста

IDНазваниеСтарт квестаУровень
31302VladimirДа70
31537TunatunНет70

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

htmltext = (player.getLevel() < 63) ? "31302-03.htm" : "31302-00.htm";

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

giveItems(player, YOUNG_WILD_BEAST_MEAT, 1);
giveAdena(player, 30000, true);

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

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

[31302-00.htm] Trader Vladimir: Geez, is everyone deaf nowadays? Excuse me. Can you help me for a little while? I ordered some meat, but they sent me low-quality meat instead of what I ordered! Would you go and return this for me? Agree to do it [31302-01.htm] Trader Vladimir: You? Fine! Here is the meat! This is the kind of meat that rotten Pasture Manager Tunatun sent me! Man, the more I think about it, the angrier I get! No matter what he says, tell him that I don't care! I'm never going to do business with him again! Even if he tries to give me money, I won't accept it! Take care of it! [31302-02.htm] Trader Vladimir: What are you doing? Did you see the pasture manager? Since I got angry because of the quality, you should dispose the meat before it rots! [31302-03.htm] Trader Vladimir: You? Can you choose top-quality meat? Or can you strike a bargain with that rotten manager? I think you have a long way to go! Go and accumulate more experiences! (This quest may only be undertaken by a character of level 63 and above.) [31537-00.htm] Beast Herder Tunatun: What? Vladimir said that? Grrrr... Well, that's too bad! It's the best I could find! If only I had an adventurer to help me... Very well... Tell Vlad I'll give him his money back this time... I hope he'll continue doing business with me... Let's see... Vladimir doesn't want your crappy meat anymore. [31537-01.htm] Beast Herder Tunatun: Wow, he must really be angry..! Well, there's nothing I can do. I'll apologize to him later. For now, please take this money. At least he'll have gotten a refund when I go to talk to him later. Now, I must find some high quality meat! I need an adventurer to help me... [31537-02.htm] Beast Herder Tunatun: OK, let me see the meat... What? You don't have it? How am I supposed to verify that he sent you?
Исходник условий и наград (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.Q00019_GoToThePastureland;

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 Q00019_GoToThePastureland extends Quest
{
	// NPCs
	private static final int VLADIMIR = 31302;
	private static final int TUNATUN = 31537;
	
	// Items
	private static final int YOUNG_WILD_BEAST_MEAT = 7547;
	
	public Q00019_GoToThePastureland()
	{
		super(19, "Go to the Pastureland!");
		registerQuestItems(YOUNG_WILD_BEAST_MEAT);
		addStartNpc(VLADIMIR);
		addTalkId(VLADIMIR, TUNATUN);
	}
	
	@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("31302-01.htm"))
		{
			st.startQuest();
			giveItems(player, YOUNG_WILD_BEAST_MEAT, 1);
		}
		else if (event.equals("019_finish"))
		{
			if (hasQuestItems(player, YOUNG_WILD_BEAST_MEAT))
			{
				htmltext = "31537-01.htm";
				takeItems(player, YOUNG_WILD_BEAST_MEAT, 1);
				giveAdena(player, 30000, true);
				st.exitQuest(false, true);
			}
			else
			{
				htmltext = "31537-02.htm";
			}
		}
		
		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() < 63) ? "31302-03.htm" : "31302-00.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case VLADIMIR:
					{
						htmltext = "31302-02.htm";
						break;
					}
					case TUNATUN:
					{
						htmltext = "31537-00.htm";
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}