ZURSULUS L2

Vanquish Remnants

ID
326
Название
Vanquish Remnants
start_npcs_json
[30435]
npc_ids_json
[]
constants_json
{"RED_CROSS_BADGE":1359,"BLUE_CROSS_BADGE":1360,"BLACK_CROSS_BADGE":1361,"BLACK_LION_MARK":1369}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00326_VanquishRemnants/Q00326_VanquishRemnants.java

NPC квеста

Записей нет.

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

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

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

giveAdena(player, ((redBadges * 60) + (blueBadges * 65) + (blackBadges * 70) + ((badgesSum >= 10) ? 4320 : 0)), true);
giveItems(player, BLACK_LION_MARK, 1);
giveItems(player, RED_CROSS_BADGE, 1);
giveItems(player, BLUE_CROSS_BADGE, 1);
giveItems(player, BLACK_CROSS_BADGE, 1);

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

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

[30435-01.htm] Leopold: Currently, the Black Lion mercenaries are working for the lord of Gludio. They are in charge of getting rid of the remnants of Ol Mahum, who are still staying and causing problems in this land. They have been fighting against the remnants for several months. However, Ol Mahums are not savages like werewolves, but highly trained soldiers. They are very difficult to deal with, since they are well organized like regular armies. A few days ago, our Black Lion troop was shamefully defeated in close battle with Ol Mahums on the outskirts of Gludin. Many brothers lost their lives in combat. We are short of troops until the second platoon returns from the Wastelands in the south. I am very worried ... We may have to recruit some good fighters who will fight with us ... (This quest may only be undertaken by a character of level 21 and above.) [30435-02.htm] Leopold: Currently, the Black Lion mercenaries are working for the lord of Gludio. They are in charge of getting rid of the remnants of Ol Mahum, who are still staying and causing problems in this land. They have been fighting against the remnants for several months. However, Ol Mahums are not savages like werewolves, but highly trained soldiers. They are very difficult to deal with, since they are well organized like regular armies. A few days ago, our Black Lion troop was shamefully defeated in a close battle with Ol Mahums on the outskirts of Gludin. Many brothers lost their lives in combat. We are short of troops until our brothers of the second platoon, who have been dispatched to the Wastelands in the south, return. So we have decided to recruit skilled fighters to temporarily fill our troop. From the scars on your armor and the way you hold your weapon, you seem like you have had a lot of experience on the field. What do you think? Won't you fight for the Black Lions? It is an opportunity to play a role in punishing the cruel Ol Mahum who have ruined this land. Say you will fight [30435-03.htm] Leopold: The Black Lion undoubtedly rewards its members according to skill and performance. You will be paid according to the number of enemies you kill. One condition, though, you must take the badge of ranking as a token of proof. Ol Mahum use badges in the shape of a cross, taking after the foreign troops of Gracia. Patrols and guards have red, suppliers, officers, and shooters have blue, and the generals and captains have Black Cross Badges. Naturally, you will receive a higher award depending on the rank of the Ol Mahum you killed. If you display great skills on the battlefield, you can become an official member of the Black Lions. For this, you must gather 100 badges of the Ol Mahum to prove your skills. Currently, Ol Mahum are camping in the abandoned camp. If you don't know how to get there, ask Guard Linus. Wonderful! Now get ready to depart, my comrade. Forward to victory! [30435-04.htm] Leopold: Comrade, how is the situation on the battlefield? As you have no badge of the Ol Mahum in your hand, I see your performance has not been good. If you think fighting against the Ol Mahum is too difficult for you, you can always quit. It is better for both of us if you acknowledge your limits instead of aiming too high. If you are thinking of continuing to fight Ol Mahums, I will give you some advice. As I already told you, the Ol Mahum may seem like savage beasts, but they have an organization that has been trained as well as any country's official army. Ol mahums will help companions in danger, so you may have to face several Ol Mahums at once. Unless you form a troop like them, you have no choice but to approach them carefully and use guerilla tactics to deal with them one at a time. Knights may say it is a dishonorable way to fight, but it's quite an effective method. Say you will quit Say you will continue [30435-05.htm] Leopold: Welcome, comrade of the sword! Seeing you safely return from the scene of battle gives me great joy. The badges of the enemy in your hand show that the goddess of victory has smiled upon you. I received a letter that the brothers of the second platoon, who were dispatched to the south part of Gludio, will return later than planned. I will need more of your services for the time being. Say you will quit Say you will continue [30435-06.htm] Leopold: Welcome, my comrade of the sword! I congratulate you on your safe return. How was your performance on the battlefield? How truly amazing! You have really brought me 100 badges! Magnificent! As I promised, I acknowledge you a member of the Black Lions. Because of our current situation, we cannot give you a proper joining ceremony, but instead, I give you this mark. The mark shows that you are a member of the proud Black Lions. I received a letter that the brothers of the second platoon, who were dispatched to the south part of Gludio, will return later than planned. You must go back to the battlefield and fight, comrade of the sword! Say you will quit Say you will continue [30435-07.htm] Leopold: I am sorry, but if this is truly your will, I cannot stop you. However, the ties made as brothers of the sword are not easily broken ... We will meet again someday. May the goddess of victory be with you in all the battlefields that you walk upon!! [30435-08.htm] Leopold: Please continue your services, comrade of the sword. May the goddess of victory guide your sword and staff! [30435-09.htm] Leopold: Welcome, my comrade of the sword! I congratulate you on your safe return. How was your performance on the battlefield? How truly amazing! You brought back another hundred badges! Magnificent! Ha ha! You have already proven your skills and have been acknowledged as a member of the Black Lions, and yet you still amaze me! I received a letter that the brothers of the second platoon, who were dispatched to the south part of Gludio, will return later than planned. Our brothers here must hold on until they return. Go on back to the battlefield and fight, brother of the sword! Say you will quit Say you will continue
Исходник условий и наград (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.Q00326_VanquishRemnants;

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 Q00326_VanquishRemnants extends Quest
{
	// Items
	private static final int RED_CROSS_BADGE = 1359;
	private static final int BLUE_CROSS_BADGE = 1360;
	private static final int BLACK_CROSS_BADGE = 1361;
	
	// Reward
	private static final int BLACK_LION_MARK = 1369;
	
	public Q00326_VanquishRemnants()
	{
		super(326, "Vanquish Remnants");
		registerQuestItems(RED_CROSS_BADGE, BLUE_CROSS_BADGE, BLACK_CROSS_BADGE);
		addStartNpc(30435); // Leopold
		addTalkId(30435);
		addKillId(20053, 20437, 20058, 20436, 20061, 20439, 20063, 20066, 20438);
	}
	
	@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("30435-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30435-07.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() < 21) ? "30435-01.htm" : "30435-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int redBadges = getQuestItemsCount(player, RED_CROSS_BADGE);
				final int blueBadges = getQuestItemsCount(player, BLUE_CROSS_BADGE);
				final int blackBadges = getQuestItemsCount(player, BLACK_CROSS_BADGE);
				final int badgesSum = redBadges + blueBadges + blackBadges;
				if (badgesSum > 0)
				{
					takeItems(player, RED_CROSS_BADGE, -1);
					takeItems(player, BLUE_CROSS_BADGE, -1);
					takeItems(player, BLACK_CROSS_BADGE, -1);
					giveAdena(player, ((redBadges * 60) + (blueBadges * 65) + (blackBadges * 70) + ((badgesSum >= 10) ? 4320 : 0)), true);
					if (badgesSum >= 100)
					{
						if (!hasQuestItems(player, BLACK_LION_MARK))
						{
							htmltext = "30435-06.htm";
							giveItems(player, BLACK_LION_MARK, 1);
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
						else
						{
							htmltext = "30435-09.htm";
						}
					}
					else
					{
						htmltext = "30435-05.htm";
					}
				}
				else
				{
					htmltext = "30435-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;
		}
		
		switch (npc.getId())
		{
			case 20053:
			case 20437:
			case 20058:
			{
				if (getRandom(100) < 33)
				{
					giveItems(player, RED_CROSS_BADGE, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case 20436:
			case 20061:
			case 20439:
			case 20063:
			{
				if (getRandom(100) < 16)
				{
					giveItems(player, BLUE_CROSS_BADGE, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case 20066:
			case 20438:
			{
				if (getRandom(100) < 12)
				{
					giveItems(player, BLACK_CROSS_BADGE, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
		}
	}
}