ZURSULUS L2

Kail's Magic Coin

ID
382
Название
Kail's Magic Coin
start_npcs_json
[30687]
npc_ids_json
[21017,21019,21020,21022]
constants_json
{"FALLEN_ORC":21017,"FALLEN_ORC_ARCHER":21019,"FALLEN_ORC_SHAMAN":21020,"FALLEN_ORC_CAPTAIN":21022,"ROYAL_MEMBERSHIP":5898,"SILVER_BASILISK":5961,"GOLD_GOLEM":5962,"BLOOD_DRAGON":5963}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00382_KailsMagicCoin/Q00382_KailsMagicCoin.java

NPC квеста

IDНазваниеСтарт квестаУровень
21017Fallen OrcНет55
21019Fallen Orc ArcherНет57
21020Fallen Orc ShamanНет58
21022Fallen Orc CaptainНет60

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

htmltext = ((player.getLevel() < 55) || !hasQuestItems(player, ROYAL_MEMBERSHIP)) ? "30687-01.htm" : "30687-02.htm";

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

giveItems(player, SILVER_BASILISK, 1);
giveItems(player, GOLD_GOLEM, 1);
giveItems(player, BLOOD_DRAGON, 1);
giveItems(player, 5961 + getRandom(3), 1);

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

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

[30687-01.htm] Head Blacksmith Vergara: I can't remember the last time I saw royalty! Sigh... (This quest may only be undertaken by a royal character of level 55 or above.) [30687-02.htm] Head Blacksmith Vergara: I'm honored to finally meet royalty! The heavens at last have smiled upon me! As a royal, you must have many rare coins, am I right? You know, I have many rare items, too. Would you be interested in trading with me? All my products are guaranteed top-notch. "I will trade with you." [30687-03.htm] Head Blacksmith Vergara: Ah, yes! The forthrightness of a true royal! I'll get right to the point. Here is a list of the coins I want and what I have to offer in exchange. Being in the warehouse business, I've acquired many rare and precious items. I'm offering them to you at an exceptional price. Don't miss this great opportunity! View the list. [30687-04.htm] Head Blacksmith Vergara: I have many kinds of weapons. Take one or take them all! "I'm interested in recipe list." "Where can I obtain Kail's Coins?" "Tell me about the members of the coin collecting club." [30687-05.htm] Head Blacksmith Vergara: You'll find Sorcerer Kail on the Forsaken Plains, and there you'll find the coins as well, likely in the possession of the filthy orcs that infest that place. You could also probably win some by gambling with other players... Back [30687-06.htm] Head Blacksmith Vergara: Although I've only just joined, I already know all of our members by heart! Let's see, there's Magister Page of the Magic Guild in Hunters Village, Researcher Lorain, who can be found near the entrance of Cruma Tower, Warehouse Keeper Hagger and Guard Stan of Oren Castle Town, Blacksmith Duning of Hunters Village, Trader Ralford under the Ivory Tower in Oren Castle Town, Head Blacksmith Ferris in Aden Castle Town, Warehouse Keeper Collob in Giran Castle Town, and... hmm, oh yes! Grocer Pano in the plaza of Floran Village! Impressive, eh? But oh so much more impressive now that we have a royal member such as you, my lord! Back
Исходник условий и наград (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.Q00382_KailsMagicCoin;

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 Q00382_KailsMagicCoin extends Quest
{
	// Monsters
	private static final int FALLEN_ORC = 21017;
	private static final int FALLEN_ORC_ARCHER = 21019;
	private static final int FALLEN_ORC_SHAMAN = 21020;
	private static final int FALLEN_ORC_CAPTAIN = 21022;
	
	// Items
	private static final int ROYAL_MEMBERSHIP = 5898;
	private static final int SILVER_BASILISK = 5961;
	private static final int GOLD_GOLEM = 5962;
	private static final int BLOOD_DRAGON = 5963;
	
	public Q00382_KailsMagicCoin()
	{
		super(382, "Kail's Magic Coin");
		registerQuestItems(SILVER_BASILISK, GOLD_GOLEM, BLOOD_DRAGON);
		addStartNpc(30687); // Vergara
		addTalkId(30687);
		addKillId(FALLEN_ORC, FALLEN_ORC_ARCHER, FALLEN_ORC_SHAMAN, FALLEN_ORC_CAPTAIN);
	}
	
	@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("30687-03.htm"))
		{
			st.startQuest();
		}
		
		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() < 55) || !hasQuestItems(player, ROYAL_MEMBERSHIP)) ? "30687-01.htm" : "30687-02.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = "30687-04.htm";
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isCond(1))
		{
			return;
		}
		
		switch (npc.getId())
		{
			case FALLEN_ORC:
			{
				if (getRandom(10) < 1)
				{
					giveItems(player, SILVER_BASILISK, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case FALLEN_ORC_ARCHER:
			{
				if (getRandom(10) < 1)
				{
					giveItems(player, GOLD_GOLEM, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case FALLEN_ORC_SHAMAN:
			{
				if (getRandom(10) < 1)
				{
					giveItems(player, BLOOD_DRAGON, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case FALLEN_ORC_CAPTAIN:
			{
				if (getRandom(10) < 1)
				{
					giveItems(player, 5961 + getRandom(3), 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
		}
	}
}