ZURSULUS L2

To Lead and Be Led

ID
118
Название
To Lead and Be Led
start_npcs_json
[30298]
npc_ids_json
[20919,20920,20921,20927,30298]
constants_json
{"BLACKSMITH_PINTER":30298,"CRYSTAL_D":1458,"BLOOD_OF_MAILLE_LIZARDMAN":8062,"LEG_OF_KING_ARANEID":8063,"CLAN_OATH_HELM":7850,"CLAN_OATH_ARMOR":7851,"CLAN_OATH_GAUNTLETS_HEAVY_ARMOR":7852,"CLAN_OATH_SABATON_HEAVY_ARMOR":7853,"CLAN_OATH_BRIGANDINE":7854,"CLAN_OATH_LEATHER_GLOVES_LIGHT_ARMOR":7855,"CLAN_OATH_BOOTS_LIGHT_ARMOR":7856,"CLAN_OATH_AKETON":7857,"CLAN_OATH_PADDED_GLOVES_ROBE":7858,"CLAN_OATH_SANDALS_ROBE":7859,"MAILLE_LIZARDMAN":20919,"MAILLE_LIZARDMAN_SCOUT":20920,"MAILLE_LIZARDMAN_GUARD":20921,"KING_OF_THE_ARANEID":20927,"MIN_LEVEL":19,"CRYSTAL_COUNT_1":922,"CRYSTAL_COUNT_2":771}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00118_ToLeadAndBeLed/Q00118_ToLeadAndBeLed.java

NPC квеста

IDНазваниеСтарт квестаУровень
20919Maille LizardmanНет20
20920Maille Lizardman ScoutНет22
20921Maille Lizardman GuardНет24
20927King of the AraneidНет27
30298PinterДа70

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

private static final int MIN_LEVEL = 19;
else if ((player.getLevel() >= MIN_LEVEL) && (player.getPledgeType() == -1) && (player.getSponsor() > 0))

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

giveItems(player, CLAN_OATH_HELM, 1);
giveItems(player, CLAN_OATH_ARMOR, 1);
giveItems(player, CLAN_OATH_GAUNTLETS_HEAVY_ARMOR, 1);
giveItems(player, CLAN_OATH_SABATON_HEAVY_ARMOR, 1);
giveItems(player, CLAN_OATH_HELM, 1);
giveItems(player, CLAN_OATH_BRIGANDINE, 1);
giveItems(player, CLAN_OATH_LEATHER_GLOVES_LIGHT_ARMOR, 1);
giveItems(player, CLAN_OATH_BOOTS_LIGHT_ARMOR, 1);
giveItems(player, CLAN_OATH_HELM, 1);
giveItems(player, CLAN_OATH_AKETON, 1);
giveItems(player, CLAN_OATH_PADDED_GLOVES_ROBE, 1);
giveItems(player, CLAN_OATH_SANDALS_ROBE, 1);

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

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

