ZURSULUS L2

Trespassing into the Sacred Area

ID
368
Название
Trespassing into the Sacred Area
start_npcs_json
[30926]
npc_ids_json
[30926]
constants_json
{"RESTINA":30926,"FANG":5881}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00368_TrespassingIntoTheHolyGround/Q00368_TrespassingIntoTheHolyGround.java

NPC квеста

IDНазваниеСтарт квестаУровень
30926RestinaДа70

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

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

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

giveAdena(player, reward, true);
giveItems(st.getPlayer(), FANG, 1);

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

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

[30926-01.htm] Priestess Restina: Have you heard of the Garden of Eva? You may occasionally find the goddess herself resting there. She doesn't like to be disturbed, so her garden is in the deepest part of the sea, with entry gained only through an elaborate labyrinth. Recently, some who wish to harm her have invaded her sanctuary. She's not there at the moment, and we, her priests and guards, are trying our best to drive out the invaders. However, this task is proving more than we can handle. We're enlisting the help of outsiders to defeat them. Will you help us? "I will help." [30926-01a.htm] Priestess Restina: Have you heard of the Garden of Eva? You may occasionally find the goddess herself resting there. She doesn't like to be disturbed, so her garden is in the deepest part of the sea, with entry gained only through an elaborate labyrinth. Recently, some who wish to harm her have invaded her sanctuary. She's not there at the moment, and we, her priests and guards, are trying our best to drive out the invaders. However, this task is proving more than we can handle. We need help desperately, but I'm afraid you're not yet up to the task. (This quest may only be undertaken by a character of level 36 and above.) [30926-02.htm] Priestess Restina: Thank you. You should know that it is forbidden for outsiders to enter the Garden of Eva. We are breaking the rules, but these are desperate times. Go to the Garden of Eva and slay the blade stakato, the blade stakato worker, the blade stakato warrior and the blade stakato drone. As proof of your victory, bring back their fangs. You'll be well rewarded for your efforts. [30926-03.htm] Priestess Restina: As I said, go to the Garden of Eva and slay the blade stakato, the blade stakato worker, the blade stakato warrior and the blade stakato drone. As proof of your victory bring back their fangs. You'll be well rewarded for your efforts. "No, I quit." "I will continue to hunt the stakatos." [30926-04.htm] Priestess Restina: Thank you for helping us. As promised, you shall receive a reward commensurate with your performance. Your brave efforts have spelled the doom of all who have invaded the Garden of Eva! Will you stay and help us finish them off? "I must be going." "Death to the blade stakatos!" [30926-05.htm] Priestess Restina: I'm sorry to hear that. I'm sure you have your own reasons. Thank you for your help. May the blessing of Eva be with you always... [30926-06.htm] Priestess Restina: I knew I could count on 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.Q00368_TrespassingIntoTheHolyGround;

import java.util.HashMap;
import java.util.Map;

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 Q00368_TrespassingIntoTheHolyGround extends Quest
{
	// NPC
	private static final int RESTINA = 30926;
	
	// Item
	private static final int FANG = 5881;
	
	// Drop chances
	private static final Map<Integer, Integer> CHANCES = new HashMap<>();
	static
	{
		CHANCES.put(20794, 500000);
		CHANCES.put(20795, 770000);
		CHANCES.put(20796, 500000);
		CHANCES.put(20797, 480000);
	}
	
	public Q00368_TrespassingIntoTheHolyGround()
	{
		super(368, "Trespassing into the Sacred Area");
		registerQuestItems(FANG);
		addStartNpc(RESTINA);
		addTalkId(RESTINA);
		addKillId(20794, 20795, 20796, 20797);
	}
	
	@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("30926-02.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30926-05.htm"))
		{
			st.exitQuest(true, true);
		}
		
		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) ? "30926-01a.htm" : "30926-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int fangs = getQuestItemsCount(player, FANG);
				if (fangs == 0)
				{
					htmltext = "30926-03.htm";
				}
				else
				{
					final int reward = (250 * fangs) + (fangs > 10 ? 5730 : 2000);
					htmltext = "30926-04.htm";
					takeItems(player, 5881, -1);
					giveAdena(player, reward, true);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
		if (st == null)
		{
			return;
		}
		
		if (getRandom(1000000) < CHANCES.get(npc.getId()))
		{
			giveItems(st.getPlayer(), FANG, 1);
			playSound(st.getPlayer(), QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}