Searching for Treasure
- ID
- 383
- Название
- Searching for Treasure
- start_npcs_json
- [30890]
- npc_ids_json
- [30890,31148]
- constants_json
- {"ESPEN":30890,"PIRATE_CHEST":31148,"PIRATE_TREASURE_MAP":5915,"THIEF_KEY":1661}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00383_TreasureHunt/Q00383_TreasureHunt.java
NPC квеста
Условия уровней: выражения из Java
htmltext = ((player.getLevel() < 42) || !hasQuestItems(player, PIRATE_TREASURE_MAP)) ? "30890-01.htm" : "30890-02.htm";
Выдача предметов, адены и опыта: выражения из Java
giveAdena(player, 1000, true); giveItems(player, 2450, 1); giveItems(player, 2451, 1); giveItems(player, 956, 1); giveItems(player, 952, 1); giveItems(player, 4481, 1); giveItems(player, 4482, 1); giveItems(player, 4483, 1); giveItems(player, 4484, 1); giveItems(player, 4485, 1); giveItems(player, 4486, 1); giveItems(player, 4487, 1); giveItems(player, 4488, 1); giveItems(player, 4489, 1); giveItems(player, 4490, 1); giveItems(player, 4491, 1); giveItems(player, 4492, 1); giveItems(player, 1337, 1); giveItems(player, 1338, 2); giveItems(player, 1339, 2); giveItems(player, 3447, 2); giveItems(player, 3450, 1); giveItems(player, 3453, 1); giveItems(player, 3456, 1); giveItems(player, 4408, 1); giveItems(player, 4409, 1); giveItems(player, 4418, 1); giveItems(player, 4419, 1); giveAdena(player, i1, true);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30890-01.htm] Trader Espen: As a way of escaping my boring daily life, I have a hobby of collecting pirate memorabilia. I'm especially interested in anything to do with Zaken, the legendary scourge of the high seas. Currently, I'm conducting research about Muska, Zaken's subordinate who stole his treasure and ran away. It is said that he was once Zaken's boatswain, and when Zaken's ship was anchored at Innadril Harbor, he made off with a few Treasure Chests and stashed them somewhere on Alligator Island. Isn't that interesting? Soon, I plan to organize an expedition and go look for the treasure. Of course, I will need to hire seasoned adventurers... (This quest may only be undertaken by a character who possesses the Pirate's Treasure Map and whose level is 42 or above.)
[30890-02.htm] Trader Espen: As a way of escaping my boring daily life, I have a hobby of collecting pirate memorabilia. I'm especially interested in anything to do with Zaken, the legendary scourge of the high seas. It is said that he was once Zaken's boatswain, and when Zaken's ship was anchored at Innadril Harbor, he made off with a few Treasure Chests and stashed them somewhere on Alligator Island. But, the exact location of the Treasure Chests hasn't been discovered yet... Show him the Pirate's Treasure Map.
[30890-03.htm] Trader Espen: Oh Oh?! Could it be...? Is that really Muska's Map? Where did you find it? Let me buy the Map from you! It won't do you any good anyway. Why should you keep it? I'll pay you 1000 adena for it! Sell the Map. "I don't want to sell it."
[30890-04.htm] Trader Espen: Do you mean it? Are you sure you won't regret your decision? Here... Here is 1000 adena. Ha! Finally, I have Muska's treasure Map! This is truly the chance of a lifetime. At last, Lady Luck smiled on me. I can give up my job as a trader and just enjoy being filthy rich! Let me see... where would the treasure be...? First I must decipher the pirates' jargon... Hmm? What are you still doing here? Go away! This Map is mine! You're an adventurer, so go and have one!
[30890-05.htm] Trader Espen: Humph! I guess you're not as stupid as you look... Well, although it's only a part of it, it will lead you to the treasure of the great pirate Zaken... I know that you don't want to give up the Map so easily. Hey, listen! Wouldn't you like to know what kind of treasure is hidden out there? Just the sight of that Map makes my heart pound like a drum! How about this? I'll decipher and interpret the Map for you, then you go and find the treasure. In exchange for my services, all I want is the treasure Map. I'd like to keep it as a souvenir. What do you think? "I accept your offer."
[30890-06.htm] Trader Espen: Hey you... Do you or don't you have the treasure Map? You must have heard the rumor that I'm a great pirate aficionado. So, are you trying to rip me off? Get lost!
[30890-07.htm] Trader Espen: Heh Heh Heh... Ah, yes, good decision. You won't regret your decision... Before I begin, let me tell you a story about the pirate Zaken and his traitorous boatswain, Muska. Listen carefully, as this information will be quite helpful to you in the future. "I'm listening."
[30890-07a.htm] Trader Espen: This Map that you discovered on Alligator Island... Doesn't it make your heart pound just looking at it? Ah, you want me to decipher it? Very well... But before I dicipher the Map... first I must tell you the story of boatswain Muska, who betrayed Zaken, the great pirate. If you're going to search for Zaken's treasure, you should listen to the story first... Listen to the story.
[30890-08.htm] Trader Espen: At one time Muska was a faithful underling of Zaken. But, when Zaken's ship was anchored here in Heine, he fell in love with Fatima, a woman from Abella. Fatima seduced Muska and convinced him to betray his captain and steal the treasure. Blinded by love, Muska violated the cardinal rule of pirates by betraying his captain and fled with the captain's treasure! To escape his pursuers, he hid himself on Alligator Island and secreted the treasure away there. To remember the location of the treasure, he drew a Map. It is the Map you are now holding in your hand. Continue to listen to the story.
[30890-09.htm] Trader Espen: Unfortunately, Muska made a bad choice when he fell in love with Fatima. Her heart concealed dark tendencies... While her lover was risking his life stealing treasure, she had already found herself a lover in Heine, and was plotting to betray Muska... When Muska returned to her after hiding the treasure somewhere, Fatima gave him poison and he died. Continue to listen to the story.
[30890-10.htm] Trader Espen: Muska was a hardened pirate as well, who greatly distrusted people... and Fatima was no exception. The treasure Map found on Muska's corpse was written in code, and no one could decipher it. When Zaken's ship ran aground on Devil's Isle and its captain and all of his crew were all killed, it seemed the Map would never be decoded. Fatima, enraged by this turn of events, demanded her new lover go to Devil's Isle immediately and find the treasure for her at any cost. Fatima's unfortunate lover was a mere tailor by trade and soon went missing, along with Muska's treasure Map... It was widely believed that the Map was lost for good, and now you show up with it! Continue to listen to the story.
[30890-11.htm] Trader Espen: You should thank your lucky stars for running into me. Why? Because I'm the only person in the world who can decipher this Map. I recently purchased Zaken's journal from some adventurers who had been exploring on Devil's Isle. It contained a detailed description of the method of decoding the pirates' jargon. Although Zaken was a seemingly fearless pirate who dominated all the great oceans, he was an unexpectedly cautious individual. He wrote a very detailed explanation of the code in his journal, as though he was afraid of forgetting how to decipher it... Now, I've told you everything I know. Come on, show me the Map. Let's find out where the treasure is hidden! These are the coordinates on the Map. Let me see... 12 feathers of parrot... 50 glasses of rum... the coordinates are... Oh, it's right there! It is the northern part of Alligator Beach! Ha ha! It's not far from here. I will mark it on your Map. Phew... all my life I have followed the legend of Zaken... And now my fate is just to interpret the Map for someone else... What a disappointment! Well, all I can do is ask you to be a brave treasure hunter... Now, get going! Find the finale of the legend... Ah! One last piece of advice... To open a Treasure Chest you must first obtain a Key of Thief!
[30890-12.htm] Trader Espen: Welcome back, brave hunter! What?! You haven't found the treasure yet? Didn't I mark the coordinates on the Map for you? Take a closer look at your Map! If you go to the coordinates I marked, you will definitely find the treasure...!
[31148-01.htm] Pirate's Treasure Chest: I found a locked Treasure Chest! Open it.
[31148-02.htm] Pirate's Treasure Chest: The key worked, what shall I find inside?
[31148-03.htm] Pirate's Treasure Chest: To open it you must obtain a Key of Thief.
Исходник условий и наград (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.Q00383_TreasureHunt;
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;
public class Q00383_TreasureHunt extends Quest
{
// NPCs
private static final int ESPEN = 30890;
private static final int PIRATE_CHEST = 31148;
// Items
private static final int PIRATE_TREASURE_MAP = 5915;
private static final int THIEF_KEY = 1661;
public Q00383_TreasureHunt()
{
super(383, "Searching for Treasure");
addStartNpc(ESPEN);
addTalkId(ESPEN, PIRATE_CHEST);
}
@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 "30890-04.htm":
{
// Sell the map.
if (hasQuestItems(player, PIRATE_TREASURE_MAP))
{
takeItems(player, PIRATE_TREASURE_MAP, 1);
giveAdena(player, 1000, true);
}
else
{
htmltext = "30890-06.htm";
}
break;
}
case "30890-07.htm":
{
// Listen the story.
if (hasQuestItems(player, PIRATE_TREASURE_MAP))
{
st.startQuest();
}
else
{
htmltext = "30890-06.htm";
}
break;
}
case "30890-11.htm":
{
// Decipher the map.
if (hasQuestItems(player, PIRATE_TREASURE_MAP))
{
st.setCond(2, true);
takeItems(player, PIRATE_TREASURE_MAP, 1);
}
else
{
htmltext = "30890-06.htm";
}
break;
}
case "31148-02.htm":
{
if (hasQuestItems(player, THIEF_KEY))
{
takeItems(player, THIEF_KEY, 1);
// Adena reward.
int i1 = 0;
int i0 = getRandom(100);
if (i0 < 5)
{
giveItems(player, 2450, 1);
}
else if (i0 < 6)
{
giveItems(player, 2451, 1);
}
else if (i0 < 18)
{
giveItems(player, 956, 1);
}
else if (i0 < 28)
{
giveItems(player, 952, 1);
}
else
{
i1 += 500;
}
i0 = getRandom(1000);
if (i0 < 25)
{
giveItems(player, 4481, 1);
}
else if (i0 < 50)
{
giveItems(player, 4482, 1);
}
else if (i0 < 75)
{
giveItems(player, 4483, 1);
}
else if (i0 < 100)
{
giveItems(player, 4484, 1);
}
else if (i0 < 125)
{
giveItems(player, 4485, 1);
}
else if (i0 < 150)
{
giveItems(player, 4486, 1);
}
else if (i0 < 175)
{
giveItems(player, 4487, 1);
}
else if (i0 < 200)
{
giveItems(player, 4488, 1);
}
else if (i0 < 225)
{
giveItems(player, 4489, 1);
}
else if (i0 < 250)
{
giveItems(player, 4490, 1);
}
else if (i0 < 275)
{
giveItems(player, 4491, 1);
}
else if (i0 < 300)
{
giveItems(player, 4492, 1);
}
else
{
i1 += 300;
}
i0 = getRandom(100);
if (i0 < 4)
{
giveItems(player, 1337, 1);
}
else if (i0 < 8)
{
giveItems(player, 1338, 2);
}
else if (i0 < 12)
{
giveItems(player, 1339, 2);
}
else if (i0 < 16)
{
giveItems(player, 3447, 2);
}
else if (i0 < 20)
{
giveItems(player, 3450, 1);
}
else if (i0 < 25)
{
giveItems(player, 3453, 1);
}
else if (i0 < 27)
{
giveItems(player, 3456, 1);
}
else
{
i1 += 500;
}
i0 = getRandom(100);
if (i0 < 20)
{
giveItems(player, 4408, 1);
}
else if (i0 < 40)
{
giveItems(player, 4409, 1);
}
else if (i0 < 60)
{
giveItems(player, 4418, 1);
}
else if (i0 < 80)
{
giveItems(player, 4419, 1);
}
else
{
i1 += 500;
}
giveAdena(player, i1, true);
st.exitQuest(true, true);
}
else
{
htmltext = "31148-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:
{
htmltext = ((player.getLevel() < 42) || !hasQuestItems(player, PIRATE_TREASURE_MAP)) ? "30890-01.htm" : "30890-02.htm";
break;
}
case State.STARTED:
{
final int cond = st.getCond();
switch (npc.getId())
{
case ESPEN:
{
if (cond == 1)
{
htmltext = "30890-07a.htm";
}
else
{
htmltext = "30890-12.htm";
}
break;
}
case PIRATE_CHEST:
{
if (cond == 2)
{
htmltext = "31148-01.htm";
}
break;
}
}
break;
}
}
return htmltext;
}
}