Protect the Water Source
- ID
- 159
- Название
- Protect the Water Source
- start_npcs_json
- [30154]
- npc_ids_json
- []
- constants_json
- {"PLAGUE_DUST":1035,"HYACINTH_CHARM_1":1071,"HYACINTH_CHARM_2":1072}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00159_ProtectTheWaterSource/Q00159_ProtectTheWaterSource.java
NPC квеста
Записей нет.
Условия уровней: выражения из Java
else if (player.getLevel() < 12)
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, HYACINTH_CHARM_1, 1); giveItems(player, HYACINTH_CHARM_2, 1); giveAdena(player, 18250, true); giveItems(killer, PLAGUE_DUST, 1); giveItems(killer, PLAGUE_DUST, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30154-00.htm] Hierarch Asterios: Young traveler of a foreign race, there is nothing you can do for me. Listen to the beautiful music of the woods and enjoy life under the shade of the Mother Tree, and rest your weary body. (This quest may only be undertaken by an Elven character.)
[30154-02.htm] Hierarch Asterios: Have you felt anything strange lately while walking around the village? I recently saw yellow, withered leaves on the surface of the pond in the middle of the village, under the Mother Tree. I don't know why a tree that has grown for thousands of years should suddenly drop discolored, withered leaves. I am very worried. I will delve deeper into this, but if further investigation is necessary, I may have to ask you to aid me in investigating this matter. (This quest may only be undertaken by an Elven character of level 12 and above.)
[30154-03.htm] Hierarch Asterios: I don't know if you've noticed, but the Mother Tree in the middle of the village has been slowly withering. The progress of the blight is so slow that it is hard to notice unless one possesses high magic powers. We do not wish to worry our brothers, and only a few of us know this secret. None of our ancestors' records show any incident of the Mother Tree withering. I cannot shake the dread that something is terribly wrong. As a result of my research, I discovered that the Mother Tree is withering because the water is full of contaminants that dry up the tree's roots. It is my guess that someone is polluting the water source of the river that flows into the village. But I cannot guess who that someone is. That someone would dare to pollute our life source, our water, in this chaotic time of war against the Misty Mountain orcs ... This cannot be left alone, it must be dealt with. The sentinels cannot be spared, as they must defend the village, and all of our Rangers have been sent to the woods in preparation for our battle with the orcs. You must go to the water source and find out the reason behind the pollution. Say you will help
[30154-04.htm] Hierarch Asterios: You can reach the water source by following the river that flows into the village and travelling north. If you find anything that is even slightly suspicious, please investigate it. And bring back proof so that I can examine it. Take this charm. It will protect you from the contaminants that have fouled our water. Please hurry. May the blessings of Eva be with you ...
[30154-05.htm] Hierarch Asterios: What are you doing still here? Go north and follow the river to find the water's source, and find out who is contaminating our water. The Mother Tree is dying! Any more delays, and our very lives may be threatened.
[30154-06.htm] Hierarch Asterios: This ...! The undead you came across at the water source are called Plague Zombies, and are those creatures who were killed by plagues and that have been resurrected with black magic. The fine powder that falls from their decomposing bodies is this Plague Dust ... This is the substance that has been polluting our water. You would have been infected by the plague if you had not taken the Hyacinth Charm ... Hmm ... This is definitely the doing of the Dark Elves! They cannot be forgiven! But first, we must revive the dying Mother Tree. To do that, we must purify the polluted waters ... I will need more Plague Dust to research a purification spell. Please go back to the water source and obtain this cursed powder for me. I need at least five handfuls.
[30154-07.htm] Hierarch Asterios: Go and bring me five handfuls of plague dust from those zombies that are polluting our water source. Go north and follow the river that flows into the village. The Mother Tree is dying! Hurry! May the blessings of Eva be with you ...!
[30154-08.htm] Hierarch Asterios: Well done. This will be enough to research the purification magic. As soon as the magic is complete, I will travel under the protection of the sentinels to the water source and perform the purification spell, and eradicate any plague zombies that may yet remain. My young kinsman, you have performed a great deed for our sacred Mother Tree Glade and for the Elven race. I will give you this as a tribute to your brave deed. It may not seem like much, but it will come in handy one day, so keep it well. May the splendor of mithril forever shine on the forest and lake!
Исходник условий и наград (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.Q00159_ProtectTheWaterSource;
import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.actor.enums.creature.Race;
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 Q00159_ProtectTheWaterSource extends Quest
{
// Items
private static final int PLAGUE_DUST = 1035;
private static final int HYACINTH_CHARM_1 = 1071;
private static final int HYACINTH_CHARM_2 = 1072;
public Q00159_ProtectTheWaterSource()
{
super(159, "Protect the Water Source");
registerQuestItems(PLAGUE_DUST, HYACINTH_CHARM_1, HYACINTH_CHARM_2);
addStartNpc(30154); // Asterios
addTalkId(30154);
addKillId(27017); // Plague Zombie
}
@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("30154-04.htm"))
{
st.startQuest();
giveItems(player, HYACINTH_CHARM_1, 1);
}
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:
{
if (player.getRace() != Race.ELF)
{
htmltext = "30154-00.htm";
}
else if (player.getLevel() < 12)
{
htmltext = "30154-02.htm";
}
else
{
htmltext = "30154-03.htm";
}
break;
}
case State.STARTED:
{
final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30154-05.htm";
}
else if (cond == 2)
{
htmltext = "30154-06.htm";
st.setCond(3, true);
takeItems(player, PLAGUE_DUST, -1);
takeItems(player, HYACINTH_CHARM_1, 1);
giveItems(player, HYACINTH_CHARM_2, 1);
}
else if (cond == 3)
{
htmltext = "30154-07.htm";
}
else if (cond == 4)
{
htmltext = "30154-08.htm";
takeItems(player, HYACINTH_CHARM_2, 1);
takeItems(player, PLAGUE_DUST, -1);
giveAdena(player, 18250, true);
st.exitQuest(false, true);
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(player);
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player killer, boolean isSummon)
{
final QuestState qs = getQuestState(killer, false);
if (qs != null)
{
switch (qs.getCond())
{
case 1:
{
if ((getRandom(100) < 40) && hasQuestItems(killer, HYACINTH_CHARM_1) && !hasQuestItems(killer, PLAGUE_DUST))
{
giveItems(killer, PLAGUE_DUST, 1);
qs.setCond(2, true);
}
break;
}
case 3:
{
long dust = getQuestItemsCount(killer, PLAGUE_DUST);
if ((getRandom(100) < 40) && (dust < 5) && hasQuestItems(killer, HYACINTH_CHARM_2))
{
giveItems(killer, PLAGUE_DUST, 1);
if ((++dust) >= 5)
{
qs.setCond(4, true);
}
else
{
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
break;
}
}
}
}
}