Ghosts of Batur
- ID
- 645
- Название
- Ghosts of Batur
- start_npcs_json
- [32017]
- npc_ids_json
- [32017]
- constants_json
- {"KARUDA":32017,"CURSED_GRAVE_GOODS":8089}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00645_GhostsOfBatur/Q00645_GhostsOfBatur.java
NPC квеста
| ID | Название | Старт квеста | Уровень |
|---|---|---|---|
| 32017 | Karuda | Да | 70 |
Условия уровней: выражения из Java
htmltext = (player.getLevel() < 23) ? "32017-02.htm" : "32017-01.htm";
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, reward[0], reward[1]); giveItems(killer, CURSED_GRAVE_GOODS, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[32017-01.htm] Karuda: You have the look of an experienced adventurer; maybe you can help us. There are many angry spirits wandering around here - their traces are obvious. We desperately need help to prevent them from going to the Immortal Plateau. Will you help us, o brave one? "How can I help you?"
[32017-02.htm] Karuda: This is no place for adventurers like you! Flee at once; I cannot answer for your safety if you tarry. (This quest may only be undertaken by a character of level 23 and above.)
[32017-03.htm] Karuda: We can help the Spiteful Souls in the Crypts of Disgrace to become "saved" before they travel elsewhere. When you defeat the Spiteful Souls, you will see some Cursed Grave Accessories which they used to manifest their physical power. Please these accessories them and bring them to me. By my current estimate, I need about 180 of them. If you get me that many, I think I can do the rest.
[32017-04.htm] Karuda: Have you already forgotten your promise to defeat Spiteful Souls and bring me 180 of their Cursed Grave Accessories? Keep your promise and go!
[32017-05.htm] Karuda: Thanks to your hard work, many spirits were sent to their rest. I can't thank you enough. Please give me the Cursed Grave Goods. Give him the 180 Cursed Grave Goods.
[32017-06.htm] Karuda: These Cursed Grave Goods are the proof of your valorous hard work. I know it's not much to give in return for such a task, but I want you to have a small token of my appreciation. You may have your choice. Braided Hemp Cokes Steel Coarse Bone Powder Leather Steel Mold
[32017-07.htm] Karuda: Here you go. Use it in good health, and may it aid you as you hope!
Исходник условий и наград (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.Q00645_GhostsOfBatur;
import org.l2jmobius.commons.util.StringUtil;
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.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
import org.l2jmobius.gameserver.util.LocationUtil;
public class Q00645_GhostsOfBatur extends Quest
{
// NPC
private static final int KARUDA = 32017;
// Item
private static final int CURSED_GRAVE_GOODS = 8089;
// Rewards
private static final int[][] REWARDS =
{
// @formatter:off
{1878, 18},
{1879, 7},
{1880, 4},
{1881, 6},
{1882, 10},
{1883, 2}
// @formatter:on
};
public Q00645_GhostsOfBatur()
{
super(645, "Ghosts of Batur");
addStartNpc(KARUDA);
addTalkId(KARUDA);
addKillId(22007, 22009, 22010, 22011, 22012, 22013, 22014, 22015, 22016);
}
@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("32017-03.htm"))
{
st.startQuest();
}
else if (StringUtil.isNumeric(event))
{
htmltext = "32017-07.htm";
takeItems(player, CURSED_GRAVE_GOODS, -1);
final int[] reward = REWARDS[Integer.parseInt(event)];
giveItems(player, reward[0], reward[1]);
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() < 23) ? "32017-02.htm" : "32017-01.htm";
break;
}
case State.STARTED:
{
final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32017-04.htm";
}
else if (cond == 2)
{
htmltext = "32017-05.htm";
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player killer, boolean isSummon)
{
final Player player = getRandomPartyMember(killer, 1);
if ((player != null) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, player, false) && (getRandom(100) < 75))
{
final QuestState qs = getQuestState(player, false);
giveItems(killer, CURSED_GRAVE_GOODS, 1);
if (qs.isCond(1) && (getQuestItemsCount(killer, CURSED_GRAVE_GOODS) >= 500))
{
qs.setCond(2, true);
}
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
}
}