For Sleepless Deadmen
- ID
- 359
- Название
- For Sleepless Deadmen
- start_npcs_json
- [30857]
- npc_ids_json
- [21006,21007,21008]
- constants_json
- {"DOOM_SERVANT":21006,"DOOM_GUARD":21007,"DOOM_ARCHER":21008,"REMAINS":5869}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00359_ForASleeplessDeadman/Q00359_ForASleeplessDeadman.java
NPC квеста
Условия уровней: выражения из Java
htmltext = (player.getLevel() < 60) ? "30857-01.htm" : "30857-02.htm";
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, getRandomEntry(REWARD), 4); giveItems(player, REMAINS, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30857-01.htm] High Priest Orven: Do you know about the Devastated Castle? It was built centuries ago to protect against the hordes of barbarians that were rampant even then. We were saved from the most recent invasion of the forces of Elmore by its mighty walls. Centuries of violent conflict have left it in ruins and haunted by the ghosts of the multitudes of warriors who met their bloody end there. These noble warriors deserve to rest in peace! If you meet anyone capable of taking on the powers of darkness, send them to me! (This quest may only be undertaken by a character of level 60 and above.)
[30857-02.htm] High Priest Orven: Do you know about the Devastated Castle? It was built centuries ago to protect against the hordes of barbarians that were rampant even then. We were saved from the most recent invasion of the forces of Elmore by its mighty walls, except of course for the thousands of innocents killed when they poisoned our wells... Centuries of violent conflict have left the castle in ruins and haunted by the ghosts of the multitudes of warriors who met their bloody end there. Listen quietly.
[30857-03.htm] High Priest Orven: These noble warriors made the ultimate sacrifice and successfully defended the castle from the enemy! There is no more honorable way to die, but their poor souls have not received any proper recognition... No Glory of Einhasad... Not even a Rest of Shilen, which is given to all! This is a long story... Are you sure you want to hear it? "Yes, please."
[30857-04.htm] High Priest Orven: In the time of Raul the Unification King, Gustaf Ken Vennerheim fought a bloody battle for the castle. After 130 days of pitched combat, he was slain without ever fulfilling his goal. But now it seems that even death cannot stop his spirit! He has formed an alliance with the forces of darkness and returned as an undead. He has raised an army of the dead, among them our own warriors who died defending the castle against him! He is attempting to take the Devastated Castle again! ......!
[30857-05.htm] High Priest Orven: I feel the agony of their souls, being forced to fight their brothers... Such noble warriors deserve a peaceful rest... The immortal heroes of Aden must be freed from this evil enslavement! Would you recover their remains and bring them here, to the Temple of Einhasad? You will find them among the doom archers, doom guards and doom servants in the Fields of Massacre near the Devastated Castle. "I will bring you the remains of the heroes."
[30857-06.htm] High Priest Orven: When you break the bonds holding their souls, their bodies will turn to ashes. Collect these ashes and bring them to me, I will purify them. I must have the remains of 60 heroes to perform the ritual. May Einhasad watch over you...
[30857-07.htm] High Priest Orven: The Devastated Castle is northeast of here. There are many restless souls haunting that area. You'll find doom archers, doom guards, and doom servants. Bring back 60 of their remains. Beware the doom knights, doom warriors and doom troopers who patrol there. They are former soldiers of Elmore. They won't let you free their minions easily...
[30857-08.htm] High Priest Orven: Good work! Now they shall rest in peace! I give you blessings in the name of Einhasad. May we never have to deal with such a desecration again! Now I must pray. Come back later. . . . .
[30857-09.htm] High Priest Orven: Oh, Einhasad! Here are your children. Their last battle has been won. Take them into your arms, into the world of the dead. Release them from their bonds and receive them into the bosom of Shilen. Give them eternal rest and happiness in your light. For those who grieve these brave warriors still, dry your tears, for now your loved ones are at peace... Wait until he finishes praying.
[30857-10.htm] High Priest Orven: The purification ritual is over. I found a gemstone that was sparkling with a holy light. I think it must have been used by one of the fallen heroes of the castle. Perhaps they left it for you! Yes, I think they did! Why don't you take it? There are still many of our fallen comrades out there who have not been put to rest. If you want to help, come back and see me again.
Исходник условий и наград (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.Q00359_ForASleeplessDeadman;
import java.util.HashMap;
import java.util.Map;
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 Q00359_ForASleeplessDeadman extends Quest
{
// Monsters
private static final int DOOM_SERVANT = 21006;
private static final int DOOM_GUARD = 21007;
private static final int DOOM_ARCHER = 21008;
// Item
private static final int REMAINS = 5869;
// Reward
private static final int[] REWARD =
{
6341,
6342,
6343,
6344,
6345,
6346,
5494,
5495
};
// Drop chances
private static final Map<Integer, Integer> CHANCES = new HashMap<>();
static
{
CHANCES.put(DOOM_SERVANT, 320000);
CHANCES.put(DOOM_GUARD, 340000);
CHANCES.put(DOOM_ARCHER, 420000);
}
public Q00359_ForASleeplessDeadman()
{
super(359, "For Sleepless Deadmen");
registerQuestItems(REMAINS);
addStartNpc(30857); // Orven
addTalkId(30857);
addKillId(DOOM_SERVANT, DOOM_GUARD, DOOM_ARCHER);
}
@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("30857-06.htm"))
{
st.startQuest();
}
else if (event.equals("30857-10.htm"))
{
giveItems(player, getRandomEntry(REWARD), 4);
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() < 60) ? "30857-01.htm" : "30857-02.htm";
break;
}
case State.STARTED:
{
final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30857-07.htm";
}
else if (cond == 2)
{
htmltext = "30857-08.htm";
st.setCond(3, true);
takeItems(player, REMAINS, -1);
}
else if (cond == 3)
{
htmltext = "30857-09.htm";
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player player, boolean isPet)
{
final QuestState st = getQuestState(player, false);
if ((st == null) || !st.isCond(1))
{
return;
}
if (getRandom(1000000) < CHANCES.get(npc.getId()))
{
giveItems(player, REMAINS, 1);
if (getQuestItemsCount(player, REMAINS) < 60)
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
st.setCond(2, true);
}
}
}
}