[30298-01.htm] Blacksmith Pinter: Have you heard? A new type of Armor has been designed exclusively for members of the Clan Academy! Do you want some? I'd be happy to make it for you, just say the word! "Please make some new Armor for me." [30298-02.htm] Blacksmith Pinter: Have you heard? A new type of Armor has been designed exclusively for members of the Clan Academy! Do you want some? Uh oh, it seems you're not ready for it yet... (This quest is limited to sponsored Clan Academy members of level 19 and above.) [30298-02a.htm] Blacksmith Pinter: It seems you've already gotten some of the special Armor for Academy members from Blacksmith Newyear in Schuttgart! (Characters who have undertaken 'To Lead and Be Led' are not permitted to take on this quest.) [30298-02b.html] Blacksmith Pinter: Hmm, how strange...!? You should've already gotten the special Armor for Academy members from Blacksmith Newyear in Schuttgart! (Characters who have undertaken 'To Lead and Be Led' are not permitted to take on this quest.) [30298-03.htm] Blacksmith Pinter: Oh really? Nothing in life is free, my friend! This will be no exception! You may as well get ready to pay through the nose for every little piece of material I need! Ha! That look on your face is priceless! You won't find this stuff easily, I can promise you that! Nothing I need can be found in a store... I'm afraid you'll have to slaughter the Maille Lizardmen and their Scouts and Guards in the Maille Lizardman Barracks and bring me 10 bottles of their blood. I can't make the special Armor without it... Now get going! I don't have all day! [30298-04.html] Blacksmith Pinter: You must slaughter the Maille Lizardmen and their Scouts and Guards in the Maille Lizardman Barracks and bring me 10 bottles of their blood. I can't make the special Armor without it! Get going! [30298-05.html] Blacksmith Pinter: Good job! Now I'll need some Crystals: D-Gra... Oh, I'm getting ahead of myself! What kind of Armor is it that you want? Heavy Armor Light Armor Robe [30298-05a.html] Blacksmith Pinter: Heavy Armor, eh? Make sure that's what you want, because once I get started, there's no turning back! "I want Heavy Armor." "I need to think about it some more." [30298-05b.html] Blacksmith Pinter: Light Armor, eh? Make sure that's what you want, because once I start making it, there's no going back! "I want Light Armor." "I need to think about it some more." [30298-05c.html] Blacksmith Pinter: Robe Armor, eh? Make sure that's what you want, because once I start making it, there's no going back! "I want Robe Armor." "I need to think about it some more." [30298-05d.html] Blacksmith Pinter: Heavy Armor it is, then! I'll need some D-Grade Crystals, but I know better than to ask a lightweight like you to bring them to me! Tell your Sponsor to bring me 922 D-Grade Crystals. Stop whining! I'm not running a charity here! Oh, by the way... You've got to come back with your Sponsor! How else will I know who to make the Armor for? [30298-05e.html] Blacksmith Pinter: Now I can get started making the Light Armor! I'll need some D-Grade Crystals, but I know better than to ask a lightweight like you to bring them to me! Go and ask your Sponsor to bring me 771 D-Grade Crystals. Stop whining! I'm not running a charity here! Oh, by the way... You've got to come back with your Sponsor! How else will I know who to make the Armor for? [30298-05f.html] Blacksmith Pinter: Now I can get started making Robe Armor. I'll need some D-Grade Crystals, but I know better than to ask a lightweight like you to bring them to me! Have your Sponsor bring me 771 D-Grade Crystals. Stop whining! I'm not running a charity here! Oh, by the way... You've got to come back with your Sponsor! How else would I know who your sponsor was? [30298-05g.html] Blacksmith Pinter: You need to think about it? Fine! Let me know what you decide! [30298-06.html] Blacksmith Pinter: Go and ask your Sponsor to bring me 922 D-Grade Crystals. Stop whining! I'm not running a charity here! By the way... You must return with your Sponsor. How else will I know who to make the Armor for? [30298-06a.html] Blacksmith Pinter: Go and ask your Sponsor to bring me 922 D-Grade Crystals! Stop whining! I'm not running a charity here! What? You don't have a Sponsor? Why the hell didn't you say something earlier? Come back when you're sponsored! [30298-06b.html] Blacksmith Pinter: Go and ask your Sponsor to bring me 771 D-Grade Crystals. Stop whining! I'm not running a charity here! What? You don't have a Sponsor? Why the hell didn't you say something earlier? Come back when you're sponsored! [30298-06c.html] Blacksmith Pinter: Go and ask your Sponsor to bring me 771 D-Grade Crystals. Stop whining! I'm not running a charity here! What? You don't have a Sponsor? Why the hell didn't you say something earlier? Come back when you're sponsored! [30298-06d.html] Go and ask your Sponsor to bring 771 D-Grade Crystals. Stop whining! I'm not running a charity here! Oh, by the way... You've got to come back with your Sponsor! How else will I know who to make the Armor for? [30298-06e.html] Go and ask your Sponsor to bring 771 D-Grade Crystals. Stop whining! I'm not running a charity here! Oh, by the way... You've got to come back with your Sponsor! How else will I know who he's sponsoring? [30298-07.html] Blacksmith Pinter: Hmmm, did you bring your Sponsor? Well, who is it? Tell him to come and see me! [30298-08.html] Blacksmith Pinter: Oh, you're back! Did you bring what I asked for? "Here are the D-Grade Crystals." [30298-09.html] Blacksmith Pinter: You claim to be a Sponsor, but you stand here alone! How am I to know who you've sponsored? Bring your apprentice with you next time! [30298-10.html] Blacksmith Pinter: Ah yes, thank you! Now, I'd like to speak with your apprentice. [30298-11.html] Blacksmith Pinter: This isn't enough! Bring me 922 D-Grade Crystals. [30298-11a.html] Blacksmith Pinter: This isn't enough! Bring me 771 D-Grade Crystals. [30298-12.html] Blacksmith Pinter: Now I'd like to speak with your apprentice. [30298-14.html] Blacksmith Pinter: Stop wasting my time! I have nothing to say to you! [30298-15.html] Blacksmith Pinter: Well, I have all the ingredients I need, but I have one more favor to ask of you... I want to test the bond between you and your Sponsor. Go to the Maille Lizardmen Barracks and defeat the King of the Araneid and bring me all 8 of his legs! Also, you must defeat the King of the Araneid while your Sponsor looks on! Think of it as a way to prove yourself to him! Naturally, if you get in trouble, he'll be there to help you. This experience should be good for the both of you! I'll have your Armor ready when you return with the 8 Legs of the King of the Araneid. [30298-16.html] Blacksmith Pinter: Go to the Maille Lizardmen Barracks and defeat the King of the Araneid and bring me his 8 legs. You must defeat him while your Sponsor looks on! This of this as an opportunity to prove yourself to him! Naturally, if you get in trouble, he'll be there to help you! This experience should be good for the both of you! I'll have your Armor ready when you return with the 8 Legs of the King of the Araneid. [30298-17.html] Blacksmith Pinter: Hmmm? What do you think? Was your Sponsor impressed? Good! Here's your Armor, as promised! Wear it in good health, my friend!
Исходник условий и наград (Java)
/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package quests.Q00118_ToLeadAndBeLed;

