ZURSULUS L2

Alligator Hunter

ID
338
Название
Alligator Hunter
start_npcs_json
[30892]
npc_ids_json
[]
constants_json
{"ALLIGATOR_PELT":4337}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00338_AlligatorHunter/Q00338_AlligatorHunter.java

NPC квеста

Записей нет.

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

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

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

giveAdena(player, reward, true);
giveItems(player, ALLIGATOR_PELT, 1);

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

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

[30892-00.htm] Trader Enverun: I'm sure you've heard the stories about Alligator Island?! Long ago, some alligators were brought over from Avella. They thrived and soon their numbers had multiplied to the point that the island they lived on became known as "Alligator Island." The residents of Heine are quite nervous having so many dangerous beasts nearby... But the alligators have resisted numerous attempts by forces of the castle to wipe them out... You shouldn't go there. You would most certainly perish... (This quest may only be undertaken by a character of level 40 and above.) [30892-01.htm] Trader Enverun: I'm sure you've heard the stories about Alligator Island?! Long ago, some alligators were brought over from Avella. They thrived and soon their numbers had multiplied to the point that the island they lived on became known as "Alligator Island". The residents of Heine are quite nervous having so many dangerous beasts nearby, but the alligators have resisted numerous attempts by forces of the castle to wipe them out. However, if one knows what one is doing, quite a handsome profit can be made from them! Would you care to join us on alligator hunt? "I will join the hunt for alligators." [30892-02.htm] Traider Enverun: Wonderful! You should be honored! I don't ask just anyone to be my partner, but I like the cut of your job! Now, let me explain how this one is done. You must go to Alligator Island and kill as many Alligators as you can. Bring their Pelts to me; I'll pay you 60 adena for each one. [30892-03.htm] Trader Enverun: Hey, partner! How is the alligator hunt coming along? Have you brought me any pelts? Sell pelts. Sell pelts later. [30892-04.htm] Trader Enverun: What, no pelts to give me? Are you slacking? We need to make some adena! Do you understand? Happy hunting! [30892-05.htm] Trader Enverun: Great, how many pelts have you brought me? Here is your adena. Would you like to keep hunting alligators? Continue hunting alligators. Quit hunting. [30892-06.htm] Trader Enverun: That's great! Chances like this come along once in a lifetime, am I right? Happy hunting! [30892-07.htm] Trader Enverun: Oh, that's not good! Just when the money started rolling in! Please, won't you reconsider? "I will continue the hunt." Quit [30892-08.htm] Trader Enverun: Well, I suppose you have a good reason for quitting. What a shame... Just as we were getting started. I thought our venture was about to take off... Anyway, I appreciate your hard work. Take care~ [30892-09.htm] Trader Enverun: Fine, we'll settle up later... Whatever is best for you. I suppose you are off again to kill alligators? Happy hunting!
Исходник условий и наград (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.Q00338_AlligatorHunter;

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 Q00338_AlligatorHunter extends Quest
{
	// Item
	private static final int ALLIGATOR_PELT = 4337;
	
	public Q00338_AlligatorHunter()
	{
		super(338, "Alligator Hunter");
		registerQuestItems(ALLIGATOR_PELT);
		addStartNpc(30892); // Enverun
		addTalkId(30892);
		addKillId(20135); // Alligator
	}
	
	@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 "30892-02.htm":
			{
				st.startQuest();
				break;
			}
			case "30892-05.htm":
			{
				final int pelts = getQuestItemsCount(player, ALLIGATOR_PELT);
				int reward = pelts * 40;
				if (pelts > 10)
				{
					reward += 3430;
				}
				
				takeItems(player, ALLIGATOR_PELT, -1);
				giveAdena(player, reward, true);
				break;
			}
			case "30892-08.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() < 40) ? "30892-00.htm" : "30892-01.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (hasQuestItems(player, ALLIGATOR_PELT)) ? "30892-03.htm" : "30892-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.isStarted())
		{
			return;
		}
		
		giveItems(player, ALLIGATOR_PELT, 1);
		playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
	}
}