Whisper of Dreams, Part 2
- ID
- 375
- Название
- Whisper of Dreams, Part 2
- start_npcs_json
- [30515]
- npc_ids_json
- [20624,20629,30515]
- constants_json
- {"MANAKIA":30515,"KARIK":20629,"CAVE_HOWLER":20624,"MYSTERIOUS_STONE":5887,"KARIK_HORN":5888,"CAVE_HOWLER_SKULL":5889}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00375_WhisperOfDreamsPart2/Q00375_WhisperOfDreamsPart2.java
NPC квеста
Условия уровней: выражения из Java
htmltext = (!hasQuestItems(player, MYSTERIOUS_STONE) || (player.getLevel() < 60)) ? "30515-01.htm" : "30515-02.htm";
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, getRandomEntry(REWARDS), 1); giveItems(st.getPlayer(), KARIK_HORN, 1); giveItems(st.getPlayer(), CAVE_HOWLER_SKULL, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30515-01.htm] Seer Manakia: Your inner voice is still not clear to you. Come back to me when it is. (This quest may only be undertaken by a character of level 60 and above.)
[30515-02.htm] Seer Manakia: Oh, great Pa'agrio! How could you have given such power to such an undeserving creature! ... If I had that power, I could put it to much better use... I must have another ingredient in order to use the stone. Will you continue to help me? "I will continue to help you."
[30515-03.htm] Seer Manakia: May the glory of Pa'agrio shine upon the truly brave! Bring me back 100 skulls of cave howlers and 100 horns of kariks from the Lair of Antharas.
[30515-04.htm] Seer Manakia: My brave friend! Gather your strongest colleagues and bring me 100 skulls of cave howlers and 100 horns of kariks. They can be found in the deepest, darkest parts of the Lair of Antharas.
[30515-05.htm] Seer Manakia: Ah, at last, I shall behold the shadow of Pa'agrio. My brave warrior, your spirit is true. I will honor you with this gift. Would you consider getting more ingredients for me? My tribe desperately needs your help. "I'll collect more ingredients." "I quit."
[30515-06.htm] Seer Manakia: The deepest parts of the Lair of Antharas are infested by many evil spirits. You mustn't attempt to go there alone.
[30515-07.htm] Seer Manakia: I appreciate your assistance.
Исходник условий и наград (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.Q00375_WhisperOfDreamsPart2;
import org.l2jmobius.commons.util.Rnd;
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 Q00375_WhisperOfDreamsPart2 extends Quest
{
// NPCs
private static final int MANAKIA = 30515;
// Monsters
private static final int KARIK = 20629;
private static final int CAVE_HOWLER = 20624;
// Items
private static final int MYSTERIOUS_STONE = 5887;
private static final int KARIK_HORN = 5888;
private static final int CAVE_HOWLER_SKULL = 5889;
// Rewards : A grade robe recipes
private static final int[] REWARDS =
{
5348,
5350,
5352
};
public Q00375_WhisperOfDreamsPart2()
{
super(375, "Whisper of Dreams, Part 2");
registerQuestItems(KARIK_HORN, CAVE_HOWLER_SKULL);
addStartNpc(MANAKIA);
addTalkId(MANAKIA);
addKillId(KARIK, CAVE_HOWLER);
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
String htmltext = event;
final QuestState st = getQuestState(player, false);
if (st == null)
{
return htmltext;
}
// Manakia
if (event.equals("30515-03.htm"))
{
st.startQuest();
takeItems(player, MYSTERIOUS_STONE, 1);
}
else if (event.equals("30515-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 = (!hasQuestItems(player, MYSTERIOUS_STONE) || (player.getLevel() < 60)) ? "30515-01.htm" : "30515-02.htm";
break;
}
case State.STARTED:
{
if ((getQuestItemsCount(player, KARIK_HORN) >= 100) && (getQuestItemsCount(player, CAVE_HOWLER_SKULL) >= 100))
{
htmltext = "30515-05.htm";
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
takeItems(player, KARIK_HORN, 100);
takeItems(player, CAVE_HOWLER_SKULL, 100);
giveItems(player, getRandomEntry(REWARDS), 1);
}
else
{
htmltext = "30515-04.htm";
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player player, boolean isPet)
{
// Drop horn or skull to anyone.
final Player partyMember = getRandomPartyMemberState(player, State.STARTED);
if (partyMember == null)
{
return;
}
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
{
return;
}
switch (npc.getId())
{
case KARIK:
{
giveItems(st.getPlayer(), KARIK_HORN, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
break;
}
case CAVE_HOWLER:
{
if (Rnd.get(10) < 9)
{
giveItems(st.getPlayer(), CAVE_HOWLER_SKULL, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
break;
}
}
}
}