ZURSULUS L2

Wild Maiden

ID
653
Название
Wild Maiden
start_npcs_json
[32013]
npc_ids_json
[30181,32013]
constants_json
{"SUKI":32013,"GALIBREDO":30181,"SCROLL_OF_ESCAPE":736}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00653_WildMaiden/Q00653_WildMaiden.java

NPC квеста

IDНазваниеСтарт квестаУровень
30181GalibredoНет70
32013SukiДа70

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

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

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

giveAdena(player, 2883, true);

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

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

[30181-01.htm] Galibredo: Thank you so much! Thanks to you, my daughter made it home safely. I certainly gave her a good talking-to! I swear, I don't know what I'm going to do with that girl! I'm afraid something terrible will happen to her someday... Humph! By the way, take this! It's not much, but think of it as a small token of my appreciation. Thank you again. What's a father to do... [32013-01.htm] Suki: It seems that Suki doesn't trust you. There's nothing you can do for her at this time. (This quest may only be undertaken by a character of level 36 and above.) [32013-02.htm] Suki: Good heavens! Oh, my ... ... You're an adventurer, aren't you? You certainly surprised me. Who am I? My name's Suki! What am I doing here? Honestly, I fell in love with a wonderful Warrior who came to our town not too long ago. A dark face with a melancholy shadow... Sinewy hands held his sword tight... He admired my pure heart and then he... he kissed my... Oh my! Some things are better left unsaid... Anyway, when he left, he wouldn't let me go with him, saying that it was too dangerous for me... Although I knew the danger well, I secretly followed him! I got lost and wound up here... The days have been hard here. My skin has grown rough and I haven't eaten in days! I would give anything just to get back home! "Go on home. This will take you there." "What? Are you crazy? Go and find your man!" [32013-03.htm] Suki: Oh, thank you so much! I can now go home safely! By the way... You have such smooth skin and great body tone... Not to mention that fine looking face! If you're ever in the Town of Oren, speak with Galibredo. He's my father, and he'll reward your kindness. Well, I should be going... Goodbye and good luck! [32013-03a.htm] Suki: I appreciate your kindness, but I need a Scroll of Escape in order to move. I am injured, and can't move back to Oren. [32013-04.htm] Suki: Humph! Oh yeah? If I die out here, it'll be all your fault! Humph! [32013-04a.htm] Suki: Hey, you! Thanks again to help me last time! Don't forget to see my father in Town of Oren, he should have a nice reward for you. His name is Galibredo.
Исходник условий и наград (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.Q00653_WildMaiden;

import org.l2jmobius.gameserver.entity.Location;
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 org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;

public class Q00653_WildMaiden extends Quest
{
	// NPCs
	private static final int SUKI = 32013;
	private static final int GALIBREDO = 30181;
	
	// Item
	private static final int SCROLL_OF_ESCAPE = 736;
	
	// Table of possible spawns
	private static final Location[] SPAWNS =
	{
		new Location(66578, 72351, -3731, 0),
		new Location(77189, 73610, -3708, 2555),
		new Location(71809, 67377, -3675, 29130),
		new Location(69166, 88825, -3447, 43886)
	};
	
	// Current position
	private int _currentPosition = 0;
	
	public Q00653_WildMaiden()
	{
		super(653, "Wild Maiden");
		addStartNpc(SUKI);
		addTalkId(SUKI, GALIBREDO);
		addSpawn(SUKI, 66578, 72351, -3731, 0, false, 0);
	}
	
	@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("32013-03.htm"))
		{
			if (hasQuestItems(player, SCROLL_OF_ESCAPE))
			{
				st.startQuest();
				takeItems(player, SCROLL_OF_ESCAPE, 1);
				npc.broadcastPacket(new MagicSkillUse(npc, npc, 2013, 1, 3500, 0));
				startQuestTimer("apparition_npc", 4000, npc, player, false);
			}
			else
			{
				htmltext = "32013-03a.htm";
				st.exitQuest(true);
			}
		}
		else if (event.equals("apparition_npc"))
		{
			int chance = getRandom(4);
			
			// Loop to avoid to spawn to the same place.
			while (chance == _currentPosition)
			{
				chance = getRandom(4);
			}
			
			// Register new position.
			_currentPosition = chance;
			
			npc.deleteMe();
			addSpawn(SUKI, SPAWNS[chance], false, 0);
			return null;
		}
		
		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() < 36) ? "32013-01.htm" : "32013-02.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case GALIBREDO:
					{
						htmltext = "30181-01.htm";
						giveAdena(player, 2883, true);
						st.exitQuest(true, true);
						break;
					}
					case SUKI:
					{
						htmltext = "32013-04a.htm";
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
}