import org.l2jmobius.gameserver.config.PlayerConfig;
import org.l2jmobius.gameserver.entity.World;
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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
import org.l2jmobius.gameserver.util.LocationUtil;

import quests.Q00123_TheLeaderAndTheFollower.Q00123_TheLeaderAndTheFollower;

/**
 * To Lead And Be Led (118)
 * @author ivantotov
 */
public class Q00118_ToLeadAndBeLed extends Quest
{
	// NPC
	private static final int BLACKSMITH_PINTER = 30298;
	
	// Items
	private static final int CRYSTAL_D = 1458;
	private static final int BLOOD_OF_MAILLE_LIZARDMAN = 8062;
	private static final int LEG_OF_KING_ARANEID = 8063;
	
	// Reward
	private static final int CLAN_OATH_HELM = 7850;
	private static final int CLAN_OATH_ARMOR = 7851;
	private static final int CLAN_OATH_GAUNTLETS_HEAVY_ARMOR = 7852;
	private static final int CLAN_OATH_SABATON_HEAVY_ARMOR = 7853;
	private static final int CLAN_OATH_BRIGANDINE = 7854;
	private static final int CLAN_OATH_LEATHER_GLOVES_LIGHT_ARMOR = 7855;
	private static final int CLAN_OATH_BOOTS_LIGHT_ARMOR = 7856;
	private static final int CLAN_OATH_AKETON = 7857;
	private static final int CLAN_OATH_PADDED_GLOVES_ROBE = 7858;
	private static final int CLAN_OATH_SANDALS_ROBE = 7859;
	
	// Monster
	private static final int MAILLE_LIZARDMAN = 20919;
	private static final int MAILLE_LIZARDMAN_SCOUT = 20920;
	private static final int MAILLE_LIZARDMAN_GUARD = 20921;
	private static final int KING_OF_THE_ARANEID = 20927;
	
	// Misc
	private static final int MIN_LEVEL = 19;
	private static final int CRYSTAL_COUNT_1 = 922;
	private static final int CRYSTAL_COUNT_2 = 771;
	
