Slay the enemy commander!
- ID
- 608
- Название
- Slay the enemy commander!
- start_npcs_json
- [31370]
- npc_ids_json
- [25312,31370]
- constants_json
- {"KADUN":31370,"MOS":25312,"MOS_HEAD":7236,"WISDOM_TOTEM":7220,"KETRA_ALLIANCE_FOUR":7214,"MIN_LEVEL":75}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00608_SlayTheEnemyCommanderKetra/Q00608_SlayTheEnemyCommanderKetra.java
NPC квеста
Условия уровней: выражения из Java
private static final int MIN_LEVEL = 75; htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasQuestItems(player, KETRA_ALLIANCE_FOUR)) ? "31370-01.htm" : "31370-02.htm" : "31370-03.htm";
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, MOS_HEAD, 1); giveItems(player, WISDOM_TOTEM, 1); addExpAndSp(player, 10000, 0);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[31370-01.htm] Kadun Zu Ketra: The time has come for our revenge! Let's slay the commander of the enemy forces and put an end to our long war with the Varka! Will you join our cause? "I'll do it."
[31370-02.htm] Kadun Zu Ketra: You're not up to this mission. If we're to achieve victory, we must be patient. A good general waits patiently for the right time to strike! (Only a character who possesses Ketra's friend - 4th level can undertake this quest.)
[31370-03.htm] Kadun Zu Ketra: You're not ready for this mission yet. Practice! (Only a character of level 75 or above may undertake this quest.)
[31370-04.htm] Kadun Zu Ketra: Excellent! This mission is critical to the war effort. I need you to go to the garrison of the Varka Silenos and kill their commander! He's known as Mos, and he's the best swordsman in the entire tribe! Although you're an excellent fighter, don't even think of taking him on alone! Gather your most reliable comrades together, and track down and kill Mos! The glorious flames of Pa'agrio will light your path forever!
[31370-05.html] Kadun Zu Ketra: Have you brought the head of the commander of the Varka Silenos? "Here's the Head of Mos."
[31370-06.html] Kadun Zu Ketra: Arise, Orcs! The time has come! Kill Mos, the Varka commander, cut off his head and bring it to me!
[31370-07.html] Kadun Zu Ketra: Ha! Excellent! This is outstanding! Our war with the Varka Silenos has entered its final stage! The loss of their commander means that they can no longer resist our powerful forces! Good job! Please accept this totem of strategy as an acknowledgement of your service to the Ketra Orcs!
Исходник условий и наград (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.Q00608_SlayTheEnemyCommanderKetra;
import org.l2jmobius.gameserver.config.PlayerConfig;
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;
/**
* Slay the Enemy Commander! (Ketra) (608)
* @author malyelfik
*/
public class Q00608_SlayTheEnemyCommanderKetra extends Quest
{
// NPC
private static final int KADUN = 31370;
// Monster
private static final int MOS = 25312;
// Items
private static final int MOS_HEAD = 7236;
private static final int WISDOM_TOTEM = 7220;
private static final int KETRA_ALLIANCE_FOUR = 7214;
// Misc
private static final int MIN_LEVEL = 75;
public Q00608_SlayTheEnemyCommanderKetra()
{
super(608, "Slay the enemy commander!");
addStartNpc(KADUN);
addTalkId(KADUN);
addKillId(MOS);
registerQuestItems(MOS_HEAD);
}
@Override
public void actionForEachPlayer(Player player, Npc npc, boolean isSummon)
{
final QuestState qs = getQuestState(player, false);
if ((qs != null) && qs.isCond(1) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, player, false))
{
giveItems(player, MOS_HEAD, 1);
qs.setCond(2, true);
}
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
String htmltext = event;
switch (event)
{
case "31370-04.htm":
{
qs.startQuest();
break;
}
case "31370-07.html":
{
if (hasQuestItems(player, MOS_HEAD) && qs.isCond(2))
{
giveItems(player, WISDOM_TOTEM, 1);
addExpAndSp(player, 10000, 0);
qs.exitQuest(true, true);
}
else
{
htmltext = getNoQuestMsg(player);
}
break;
}
default:
{
htmltext = null;
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player killer, boolean isSummon)
{
executeForEachPlayer(killer, npc, isSummon, true, false);
}
@Override
public String onTalk(Npc npc, Player player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasQuestItems(player, KETRA_ALLIANCE_FOUR)) ? "31370-01.htm" : "31370-02.htm" : "31370-03.htm";
break;
}
case State.STARTED:
{
htmltext = (qs.isCond(2) && hasQuestItems(player, MOS_HEAD)) ? "31370-05.html" : "31370-06.html";
break;
}
}
return htmltext;
}
}