ZURSULUS L2

Meeting with the Golden Ram

ID
18
Название
Meeting with the Golden Ram
start_npcs_json
[31314]
npc_ids_json
[31314,31315,31555]
constants_json
{"DONAL":31314,"DAISY":31315,"ABERCROMBIE":31555,"SUPPLY_BOX":7245}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00018_MeetingWithTheGoldenRam/Q00018_MeetingWithTheGoldenRam.java

NPC квеста

IDНазваниеСтарт квестаУровень
31314DonalДа70
31315DaisyНет70
31555AbercrombieНет70

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

htmltext = (player.getLevel() < 66) ? "31314-02.htm" : "31314-01.htm";

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

giveItems(player, SUPPLY_BOX, 1);
giveAdena(player, 15000, true);
addExpAndSp(player, 50000, 0);

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

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

[31314-01.htm] Warehouse Chief Donal: The Golden Ram Mercenary Force are in the the Swamp of Screams fighting stakatos. I'm looking for someone to deliver war supplies, are you interested? Say you are interested. [31314-02.htm] Warehouse Chief Donal: This is too difficult for you. (This quest may only be undertaken by a character of level 66 and above.) [31314-03.htm] Warehouse Chief Donal: Get the supplies from my niece Daisy. I heard the Golden Ram might be recruiting if you are interested. [31314-04.htm] Warehouse Chief Donal: Get the supplies from my niece Daisy and take them to the Swamp of Screams. [31315-01.htm] Warehouse Freightman Daisy: Uncle Donal sent you? Here's the box! Heavy, isn't it? Deliver it quickly before the winter comes! "You can count on me." [31315-02.htm] Warehouse Freightman Daisy: Take it to the mercenary forces temporary outpost in the east part of the Swamp of Screams. I'll mark it on your Map. Speak with Mercenary Supplier Abercrombie. Thanks, and be careful! [31315-03.htm] Warehouse Freightman Daisy: Hurry and deliver the box to Mercenary Supplier Abercrombie! I marked the Map, didn't I? [31555-01.htm] Mercenary Supplier Abercrombie: Are these the supplies from Daisy? "Here's the box." [31555-02.htm] Mercenary Supplier Abercrombie: Hey, ale and mutton pie! You want a drink? What do you think of mercenary life? We're recruiting!
Исходник условий и наград (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.Q00018_MeetingWithTheGoldenRam;

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 Q00018_MeetingWithTheGoldenRam extends Quest
{
	// NPCs
	private static final int DONAL = 31314;
	private static final int DAISY = 31315;
	private static final int ABERCROMBIE = 31555;
	
	// Items
	private static final int SUPPLY_BOX = 7245;
	
	public Q00018_MeetingWithTheGoldenRam()
	{
		super(18, "Meeting with the Golden Ram");
		
		registerQuestItems(SUPPLY_BOX);
		addStartNpc(DONAL);
		addTalkId(DONAL, DAISY, ABERCROMBIE);
	}
	
	@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 "31314-03.htm":
			{
				st.startQuest();
				break;
			}
			case "31315-02.htm":
			{
				st.setCond(2, true);
				giveItems(player, SUPPLY_BOX, 1);
				break;
			}
			case "31555-02.htm":
			{
				takeItems(player, SUPPLY_BOX, 1);
				giveAdena(player, 15000, true);
				addExpAndSp(player, 50000, 0);
				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() < 66) ? "31314-02.htm" : "31314-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case DONAL:
					{
						htmltext = "31314-04.htm";
						break;
					}
					case DAISY:
					{
						if (cond == 1)
						{
							htmltext = "31315-01.htm";
						}
						else if (cond == 2)
						{
							htmltext = "31315-03.htm";
						}
						break;
					}
					case ABERCROMBIE:
					{
						if (cond == 2)
						{
							htmltext = "31555-01.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}