	public Q00118_ToLeadAndBeLed()
	{
		super(118, "To Lead and Be Led");
		addStartNpc(BLACKSMITH_PINTER);
		addTalkId(BLACKSMITH_PINTER);
		addKillId(MAILLE_LIZARDMAN, MAILLE_LIZARDMAN_SCOUT, MAILLE_LIZARDMAN_GUARD, KING_OF_THE_ARANEID);
		registerQuestItems(LEG_OF_KING_ARANEID, BLOOD_OF_MAILLE_LIZARDMAN);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = null;
		
		// Manage Sponsor's quest events.
		if (player.getApprentice() > 0)
		{
			final Player apprentice = World.getPlayer(player.getApprentice());
			if (apprentice == null)
			{
				return htmltext;
			}
			
			final QuestState q118 = apprentice.getQuestState(Q00118_ToLeadAndBeLed.class.getSimpleName());
			switch (event)
			{
				case "sponsor":
				{
					if (!LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, apprentice, true))
					{
						htmltext = "30298-09.html";
					}
					else
					{
						if ((q118 == null) || (!q118.isMemoState(2) && !q118.isMemoState(3)))
						{
							htmltext = "30298-14.html";
						}
						else if (q118.isMemoState(2))
						{
							htmltext = "30298-08.html";
						}
						else if (q118.isMemoState(3))
						{
							htmltext = "30298-12.html";
						}
					}
					break;
				}
				case "30298-10.html":
				{
					if (LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, apprentice, true) && (q118 != null) && q118.isMemoState(2))
					{
						switch (q118.getMemoStateEx(1))
						{
							case 1:
							{
								if (getQuestItemsCount(player, CRYSTAL_D) >= CRYSTAL_COUNT_1)
								{
									takeItems(player, CRYSTAL_D, CRYSTAL_COUNT_1);
									q118.setMemoState(3);
									q118.setCond(6, true);
									htmltext = event;
								}
								else
								{
									htmltext = "30298-11.html";
								}
								break;
							}
							case 2:
							case 3:
							{
								if (getQuestItemsCount(player, CRYSTAL_D) >= CRYSTAL_COUNT_2)
								{
									takeItems(player, CRYSTAL_D, CRYSTAL_COUNT_2);
									q118.setMemoState(3);
									q118.setCond(6, true);
									htmltext = event;
								}
								else
								{
									htmltext = "30298-11a.html";
								}
								break;
							}
						}
					}
					break;
				}
			}
			
