ZURSULUS L2

Help Rood Raise A New Pet!

ID
352
Название
Help Rood Raise A New Pet!
start_npcs_json
[31067]
npc_ids_json
[]
constants_json
{"LIENRIK_EGG_1":5860,"LIENRIK_EGG_2":5861}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00352_HelpRoodRaiseANewPet/Q00352_HelpRoodRaiseANewPet.java

NPC квеста

Записей нет.

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

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

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

giveAdena(player, reward, true);
giveAdena(player, reward, true);
giveAdena(player, reward, true);
giveItems(player, LIENRIK_EGG_1, 1);
giveItems(player, LIENRIK_EGG_2, 1);

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

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

[31067-00.htm] Pet Manager Rood: Have you ever seen a lienrik? It inhabits the Field of Silence. It's so cute... you wouldn't have forgotten it! Do you want to catch one and take it home? You might not yet realize how much fun it can be. You should come back later. (This quest may only be undertaken by a character of level 39 and above.) [31067-01.htm] Pet Manager Rood: Have you ever seen a lienrik? It inhabits the Field of Silence. It's so cute... you wouldn't have forgotten it! Don't you want to catch one and take it home? Since it flies in the air, it never gets dirty. And its coloring is spectacular! When you stroke it, it feels cool and moist... A most incredibly pleasant sensation, if you know what I mean... Those fools who like warm and fuzzy animals don't know what they're missing. The lienrik possesses true beauty and dignity... "Very interesting." [31067-02.htm] Pet Manager Rood: Its beauty is only the beginning! It's so light you can wrap it around your arm or let it sit on your shoulder! Its combat capability is quite extraordinary! It can fly high in the sky and launch a remote attack! This makes it the best possible pet for the upper class! Alas, there is one flaw. "What flaw?" [31067-03.htm] Pet Manager Rood: Lienriks are quite headstrong and hard to tame. The training must begin while it's still a baby. However, stealing one of its eggs is almost impossible. The mother of the species puts up a desperate fight, and even if you succeed in catching one, there's no guarantee that you can train it. It's not profitable at all for now. Not at all! If I could get one of its eggs, at least I could try my best to train it. Wouldn't the ladies in town be impressed if I showed up with a tamed lienrik? "I will get a Lienrik Egg for you." [31067-04.htm] Pet Manager Rood: Oh, are you serious? I had a feeling that today was going to be my lucky day! Let me tell you more about lienriks. They are mainly found in the Field of Silence. They are of two kinds of lienriks: the lienrik and the lienrik lad. One launches a remote attack while the other spits poison. Be careful of the ones that spit. They will get you if you get too close. They both produce eggs. Their gender is obvious even while in egg form. Females are quite rare and hard to find. I am but a humble pet manager, but if you bring one to me, I'll give you a reward. One egg doesn't guarantee success, so the more you can bring me, the better. If everything works out, I might have a grown lienrik for you when we are done. [31067-05.htm] Pet Manager Rood: Why are you still here? Lienriks can be found in the Field of Silence. You can also find lienrik lads there. Bring me Lienrik Eggs and I'll give you a reward. Or, would you just rather quit? "I will bring you more eggs." "I quit." [31067-06.htm] Pet Manager Rood: Oh my! These are Lienrik Eggs! I tried so hard to get one, and now you've done it so easily! It's wonderful to finally have them! Here is the reward I promised! "I'll bring you some more eggs." "I quit." "When do I get my lienrik?" [31067-07.htm] Pet Manager Rood: Hmm, certainly not until I successfully raise it! This is no docile duck we're talking about here... Let me work on it. Just keep bringing me more eggs. I suspect it will take many tries to get it right. "I will bring more eggs." "I quit." [31067-08.htm] Pet Manager Rood: Oh my! These are Lienrik Eggs! And what's this? Is this a female Lienrik Egg? Such a rarity... You are incredible! I will hatch this and mate her with a male. What a great job! Thank you so very much! Now I must concentrate on raising a lienrik. Here is your reward! "I will bring you more eggs." "I quit." "When do I get my lienrik?" [31067-09.htm] Pet Manager Rood: Hmm... a quitter, eh? Go ahead... I can't stop you. I'll do my best with what I have now... But if you change your mind, please stop by. I can always use more eggs. [31067-10.htm] Pet Manager Rood: Oh, wonderful! Do you remember what I said earlier? Let me explain it again. Lienriks are mainly found in the Field of Silence. You will see lienriks and lienrik lads. One attacks from a distance and the other attacks by spitting poison. Especially beware of this one. Anyway, both types lay eggs. The gender of the lienrik is obvious, even when it is in egg form. I am but a poor pet manager, but I will reward you for any eggs you bring me, the more the better.
Исходник условий и наград (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.Q00352_HelpRoodRaiseANewPet;

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 Q00352_HelpRoodRaiseANewPet extends Quest
{
	// Items
	private static final int LIENRIK_EGG_1 = 5860;
	private static final int LIENRIK_EGG_2 = 5861;
	
	public Q00352_HelpRoodRaiseANewPet()
	{
		super(352, "Help Rood Raise A New Pet!");
		registerQuestItems(LIENRIK_EGG_1, LIENRIK_EGG_2);
		addStartNpc(31067); // Rood
		addTalkId(31067);
		addKillId(20786, 20787, 21644, 21645);
	}
	
	@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("31067-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31067-09.htm"))
		{
			st.exitQuest(true, 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() < 39) ? "31067-00.htm" : "31067-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int eggs1 = getQuestItemsCount(player, LIENRIK_EGG_1);
				final int eggs2 = getQuestItemsCount(player, LIENRIK_EGG_2);
				if ((eggs1 + eggs2) == 0)
				{
					htmltext = "31067-05.htm";
				}
				else
				{
					int reward = 2000;
					if ((eggs1 > 0) && (eggs2 == 0))
					{
						htmltext = "31067-06.htm";
						reward += eggs1 * 34;
						takeItems(player, LIENRIK_EGG_1, -1);
						giveAdena(player, reward, true);
					}
					else if ((eggs1 == 0) && (eggs2 > 0))
					{
						htmltext = "31067-08.htm";
						reward += eggs2 * 1025;
						takeItems(player, LIENRIK_EGG_2, -1);
						giveAdena(player, reward, true);
					}
					else if ((eggs1 > 0) && (eggs2 > 0))
					{
						htmltext = "31067-08.htm";
						reward += (eggs1 * 34) + (eggs2 * 1025) + 2000;
						takeItems(player, LIENRIK_EGG_1, -1);
						takeItems(player, LIENRIK_EGG_2, -1);
						giveAdena(player, reward, true);
					}
				}
				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 npcId = npc.getId();
		final int random = getRandom(100);
		final int chance = ((npcId == 20786) || (npcId == 21644)) ? 44 : 58;
		if (random < chance)
		{
			giveItems(player, LIENRIK_EGG_1, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
		else if (random < (chance + 4))
		{
			giveItems(player, LIENRIK_EGG_2, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}