ZURSULUS L2

O'Fulle's Special Bait

ID
51
Название
O'Fulle's Special Bait
start_npcs_json
[31572]
npc_ids_json
[]
constants_json
{"LOST_BAIT":7622,"ICY_AIR_LURE":7611}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00051_OFullesSpecialBait/Q00051_OFullesSpecialBait.java

NPC квеста

Записей нет.

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

htmltext = (player.getLevel() < 36) ? "31572-02.htm" : "31572-01.htm";

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

rewardItems(player, ICY_AIR_LURE, 4);
giveItems(partyMember, LOST_BAIT, 1);

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

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

[31572-01.htm] Fishermen's Guild Member O'Fulle: I may look chipper, but I feel terrible! Recently a delivery of ingredients for our bait of chill was hijacked by fettered souls at the Death Pass! It was several years worth of supplies! A devastating loss! Are you here for bait? Sorry, I couldn't make any if I wanted to. What can I do? "I'll help you." [31572-02.htm] Fishermen's Guild Member O'Fulle: A while back, I ordered some special seeds from Goddard that are designed for cold weather. The flowers of the plants are used to make a very special bait! They're called ice snow flowers because they bloom in the dead of winter. All of my order was stolen by bandits, and with the chaos left after the war, I haven't been able to order any more! But I'm just a poor fisherman, and no better equipped to deal with them than you are! (This quest may only be undertaken by a character of level 36 and above.) [31572-03.htm] Fishermen's Guild Member O'Fulle: A while back, I ordered some special seeds from Goddard that are designed for cold weather. The flowers of the plants are used to make bait of chill. My entire order was stolen by fettered souls! In the chaos left after the war, I haven't been able to order any more. I'm just a poor fisherman, and not equipped to deal with those ruffians! Would you help me? Bring me 100 of the lost bait materials from the fettered souls at the Death Pass. I'll make bait of chill for you. [31572-04.htm] Fishermen's Guild Member O'Fulle: Did you recover my stolen bait materials? Awesome! Please accept this bait of chill from my inventory as a token of my gratitude! Please give me the 100 lost bait materials that you found! "Here they are." [31572-05.htm] Fishermen's Guild Member O'Fulle: You haven't recovered the lost bait materials from the fettered souls at the Death Pass in northern Giran yet? Go on! They're no use to those beasts, anyway! [31572-06.htm] Fishermen's Guild Member O'Fulle: Well, you could've brought more... Oh well, take this bait of chill. It will increase your chance of finding lost items in the water. No good at all for catching fish, though! You won't always land your catch with this bait. It works best if your fishing skill is exactly level 12. If it's not, you should consider giving it to someone who can use it more effectively. Remember, bring anything you recover to me unopened! [31572-07.htm] Fishermen's Guild Member O'Fulle: You say that you brought 100 bait materials, but you don't seem to have brought enough for me to make bait! Honestly, I'm more interested in getting rid of the bandits than getting the bait materials back! Get busy, will you?
Исходник условий и наград (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.Q00051_OFullesSpecialBait;

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 Q00051_OFullesSpecialBait extends Quest
{
	// Item
	private static final int LOST_BAIT = 7622;
	
	// Reward
	private static final int ICY_AIR_LURE = 7611;
	
	public Q00051_OFullesSpecialBait()
	{
		super(51, "O'Fulle's Special Bait");
		registerQuestItems(LOST_BAIT);
		addStartNpc(31572); // O'Fulle
		addTalkId(31572);
		addKillId(20552); // Fettered Soul
	}
	
	@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("31572-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31572-07.htm"))
		{
			htmltext = "31572-06.htm";
			takeItems(player, LOST_BAIT, -1);
			rewardItems(player, ICY_AIR_LURE, 4);
			st.exitQuest(false, true);
		}
		
		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() < 36) ? "31572-02.htm" : "31572-01.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (getQuestItemsCount(player, LOST_BAIT) == 100) ? "31572-04.htm" : "31572-05.htm";
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isSummon)
	{
		final Player partyMember = getRandomPartyMember(player, 1);
		if (partyMember == null)
		{
			return;
		}
		
		final QuestState qs = getQuestState(partyMember, false);
		if (getQuestItemsCount(partyMember, LOST_BAIT) < 100)
		{
			if (getRandom(100) < 33)
			{
				giveItems(partyMember, LOST_BAIT, 1);
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
		
		if (getQuestItemsCount(partyMember, LOST_BAIT) >= 100)
		{
			qs.setCond(2, true);
		}
	}
}