ZURSULUS L2

A Powerful Primeval Creature

ID
642
Название
A Powerful Primeval Creature
start_npcs_json
[32105]
npc_ids_json
[18344]
constants_json
{"ANCIENT_EGG":18344,"DINOSAUR_TISSUE":8774,"DINOSAUR_EGG":8775}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00642_APowerfulPrimevalCreature/Q00642_APowerfulPrimevalCreature.java

NPC квеста

IDНазваниеСтарт квестаУровень
18344Ancient EggНет80

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

htmltext = (player.getLevel() < 75) ? "32105-00.htm" : "32105-01.htm";

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

giveAdena(player, tissues * 5000, true);
giveAdena(player, 44000, true);
giveItems(player, REWARDS[Integer.parseInt(event.split("_")[1])], 1);
giveItems(player, DINOSAUR_EGG, 1);
rewardItems(player, DINOSAUR_TISSUE, 1);

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

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

[32105-00.htm] Dinn: You're not someone who is skilled enough and brave enough to handle my tasks. (This quest may only be undertaken by a character of level 75 and above.) [32105-01.htm] Dinn: Oh, I haven't seen an outsider on this dangerous and remote island in ages. You've come to find the truth behind all the rumors, haven't you? "What rumors are you talking about?" [32105-02.htm] Dinn: This island was discovered only recently, and it soon became clear that it was an island unlike any other. Huge, powerful creatures can be found here -- and nowhere else in the world. I've heard that many people are taking an interest in these new creatures. "Ask who is interested in what." [32105-03.htm] Dinn: Some wise wizards call those creatures "dinosaurs." They were not created by the gods of Aden that we now know. Even as we speak, wizards are bent over their tomes studying the origin and the purpose of these mysterious dinosaurs. And need I even mention the blacksmiths who are keenly interested in using these creatures to make powerful new weapons or durable new materials? This is an exciting time, indeed! "I'd like to help them." "The gods help those who help themselves. I'm not interested." [32105-04.htm] Dinn: Wonderful! This island is filled with perils, so the wizards and Dwarven artisans studying these dinosaurs need the help of brave adventurers to collect the materials necessary to complete their work. They asked me to recommend someone skilled enough and brave enough to handle the task. You seem a likely candidate! Go and defeat the Velociraptor, Pterosaur, Ornithomimus and Deinonychus and bring back samples of their biological tissue. For your information, one Ancient Egg and 150 dinosaur biological tissues can be processed as one set of samples. You will be able to find the egg while exploring the dinosaurs' habitat. But be very careful! When the egg is disturbed, the nearby dinosaurs will come running to protect it. We do not require as many eggs as biological tissue, so assess the situation carefully and do what you think is best. Good luck, my friend! [32105-05.htm] Dinn: Excellent! You have brought back the samples! Seeing this warms my very heart. Give him the dinosaur biological tissues. Process 1 Ancient Egg and 150 dinosaur biological tissues for experimentation. [32105-06.htm] Dinn: By processing 1 Ancient Egg and 150 dinosaur biological tissues, it's possible to create some truly special materials. These materials will be of great help to the scholars studying these creatures. If you give me the ingredients that you've collected in order to make the processed material, I'll trade you the following items: Trade for Recipe - Sirra's Blade (60%) Trade for Recipe - Sword of Ipos (60%) Trade for Recipe - Barakiel's Axe (60%) Trade for Recipe - Behemoth's Tuning Fork (60%) Trade for Recipe - Naga Storm (60%) Trade for Recipe - Tiphon's Spear (60%) Trade for Recipe - Shyeed's Bow (60%) Trade for Recipe - Sobekk's Hurricane (60%) Trade for Recipe - Themis' Tongue (60%) Trade for Recipe - Hand of Cabrio (60%) Trade for Recipe - Daimon Crystal (60%) Quit [32105-07.htm] Dinn: Thank you! These hard-won materials will prove very useful to many who are studying these strange creatures. We are in your debt. [32105-08.htm] Dinn: You don't have enough items yet. Go and defeat the Velociraptor, Pterosaur, Ornithomimus and Deinonychus and bring back samples of their biological tissue. You will be able to find the egg while exploring the dinosaurs' habitat. But be very careful! When the egg is disturbed, the nearby dinosaurs will come running to protect it. We do not require as many eggs as biological tissue, so assess the situation carefully and do what you think is best.
Исходник условий и наград (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.Q00642_APowerfulPrimevalCreature;

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 Q00642_APowerfulPrimevalCreature extends Quest
{
	// NPC
	private static final int ANCIENT_EGG = 18344;
	
	// Items
	private static final int DINOSAUR_TISSUE = 8774;
	private static final int DINOSAUR_EGG = 8775;
	
	// Rewards
	private static final int[] REWARDS =
	{
		8690,
		8692,
		8694,
		8696,
		8698,
		8700,
		8702,
		8704,
		8706,
		8708,
		8710
	};
	
	public Q00642_APowerfulPrimevalCreature()
	{
		super(642, "A Powerful Primeval Creature");
		registerQuestItems(DINOSAUR_TISSUE, DINOSAUR_EGG);
		addStartNpc(32105); // Dinn
		addTalkId(32105);
		
		// Dinosaurs + egg
		addKillId(22196, 22197, 22198, 22199, 22200, 22201, 22202, 22203, 22204, 22205, 22218, 22219, 22220, 22223, 22224, 22225, ANCIENT_EGG);
	}
	
	@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("32105-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("32105-08.htm"))
		{
			if ((getQuestItemsCount(player, DINOSAUR_TISSUE) >= 150) && hasQuestItems(player, DINOSAUR_EGG))
			{
				htmltext = "32105-06.htm";
			}
		}
		else if (event.equals("32105-07.htm"))
		{
			final int tissues = getQuestItemsCount(player, DINOSAUR_TISSUE);
			if (tissues > 0)
			{
				takeItems(player, DINOSAUR_TISSUE, -1);
				giveAdena(player, tissues * 5000, true);
			}
			else
			{
				htmltext = "32105-08.htm";
			}
		}
		else if (event.contains("event_"))
		{
			if ((getQuestItemsCount(player, DINOSAUR_TISSUE) >= 150) && hasQuestItems(player, DINOSAUR_EGG))
			{
				htmltext = "32105-07.htm";
				takeItems(player, DINOSAUR_TISSUE, 150);
				takeItems(player, DINOSAUR_EGG, 1);
				giveAdena(player, 44000, true);
				giveItems(player, REWARDS[Integer.parseInt(event.split("_")[1])], 1);
			}
			else
			{
				htmltext = "32105-08.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() < 75) ? "32105-00.htm" : "32105-01.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (!hasQuestItems(player, DINOSAUR_TISSUE)) ? "32105-08.htm" : "32105-05.htm";
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		if (npc.getId() == ANCIENT_EGG)
		{
			if (getRandom(100) < 1)
			{
				giveItems(player, DINOSAUR_EGG, 1);
				if (getQuestItemsCount(player, DINOSAUR_TISSUE) >= 150)
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
				}
				else
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
			}
		}
		else if (getRandom(100) < 33)
		{
			rewardItems(player, DINOSAUR_TISSUE, 1);
			if ((getQuestItemsCount(player, DINOSAUR_TISSUE) >= 150) && hasQuestItems(player, DINOSAUR_EGG))
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
			}
			else
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
	}
}