ZURSULUS L2

Black Swan

ID
351
Название
Black Swan
start_npcs_json
[30916]
npc_ids_json
[30897,30916,30969]
constants_json
{"GOSTA":30916,"IASON_HEINE":30969,"ROMAN":30897,"ORDER_OF_GOSTA":4296,"LIZARD_FANG":4297,"BARREL_OF_LEAGUE":4298,"BILL_OF_IASON_HEINE":4407}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00351_BlackSwan/Q00351_BlackSwan.java

NPC квеста

IDНазваниеСтарт квестаУровень
30897RomanНет70
30916GostaДа80
30969Iason HeineНет70

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

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

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

giveItems(player, ORDER_OF_GOSTA, 1);
giveAdena(player, lizardFangs * 20, true);
rewardItems(player, BILL_OF_IASON_HEINE, barrels);
giveItems(player, LIZARD_FANG, random < 2 ? 1 : 2);
giveItems(player, BARREL_OF_LEAGUE, 1);
giveItems(player, BARREL_OF_LEAGUE, 1);

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

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

[30897-01.htm] Head Blacksmith Roman: Hmm... This is definitely the signature of Iason Heine. What would you like to trade for it? View the Bill Exchange List [30897-02.htm] Head Blacksmith Roman: Are you helping Iason Heine defeat the Tasaba lizardmen? Bring me the bills he gives you, I will exchange them for useful items. [30916-00.htm] Captain Gosta: Don't you realize that the Heine family is the most prominent family in all of Heine? For years they have dominated Innadril's commerce and it is rumored that their personal fortune has swelled to several billion adena. Now word comes that cargo belonging to Iason Heine, the patriarch of the Heine family has been stolen... Why am I telling you this. You can't do anything about it... (This quest may only be undertaken by a character of level 32 and above.) [30916-01.htm] Captain Gosta: Don't you realize that the Heine family is the most prominent family in all of Heine? For years they have dominated Innadril's commerce and it is rumored that their personal fortune has swelled to several billion adena. Now word comes that cargo belonging to Iason Heine, the patriarch of the Heine family has been stolen... When he heard about the robbery, the Lord decided to use this incident as an excuse to mobilize his army to drive away the Tasaba lizardmen. Those filthy reptiles have threatened the safety of travelers for too long... "Was he successful?" [30916-02.htm] Captain Gosta: Duke Iason Heine refused the Lord's offer, saying that it was a private matter and he would deal with it. This would be a good time to compliment the Duke on his concern for the public treasury, but, alas, I know him too well. Anyway, I'm recruiting volunteers to drive away the Tasaba lizardmen for the Duke. He will personally give out the rewards when we are successful. If you wish to volunteer, speak up now! "I will join your effort against the Tasaba lizardmen." [30916-03.htm] Captain Gosta: Regardless of his character, Duke Iason Heine has a point. The Tasaba lizardmen are definitely a menace to Innadril. It would be one thing if all they did was attack travelers, but now it is said they have something far more sinister planned... Take this order. I wish you luck. [30916-04.htm] Captain Gosta: How is your mission coming along? He may have many faults, but one thing you can say about Duke Iason Heine, he is not a miser. You will be well-compensated for your efforts. Still, you mustn't believe everything he says... [30969-01.htm] Iason Heine: Oh, my! I should have noticed the captain's seal earlier! So you are here to help me... What has become of those filthy Tasaba lizardmen? Have you recovered any of the stolen cargo ? "Here are the fangs of the lizardmen." "Here is the cargo we recovered." [30969-02.htm] Iason Heine: Let's see... We agreed upon 20 adena per fang, correct? Then total is... this. Correct? Return [30969-02a.htm] Iason Heine: Unless you present proof that you have killed the lizardmen I will be unable to compensate you. This has nothing to with trust. I believe what you say, I just must have the fangs. I have turned away others who lacked proof. If I were to give you special treatment there would be reprisals against me. Do you understand? Go and get the lizardmen fangs. Return [30969-03.htm] Iason Heine: Oh yes, that is definitely the cargo that was stolen from our trade guild. But this is not all of it. There is still much to be recovered. Please continue to look for it. Ah, the reward. I only have a small amount of cash on me. I'll tell you what, take this bill to Head Blacksmith Roman of the Blacksmith Guild. He will take care of you. Return [30969-03a.htm] Iason Heine: Ah, you have recovered our trade guild's wooden barrel? That is wonderful news! Where is it? Is it in a warehouse? Please bring it to me right away! ... I hope you didn't try to open it! Or send it somewhere else? Ha! Just kidding. Return [30969-04.htm] Iason Heine: Is there anything else I can do for you? The ranks of the Tasaba lizardmen are swelling as we speak. They must be dealt with. Please don't quit now. Show the Tasaba lizardmen fangs. Show the wooden barrels that belong to the trade guild. Quit the task. [30969-05.htm] Iason Heine: How can you leave us like this? Most of our stolen cargo has yet to be recovered... and, even more importantly, the Tasaba lizardmen are increasingly threatening our precious Innadril! ... Do you know something I don't? Please reconsider your decision! Return "I quit." [30969-06.htm] Iason Heine: OK, look, you can quit any time you want to, but you still need to be paid, right? Let's take care of that and then talk about whether or not you'll quit... Return [30969-07.htm] Iason Heine: You are very hard-headed! Well, as I said, you are free to go. Have a safe trip... and don't forget to come and visit me occasionally.
Исходник условий и наград (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.Q00351_BlackSwan;

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 Q00351_BlackSwan extends Quest
{
	// NPCs
	private static final int GOSTA = 30916;
	private static final int IASON_HEINE = 30969;
	private static final int ROMAN = 30897;
	
	// Items
	private static final int ORDER_OF_GOSTA = 4296;
	private static final int LIZARD_FANG = 4297;
	private static final int BARREL_OF_LEAGUE = 4298;
	private static final int BILL_OF_IASON_HEINE = 4407;
	
	public Q00351_BlackSwan()
	{
		super(351, "Black Swan");
		registerQuestItems(ORDER_OF_GOSTA, BARREL_OF_LEAGUE, LIZARD_FANG);
		addStartNpc(GOSTA);
		addTalkId(GOSTA, IASON_HEINE, ROMAN);
		addKillId(20784, 20785, 21639, 21640);
	}
	
	@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 "30916-03.htm":
			{
				st.startQuest();
				giveItems(player, ORDER_OF_GOSTA, 1);
				break;
			}
			case "30969-02a.htm":
			{
				final int lizardFangs = getQuestItemsCount(player, LIZARD_FANG);
				if (lizardFangs > 0)
				{
					htmltext = "30969-02.htm";
					
					takeItems(player, LIZARD_FANG, -1);
					giveAdena(player, lizardFangs * 20, true);
				}
				break;
			}
			case "30969-03a.htm":
			{
				final int barrels = getQuestItemsCount(player, BARREL_OF_LEAGUE);
				if (barrels > 0)
				{
					htmltext = "30969-03.htm";
					
					takeItems(player, BARREL_OF_LEAGUE, -1);
					rewardItems(player, BILL_OF_IASON_HEINE, barrels);
					
					// Heine explains than player can speak with Roman in order to exchange bills for rewards.
					if (st.isCond(1))
					{
						st.setCond(2, true);
					}
				}
				break;
			}
			case "30969-06.htm":
			{
				// If no more quest items finish the quest for real, else send a "Return" type HTM.
				if (!hasQuestItems(player, BARREL_OF_LEAGUE, LIZARD_FANG))
				{
					htmltext = "30969-07.htm";
					st.exitQuest(true, true);
				}
				break;
			}
		}
		
		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() < 32) ? "30916-00.htm" : "30916-01.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case GOSTA:
					{
						htmltext = "30916-04.htm";
						break;
					}
					case IASON_HEINE:
					{
						htmltext = "30969-01.htm";
						break;
					}
					case ROMAN:
					{
						htmltext = (hasQuestItems(player, BILL_OF_IASON_HEINE)) ? "30897-01.htm" : "30897-02.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 random = getRandom(4);
		if (random < 3)
		{
			giveItems(player, LIZARD_FANG, random < 2 ? 1 : 2);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			if (getRandomBoolean())
			{
				giveItems(player, BARREL_OF_LEAGUE, 1);
			}
		}
		else if (getRandom(10) < (npc.getId() > 20785 ? 3 : 4))
		{
			giveItems(player, BARREL_OF_LEAGUE, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}