			return htmltext;
		}
		
		final QuestState qs = getQuestState(player, false);
		if (qs == null)
		{
			return null;
		}
		
		switch (event)
		{
			case "30298-03.htm":
			{
				if (qs.isCreated())
				{
					qs.startQuest();
					qs.setMemoState(1);
					htmltext = event;
				}
				break;
			}
			case "30298-05a.html":
			case "30298-05b.html":
			case "30298-05c.html":
			case "30298-05g.html":
			{
				htmltext = event;
				break;
			}
			case "30298-05d.html":
			{
				if (qs.isMemoState(1) && (getQuestItemsCount(player, BLOOD_OF_MAILLE_LIZARDMAN) >= 10))
				{
					takeItems(player, BLOOD_OF_MAILLE_LIZARDMAN, -1);
					qs.setMemoState(2);
					qs.setMemoStateEx(1, 1);
					qs.setCond(3, true);
					htmltext = event;
				}
				break;
			}
			case "30298-05e.html":
			{
				if (qs.isMemoState(1) && (getQuestItemsCount(player, BLOOD_OF_MAILLE_LIZARDMAN) >= 10))
				{
					takeItems(player, BLOOD_OF_MAILLE_LIZARDMAN, -1);
					qs.setMemoState(2);
					qs.setMemoStateEx(1, 2);
					qs.setCond(4, true);
					htmltext = event;
				}
				break;
			}
			case "30298-05f.html":
			{
				if (qs.isMemoState(1) && (getQuestItemsCount(player, BLOOD_OF_MAILLE_LIZARDMAN) >= 10))
				{
					takeItems(player, BLOOD_OF_MAILLE_LIZARDMAN, -1);
					qs.setMemoState(2);
					qs.setMemoStateEx(1, 3);
					qs.setCond(5, true);
					htmltext = event;
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, true);
		final QuestState q123 = player.getQuestState(Q00123_TheLeaderAndTheFollower.class.getSimpleName());
		String htmltext = getNoQuestMsg(player);
		switch (qs.getState())
		{
			case State.CREATED:
			{
				if ((q123 != null) && q123.isStarted())
				{
					htmltext = "30298-02b.html";
				}
				else if ((q123 != null) && q123.isCompleted())
				{
					htmltext = "30298-02a.htm";
				}
				else if ((player.getLevel() >= MIN_LEVEL) && (player.getPledgeType() == -1) && (player.getSponsor() > 0))
				{
					htmltext = "30298-01.htm";
				}
				else
				{
					htmltext = "30298-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				if (qs.isMemoState(1))
				{
					if (getQuestItemsCount(player, BLOOD_OF_MAILLE_LIZARDMAN) < 10)
					{
						htmltext = "30298-04.html";
					}
					else
					{
						htmltext = "30298-05.html";
					}
				}
				else if (qs.isMemoState(2))
				{
					if (player.getSponsor() == 0)
					{
						if (qs.getMemoStateEx(1) == 1)
						{
							htmltext = "30298-06a.html";
						}
						else if (qs.getMemoStateEx(1) == 2)
						{
							htmltext = "30298-06b.html";
						}
						else if (qs.getMemoStateEx(1) == 3)
						{
							htmltext = "30298-06c.html";
						}
					}
					else
					{
						final Player c0 = World.getPlayer(player.getSponsor());
						if ((c0 != null) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, c0, true))
						{
							htmltext = "30298-07.html";
						}
						else
						{
							if (qs.getMemoStateEx(1) == 1)
							{
								htmltext = "30298-06.html";
							}
							else if (qs.getMemoStateEx(1) == 2)
							{
								htmltext = "30298-06d.html";
							}
							else if (qs.getMemoStateEx(1) == 3)
							{
								htmltext = "30298-06e.html";
							}
						}
					}
				}
				else if (qs.isMemoState(3))
				{
					qs.setMemoState(4);
					qs.setCond(7, true);
					htmltext = "30298-15.html";
				}
				else if (qs.isMemoState(4))
				{
					if (getQuestItemsCount(player, LEG_OF_KING_ARANEID) < 8)
					{
						htmltext = "30298-16.html";
					}
					else
					{
						if (qs.getMemoStateEx(1) == 1)
						{
							giveItems(player, CLAN_OATH_HELM, 1);
							giveItems(player, CLAN_OATH_ARMOR, 1);
							giveItems(player, CLAN_OATH_GAUNTLETS_HEAVY_ARMOR, 1);
							giveItems(player, CLAN_OATH_SABATON_HEAVY_ARMOR, 1);
							takeItems(player, LEG_OF_KING_ARANEID, -1);
						}
						else if (qs.getMemoStateEx(1) == 2)
						{
							giveItems(player, CLAN_OATH_HELM, 1);
							giveItems(player, CLAN_OATH_BRIGANDINE, 1);
							giveItems(player, CLAN_OATH_LEATHER_GLOVES_LIGHT_ARMOR, 1);
							giveItems(player, CLAN_OATH_BOOTS_LIGHT_ARMOR, 1);
							takeItems(player, LEG_OF_KING_ARANEID, -1);
						}
						else if (qs.getMemoStateEx(1) == 3)
						{
							giveItems(player, CLAN_OATH_HELM, 1);
							giveItems(player, CLAN_OATH_AKETON, 1);
							giveItems(player, CLAN_OATH_PADDED_GLOVES_ROBE, 1);
							giveItems(player, CLAN_OATH_SANDALS_ROBE, 1);
							takeItems(player, LEG_OF_KING_ARANEID, -1);
						}
						
						qs.exitQuest(false, true);
						htmltext = "30298-17.html";
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getQuestState(killer, false);
		if ((qs != null) && qs.isStarted())
		{
			switch (npc.getId())
			{
				case MAILLE_LIZARDMAN:
				case MAILLE_LIZARDMAN_SCOUT:
				case MAILLE_LIZARDMAN_GUARD:
				{
					if (qs.isMemoState(1) && giveItemRandomly(killer, npc, BLOOD_OF_MAILLE_LIZARDMAN, 1, 10, 7, true))
					{
						qs.setCond(2);
					}
					break;
				}
				case KING_OF_THE_ARANEID:
				{
					if (qs.isMemoState(4) && (killer.getSponsor() > 0))
					{
						final Player c0 = World.getPlayer(killer.getSponsor());
						if ((c0 != null) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, c0, true) && giveItemRandomly(killer, npc, LEG_OF_KING_ARANEID, 1, 8, 7, true))
						{
							qs.setCond(8);
						}
					}
					break;
				}
			}
		}
	}
}