Chest caught with a bait of earth
- ID
- 29
- Название
- Chest caught with a bait of earth
- start_npcs_json
- [31574]
- npc_ids_json
- [30909,31574]
- constants_json
- {"WILLIE":31574,"ANABEL":30909,"SMALL_PURPLE_TREASURE_CHEST":6507,"SMALL_GLASS_BOX":7627,"PLATED_LEATHER_GLOVES":2455}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00029_ChestCaughtWithABaitOfEarth/Q00029_ChestCaughtWithABaitOfEarth.java
NPC квеста
Условия уровней: выражения из Java
if (player.getLevel() < 48)
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, SMALL_GLASS_BOX, 1); giveItems(player, PLATED_LEATHER_GLOVES, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30909-01.htm] Magister Anabel: Neither love nor friendship will ever last between a mortal Human and an Elf. They fade with time, but memories, they'll last forever. What can I do for you? "I found the box with the names Anabel and Liesel on it."
[30909-02.htm] Magister Anabel: Really? I asked Willie to find it for me... That bait has power beyond normal magic. It draws on the four elements of nature, earth, water, fire and air. The lost items find their own way in the water through the elements in the bait rather than trying to catch them with magic. I've studied magic for a hundred years, and I could never come up with that! Ah, Liesel. I miss her so much. We met long ago, and swore we would be friends forever. We made this Secret Box and buried it in the sand on Talking Island, where it was washed away by the waves. I am now 400 years old and she was Human, so only her ancestors are left. For this memory of my past, I offer you this gift, please take it.
[30909-03.htm] Magister Anabel: A box with our names? Ah Liesel, I miss her so. You don't have the box with you, but if you find it, please bring it to me.
[31574-01.htm] Fishermen's Guild Member Willie: Did the bait of land that I gave you work? Mastering the spirits of land can be tricky, but it's worth the effort. You may find that you catch more than you bargained for! Actually, this bait isn't intended to catch fish at all! We've had a few complaints about that... "What's it good for, then?"
[31574-02.htm] Fishermen's Guild Member Willie: Well, it's obvious you're not here to buy fishing gear! Have you ever been fishing? Try it once, you'll be hooked! Heh heh! I'm the man to think of when you need bait! (This quest may only be undertaken by a character of level 48 and above.)
[31574-03.htm] Fishermen's Guild Member Willie: Well, it's obvious you're not here to buy fishing gear! Have you ever been fishing? Try it once, you'll be hooked! Heh heh! I'm the man to think of when you need bait! (This quest may only be undertaken by a character who has completed Willie's Special Bait quest.)
[31574-04.htm] Fishermen's Guild Member Willie: A while back someone was here asking about a small purple treasure box. The bait that I gave you before was designed to find it. The problem is that the bait occasionally catches other things, but it's the best hope you have of recovering the box. If you've found the box, please give it to me. If not, I must ask you to go and find it for me. I apologize for being untruthful earlier. The bait works better if the fisherman doesn't know about its properties. Bring me the small purple treasure box and I'll tell you who it belongs to! He lost it near the shore. Look for it there. Remember, your fishing skill must be level 16, and you must bring the box to me unopened. Someone else may have already found it, so ask around in the market.
[31574-05.htm] Fishermen's Guild Member Willie: Certainly you're not finished already! I don't believe it! Have you already found the small purple treasure box? Let me see it! "Here it is."
[31574-06.htm] Fishermen's Guild Member Willie: Welcome back! You've already finished, eh? No? Well, I don't have all day, buddy! Bring me the small purple treasure box. I realize it's like looking for a needle in a haystack, but I'm counting on you! Maybe you should ask around in the market... Someone may have already found it!
[31574-07.htm] Fishermen's Guild Member Willie: This seems to be the small purple treasure box that my client lost. When I opened it, I found this Small Glass Box. It has the names of Anabel and Liesel engraved on it. I don't know who Liesel is, but Anabel is my client. Anabel is a Magister in Heine Castle Town. She's kept the temple there for centuries. Please deliver this glass box to her.
[31574-08.htm] Fishermen's Guild Member Willie: Didn't you say you found the small purple treasure box? I must authenticate its contents. If you opened it, it's useless! You'll need to bring another one. You don't seem to have the box.
[31574-09.htm] Fishermen's Guild Member Willie: Why haven't you taken the glass box to Anabel in Heine Castle Town? She's been waiting for it an awful long time. I'm sure she's anxious to get it back!
Исходник условий и наград (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.Q00029_ChestCaughtWithABaitOfEarth;
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 quests.Q00052_WilliesSpecialBait.Q00052_WilliesSpecialBait;
public class Q00029_ChestCaughtWithABaitOfEarth extends Quest
{
// NPCs
private static final int WILLIE = 31574;
private static final int ANABEL = 30909;
// Items
private static final int SMALL_PURPLE_TREASURE_CHEST = 6507;
private static final int SMALL_GLASS_BOX = 7627;
private static final int PLATED_LEATHER_GLOVES = 2455;
public Q00029_ChestCaughtWithABaitOfEarth()
{
super(29, "Chest caught with a bait of earth");
registerQuestItems(SMALL_GLASS_BOX);
addStartNpc(WILLIE);
addTalkId(WILLIE, ANABEL);
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
String htmltext = event;
final QuestState st = getQuestState(player, false);
if (st == null)
{
return htmltext;
}
switch (event)
{
case "31574-04.htm":
{
st.startQuest();
break;
}
case "31574-07.htm":
{
if (hasQuestItems(player, SMALL_PURPLE_TREASURE_CHEST))
{
st.setCond(2);
takeItems(player, SMALL_PURPLE_TREASURE_CHEST, 1);
giveItems(player, SMALL_GLASS_BOX, 1);
}
else
{
htmltext = "31574-08.htm";
}
break;
}
case "30909-02.htm":
{
if (hasQuestItems(player, SMALL_GLASS_BOX))
{
htmltext = "30909-02.htm";
takeItems(player, SMALL_GLASS_BOX, 1);
giveItems(player, PLATED_LEATHER_GLOVES, 1);
st.exitQuest(false, true);
}
else
{
htmltext = "30909-03.htm";
}
break;
}
}
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.getLevel() < 48)
{
htmltext = "31574-02.htm";
}
else
{
final QuestState st2 = player.getQuestState(Q00052_WilliesSpecialBait.class.getSimpleName());
if ((st2 != null) && st2.isCompleted())
{
htmltext = "31574-01.htm";
}
else
{
htmltext = "31574-03.htm";
}
}
break;
}
case State.STARTED:
{
final int cond = st.getCond();
switch (npc.getId())
{
case WILLIE:
{
if (cond == 1)
{
htmltext = (!hasQuestItems(player, SMALL_PURPLE_TREASURE_CHEST)) ? "31574-06.htm" : "31574-05.htm";
}
else if (cond == 2)
{
htmltext = "31574-09.htm";
}
break;
}
case ANABEL:
{
if (cond == 2)
{
htmltext = "30909-01.htm";
}
break;
}
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(player);
break;
}
}
return htmltext;
}
}