ZURSULUS L2

The Hidden Veins

ID
293
Название
The Hidden Veins
start_npcs_json
[30535]
npc_ids_json
[20446,20447,20448,30535,30539]
constants_json
{"FILAUR":30535,"CHINCHIRIN":30539,"UTUKU_ORC":20446,"UTUKU_ARCHER":20447,"UTUKU_GRUNT":20448,"CHRYSOLITE_ORE":1488,"TORN_MAP_FRAGMENT":1489,"HIDDEN_VEIN_MAP":1490,"SOULSHOT_FOR_BEGINNERS":5789}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00293_TheHiddenVeins/Q00293_TheHiddenVeins.java

NPC квеста

IDНазваниеСтарт квестаУровень
20446Utuku OrcНет6
20447Utuku Orc ArcherНет8
20448Utuku Orc GruntНет7
30535FilaurДа70
30539ChichirinНет70

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

else if (player.getLevel() < 6)

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

giveItems(player, HIDDEN_VEIN_MAP, 1);
giveAdena(player, reward, true);
giveItems(player, SOULSHOT_FOR_BEGINNERS, 6000);
giveItems(player, CHRYSOLITE_ORE, 1);
giveItems(player, TORN_MAP_FRAGMENT, 1);

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

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

[30535-00.htm] Filaur of the Gray Pillar: You want work? Huh! If I gave you work, people will start saying that the Dwarves make their guests run errands! I don't want to be lax in my hospitality to guests. Don't overexert yourself, and since you have come all the way to the Dwarf country, sample our native products! (This quest may only be undertaken by a Dwarven character.) [30535-01.htm] Filaur of the Gray Pillar: Have you heard of a metal called chrysolite? This material is used by the maestros to craft high quality armor and weapons. Until now, the entire supply has been imported from Gracia, but we have just discovered that there are veins of this rare metal not very far from here. We're planning to work on developing these new veins soon, and need the help of energetic young Dwarves. I'll ask you for help soon, so be prepared. (This quest may only be undertaken by a character of level 6 and above.) [30535-02.htm] Filaur of the Gray Pillar: While I was making an inspection of the Mithril Mine, I was attacked by Utuku Orcs. Fortunately, my guards defeated the Orcs, but I found out something very interesting... Rough ore was found in the pockets of the defeated Orcs, and I assume it is used as currency between Orcs. The guards are all members of the Iron Gate and didn't recognize the ore, but I noticed at once that the ore is rough chrysolite. As you know, chrysolite is used by the maestros to make high quality armor and weapons. Until now, the entire supply has been imported from Gracia, but this incident has provided a new method of acquiring that rare metal. But to take advantage of this opportunity, I need the help of young, energetic Dwarves like you. Say you will help [30535-03.htm] Filaur of the Gray Pillar: If you leave the village and go to the minefield, you will see many Utuku Orcs. Bring me the Chrysolite Ore that you collect after defeating them. I will reward you based on the amount of the ore you bring back. But more importantly, you should find out where the ore comes from. I ordered some investigators of the guild to find out, but I haven't gotten any useful information from them. I only know that there are many hidden chrysolite veins somewhere in the Spine Mine Field, and only a few Utuku Orcs know the locations. Sending investigators was a mistake, because the Orcs now know that the veins are important. I hear they tore the Maps that indicate the location of the veins into many pieces and scattered them throughout the territory. If you find the pieces of the Maps, you must go to Priestess of the Earth Chichirin in the temple. She will help you to combine the Maps. I will give you a generous reward once you bring me the completed Maps. [30535-04.htm] Filaur of the Gray Pillar: I am sorry, but if you come back with empty hands I can't reward you, no matter how hard you tried. As I mentioned before, I will reward you based on the amount of Chrysolite Ore that you collect after defeating the Utuku Orcs. And don't forget ... If you collect four pieces of a torn Map, you should visit Chichirin in the Maphr Temple. If you ask her for help, she will combine those torn pieces and make a complete Map. I will give you a generous reward once you bring me the completed Maps. Say you will quit Say you will continue [30535-05.htm] Filaur of the Gray Pillar: You've done well, young Dwarf. This ore you have brought may look rough, but once it goes through the trained hands of craftsmen, it becomes a precious metal with a brilliant blue luster. True maestros should be able to find the beauty hidden in plain objects. As promised, I will reward you based on the amount of ore you have brought. And, don't forget ... If you collect four pieces of a torn map, you should visit Chichirin in the Maphr Temple. If you ask her for help, she will combine those torn pieces and make a complete map. I will give you a generous reward once you bring me the completed maps. Say you will quit Say you will continue [30535-06.htm] Filaur of the Gray Pillar: You want to quit already? I am very disappointed ... I thought you'd be more dedicated than that. Although you might not earn much profit now, you can receive a big reward once you put more time into it ... Young ones, they are too impatient these days ... Tsk tsk ... [30535-07.htm] Filaur of the Gray Pillar: Think about how much money we can save if we can actually mine chrysolite instead of importing it. This task is not only an achievement for our Gray Pillar Guild, it is an advancement for our entire Dwarven Kingdom. Don't forget this. Please carry on. [30535-08.htm] Filaur of the Gray Pillar: Ohh! You have obtained a complete map! Well done! We finally can find out the location of the hidden chrysolite vein! I will reward you as promised. This should be enough. Let me see ... Hmm ... Oh. Stupid Orcs, their map is too hard to read. But I can still roughly figure out the location. My investigators will have no problem locating the vein. As I said before, there are many hidden veins. Continue to find more maps! I will reward you whenever you bring new maps, so don't worry about that. Say you will quit Say you will continue [30535-09.htm] Filaur of the Gray Pillar: Ohh! You have obtained a complete map! Well done! We finally can find out the location of the hidden chrysolite vein! I will pay you as promised. I will also give you an additional reward for the amount of ore you have brought. Let me see ... Hmm ... Oh. Stupid Orcs, their map is too hard to read. But I can still roughly figure out the location. My investigators will have no problem locating the vein. As I said before, there are many hidden veins. Continue to find more maps! I will reward you whenever you bring new maps, so don't worry about that. Say you will quit Say you will continue [30539-01.htm] Maphr Priestess Chichirin: I heard from Elder Filaur. You are trying to recover some old maps, right? I used to be an apprentice for the cartography guild before becoming a seer. I helped Master Diana recover the map that shows the sites of the ancient giants. Ask her to recover the map [30539-02.htm] Maphr Priestess Chichirin: I'm sorry, but you don't have enough pieces of the torn map. Look here. You don't have this part. See, just there? I think I need four pieces of the torn map to make a complete map. [30539-03.htm] Maphr Priestess Chichirin: Let me see ... This part should be on the upper left-hand corner ... This should be under that piece ... If I put this here ... There! It is a little loose, but I have managed to create a rough map. I have never seen these characters before. These are neither the giants' nor the Elves' writing. Clumsy lines and bad handwriting ... it seems like a race with lousy craftsmanship made this map ... Perhaps the Humans?
Исходник условий и наград (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.Q00293_TheHiddenVeins;

import org.l2jmobius.gameserver.config.GeneralConfig;
import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.actor.enums.creature.Race;
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;
import org.l2jmobius.gameserver.mechanics.variables.PlayerVariables;

public class Q00293_TheHiddenVeins extends Quest
{
	// NPCs
	private static final int FILAUR = 30535;
	private static final int CHINCHIRIN = 30539;
	
	// Monsters
	private static final int UTUKU_ORC = 20446;
	private static final int UTUKU_ARCHER = 20447;
	private static final int UTUKU_GRUNT = 20448;
	
	// Items
	private static final int CHRYSOLITE_ORE = 1488;
	private static final int TORN_MAP_FRAGMENT = 1489;
	private static final int HIDDEN_VEIN_MAP = 1490;
	
	// Reward
	private static final int SOULSHOT_FOR_BEGINNERS = 5789;
	
	public Q00293_TheHiddenVeins()
	{
		super(293, "The Hidden Veins");
		registerQuestItems(CHRYSOLITE_ORE, TORN_MAP_FRAGMENT, HIDDEN_VEIN_MAP);
		addStartNpc(FILAUR);
		addTalkId(FILAUR, CHINCHIRIN);
		addKillId(UTUKU_ORC, UTUKU_ARCHER, UTUKU_GRUNT);
	}
	
	@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 "30535-03.htm":
			{
				st.startQuest();
				break;
			}
			case "30535-06.htm":
			{
				st.exitQuest(true, true);
				break;
			}
			case "30539-02.htm":
			{
				if (getQuestItemsCount(player, TORN_MAP_FRAGMENT) >= 4)
				{
					htmltext = "30539-03.htm";
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					takeItems(player, TORN_MAP_FRAGMENT, 4);
					giveItems(player, HIDDEN_VEIN_MAP, 1);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState st = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				if (player.getRace() != Race.DWARF)
				{
					htmltext = "30535-00.htm";
				}
				else if (player.getLevel() < 6)
				{
					htmltext = "30535-01.htm";
				}
				else
				{
					htmltext = "30535-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case FILAUR:
					{
						final int chrysoliteOres = getQuestItemsCount(player, CHRYSOLITE_ORE);
						final int hiddenVeinMaps = getQuestItemsCount(player, HIDDEN_VEIN_MAP);
						if ((chrysoliteOres + hiddenVeinMaps) == 0)
						{
							htmltext = "30535-04.htm";
						}
						else
						{
							if (hiddenVeinMaps > 0)
							{
								if (chrysoliteOres > 0)
								{
									htmltext = "30535-09.htm";
								}
								else
								{
									htmltext = "30535-08.htm";
								}
							}
							else
							{
								htmltext = "30535-05.htm";
							}
							
							int reward = (chrysoliteOres * 5) + (hiddenVeinMaps * 500);
							if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD)
							{
								if (chrysoliteOres >= 10)
								{
									reward += 2000;
								}
								
								if (hiddenVeinMaps >= 10)
								{
									reward += 2000;
								}
							}
							
							takeItems(player, CHRYSOLITE_ORE, -1);
							takeItems(player, HIDDEN_VEIN_MAP, -1);
							giveAdena(player, reward, true);
							
							// Give newbie reward if player is eligible.
							if (player.isNewbie() && (st.getInt("Reward") == 0))
							{
								int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEWBIE_SHOTS_RECEIVED, 0);
								if (newPlayerRewardsReceived < 1)
								{
									giveItems(player, SOULSHOT_FOR_BEGINNERS, 6000);
									st.playTutorialVoice("tutorial_voice_026");
									st.set("Reward", "1");
									player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
								}
							}
						}
						break;
					}
					case CHINCHIRIN:
					{
						htmltext = "30539-01.htm";
						break;
					}
				}
				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;
		}
		
		final int chance = getRandom(100);
		if (chance > 50)
		{
			giveItems(player, CHRYSOLITE_ORE, 1);
		}
		else if (chance < 5)
		{
			giveItems(player, TORN_MAP_FRAGMENT, 1);
		}
	}
}