An Ice Merchant's Dream
- ID
- 648
- Название
- An Ice Merchant's Dream
- start_npcs_json
- [32020,32023]
- npc_ids_json
- [32020,32023]
- constants_json
- {"RAFFORTY":32020,"ICE_SHELF":32023,"SILVER_HEMOCYTE":8057,"SILVER_ICE_CRYSTAL":8077,"BLACK_ICE_CRYSTAL":8078}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00648_AnIceMerchantsDream/Q00648_AnIceMerchantsDream.java
NPC квеста
Условия уровней: выражения из Java
if (player.getLevel() < 53)
Выдача предметов, адены и опыта: выражения из Java
rewardItems(player, reward[2], 1); rewardItems(player, 8078, 1); giveAdena(player, (val * 300) + (exCond * 1200), true); giveItems(partyMember, SILVER_ICE_CRYSTAL, 1); giveItems(partyMember, SILVER_HEMOCYTE, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[32020-01.htm] Rafforty: I don't know how you got here, but you shouldn't be wandering around by yourself. You must leave this place before the Ice Queen finds out you're here! (Characters must have achieved at least level 53 to undertake this quest.)
[32020-02.htm] Rafforty: Welcome! You've helped to give our Zinnia Guild a long-term goal. Honestly though, we could use some more help. Could you help us again? We'll give you reward, but I'm not sure if you'll be satisfied with it... "I'll help you."
[32020-03.htm] Rafforty: Why are you here? Well, since you're here anyway, why you take a little rest and then help us out? "What can I do for you?"
[32020-04.htm] Rafforty: Most of the creatures around here have a Black Ice Crystal in their bodies. It seems that the crystals make them very violent. We need to study those crystals. Bring me some and you'll be well-rewarded! Of course, you probably will not always get Black Ice Crystals, sometimes you will get Silver Ice Crystals. If you bring me these Silver Ice Crystals, I will also reward you. "How do I get the Black Ice Crystals?"
[32020-05.htm] Rafforty: Thank you for your help. According to the information we acquired from you, to turn Freya back into her old self, we have to collect Ice Crystals that are spread all over this territory and which are grown within creatures' bodies. They usually have a silver color, and that's why they're called Silver Ice Crystals. If you can bring these back to me, I will reward you for your work. And, I know it will be even more difficult to get Black Ice Crystals, but if you bring those back to me, I will reward you even more. Oh, yes! And if you ever find any Silver Hemocytes, don't throw them away. "How do I get a Black Ice Crystal?" "Where do I use Silver Hemocytes?"
[32020-06.htm] Rafforty: A Black Ice Crystal can be made out of a Silver Ice Crystal by using the tools on the shelf. Generally, Artisans do this, so it is not easy, but if you can make it into a Black Ice Crystal, then I'll reward you well. Failure will bring you nothing, so be careful.
[32020-06a.htm] Rafforty: You may get a Black Ice Crystal by processing a Silver Ice Crystal using the tools on the shelf. It won't be easy, as it is a job usually done only by professional craftsmen. If you succeed in creating the Black Ice Crystal, I'll pay you very well for it. Be careful, however, because failure won't pay you a thing. If you were to stay around for a while we might could work out a deal...
[32020-07.htm] Rafforty: The blood of the creatures that have been under the control of the Black Ice Crystal for a long time gradually changes to silver. The Ice Queen's pets are enticed by this blood, and we must have it for our plan as well. Please collect the Silver Hemocytes for us. The monsters in the Frozen Labyrinth that have Silver Hemocytes are the Massive Maze Bandersnatch, Panthera, Pronghorn, Ice Tarantula, Frost Tarantula, Frost Buffalo, Lost Buffalo, Ursus, Lost Yeti and Frost Yeti. "Tell me more about your plan."
[32020-07a.htm] Rafforty: Our Zinnia Guild's goal is to restore Queen Freya to her original self. First, we must eliminate the Ice Fairy Sirra, who is a major obstacle between us and our Queen. If you want to join us, speak with Steward at the Ice Queen's Castle. And don't forget to bring your friends with you! When you go, take 10 Silver Hemocytes to him.
[32020-08.htm] Rafforty: Haven't you left yet? I'm telling you again, most of the creatures around here have a Black Ice Crystal in their bodies! It seems like those crystals make them very violent. We need to study those crystals. Bring me some and you'll be well-rewarded! Of course, you probably won't get a Black Ice Crystal at first. You'll get a Silver Ice Crystal. Bring me some Silver Ice Crystals and I'll reward you for them, too. "How do I get the Black Ice Crystals?"
[32020-09.htm] Rafforty: It's dangerous outside, so please be careful! I'm telling you, most of the creatures living in the Frozen Labyrinth have a Silver Ice Crystal in their bodies. Bring me these crystals and you'll be well-rewarded. Black Ice Crystals are quite rare, but if you find one and bring it back to me, you'll be rewarded even more! Oh, by the way... If you ever get any Silver Hemocytes, don't throw them away. "How do I get Black Ice Crystals?" "Where do I use Silver Hemocytes?"
[32020-10.htm] Rafforty: You look like you did something big outside. I can feel the unique energy of Ice Crystals coming from you! You have them, don't you? Don't you want to give it to me? I'll pay you well! "What's the reward?" "I'll give it to you later." "I want to quit doing this."
[32020-11.htm] Rafforty: Any success? You look exhausted, my friend! I can feel the unique energy of Ice Crystals coming from you! Can I have them? I'll pay you well! "What's the reward?" "I'll give it to you later." "I quit." "How do I use Silver Hemocytes?"
[32020-12.htm] Rafforty: Well, of course, I'll pay you with adena! You can use it anywhere! Are you willing to hand over the Black Ice Crystals to me? "Here they are." "I'll give them to you later."
[32020-13.htm] Rafforty: Yes. Then will you give the Ice Crystals to me? Ah! How would you like be paid? Do you want Adena for it all? Or perhaps you'd like to trade for some other items? I must warn you, however... If you want good materials, you'd better have lots of Ice Crystals. "Give me money." "Show me the items." "I changed my mind. I'll do it later."
[32020-14.htm] Rafforty: Here's your reward. This should compensate you for your hard work. If you find any more Ice Crystals, come back to see me again.
[32020-15.htm] Rafforty: Here, I've filled this full of adena for you. If you find more Ice Crystals, please bring them to me.
[32020-15a.htm] Rafforty: Where are the crystals you were talking about? I won't reward you for nothing!
[32020-16a.htm] Rafforty: Where did you put the crystals? There's nothing in this pouch.
[32020-18.htm] Rafforty: OK. If you change your mind, please come back and find me.
[32020-19.htm] Rafforty: Very well. You know how important those crystals are to us, so I'll wait. Please, be careful!
[32020-20.htm] Rafforty: OK. I won't do any more business with you. Good-bye.
[32020-21.htm] Rafforty: Are you really quitting? Is something bothering you? "I just need a rest."
[32020-22.htm] Rafforty: Very well! You've been a lot of help to us! Come back anytime!
[32023-01.htm] Ice Shelf: What am I to do with this? What is important about it?
[32023-02.htm] Ice Shelf: The ice shards on the shelf indicate that it was used quite recently. Hm... are these shards from the Silver Ice Crystal that Rafforty spoke of?
[32023-03.htm] Ice Shelf: It is obvious from looking at this shelf that someone has been using it as a workbench. I have the Silver Ice Crystal... I wonder if it would be reasonable to work on it here? Here are some old tools on the shelf I can use. Start working
[32023-04.htm] Ice Shelf: Now to apply the finishing touches. What implement should I use? Use an engraving knife. Use a file.
[32023-05.htm] Ice Shelf: To work, then. Which tool should I use to begin? Trim with a chisel. Trim with a scraper.
[32023-06.htm] Now it emits black light. Success is very near! There is but one step left to finish the project. Use the engraving knife. Use the file.
[32023-07.htm] Ice Shelf: I have completed the Black Ice Crystal, and its black light appears to absorb all the light around it. Success!
[32023-08.htm] Ice Shelf: Alas! It was all for nothing because of a minor mistake. The tools were not as easy to use as I had thought. It was all a waste of crystals.
Исходник условий и наград (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.Q00648_AnIceMerchantsDream;
import java.util.HashMap;
import java.util.Map;
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 quests.Q00115_TheOtherSideOfTruth.Q00115_TheOtherSideOfTruth;
public class Q00648_AnIceMerchantsDream extends Quest
{
// NPCs
private static final int RAFFORTY = 32020;
private static final int ICE_SHELF = 32023;
// Items
private static final int SILVER_HEMOCYTE = 8057;
private static final int SILVER_ICE_CRYSTAL = 8077;
private static final int BLACK_ICE_CRYSTAL = 8078;
// Rewards
private static final Map<String, int[]> REWARDS = new HashMap<>();
static
{
// @formatter:off
REWARDS.put("a", new int[]{SILVER_ICE_CRYSTAL, 23, 1894}); // Crafted Leather
REWARDS.put("b", new int[]{SILVER_ICE_CRYSTAL, 6, 1881}); // Coarse Bone Powder
REWARDS.put("c", new int[]{SILVER_ICE_CRYSTAL, 8, 1880}); // Steel
REWARDS.put("d", new int[]{BLACK_ICE_CRYSTAL, 1800, 729}); // Scroll: Enchant Weapon (A-Grade)
REWARDS.put("e", new int[]{BLACK_ICE_CRYSTAL, 240, 730}); // Scroll: Enchant Armor (A-Grade)
REWARDS.put("f", new int[]{BLACK_ICE_CRYSTAL, 500, 947}); // Scroll: Enchant Weapon (B-Grade)
REWARDS.put("g", new int[]{BLACK_ICE_CRYSTAL, 80, 948}); // Scroll: Enchant Armor (B-Grade)
}
// Drop chances
private static final Map<Integer, int[]> CHANCES = new HashMap<>();
static
{
CHANCES.put(22080, new int[]{285000, 48000}); // Massive Maze Bandersnatch
CHANCES.put(22081, new int[]{443000, 0}); // Lost Watcher
CHANCES.put(22082, new int[]{510000, 0}); // Baby Panthera
CHANCES.put(22083, new int[]{510000, 0}); // Elder Lost Watcher
CHANCES.put(22084, new int[]{477000, 49000}); // Panthera
CHANCES.put(22085, new int[]{420000, 43000}); // Lost Gargoyle
CHANCES.put(22086, new int[]{490000, 50000}); // Lost Gargoyle Youngling
CHANCES.put(22087, new int[]{787000, 81000}); // Pronghorn Spirit
CHANCES.put(22088, new int[]{480000, 49000}); // Pronghorn
CHANCES.put(22089, new int[]{550000, 56000}); // Ice Tarantula
CHANCES.put(22090, new int[]{570000, 58000}); // Frost Tarantula
CHANCES.put(22092, new int[]{623000, 0}); // Frost Iron Golem
CHANCES.put(22093, new int[]{910000, 93000}); // Lost Buffalo
CHANCES.put(22094, new int[]{553000, 57000}); // Frost Buffalo
CHANCES.put(22096, new int[]{593000, 61000}); // Ursus
CHANCES.put(22097, new int[]{693000, 71000}); // Lost Yeti
CHANCES.put(22098, new int[]{717000, 74000}); // Frost Yeti
// @formatter:on
}
public Q00648_AnIceMerchantsDream()
{
super(648, "An Ice Merchant's Dream");
addStartNpc(RAFFORTY, ICE_SHELF);
addTalkId(RAFFORTY, ICE_SHELF);
addKillId(CHANCES.keySet());
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
String htmltext = event;
QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
switch (event)
{
case "32020-04.htm":
{
st.startQuest();
break;
}
case "32020-05.htm":
{
st.setState(State.STARTED);
st.setCond(2);
playSound(player, QuestSound.ITEMSOUND_QUEST_ACCEPT);
break;
}
default:
{
int exCond;
int val;
if (!event.equals("32020-14.htm") && !event.equals("32020-15.htm"))
{
if (event.startsWith("32020-17"))
{
int[] reward = REWARDS.get(event.substring(8, 9));
if (getQuestItemsCount(player, reward[0]) >= reward[1])
{
takeItems(player, reward[0], reward[1]);
rewardItems(player, reward[2], 1);
}
else
{
htmltext = "32020-15a.htm";
}
}
else if (!event.equals("32020-20.htm") && !event.equals("32020-22.htm"))
{
if (event.equals("32023-05.htm"))
{
if (st.getInt("exCond") == 0)
{
st.set("exCond", String.valueOf((getRandom(4) + 1) * 10));
}
}
else if (event.startsWith("32023-06-"))
{
exCond = st.getInt("exCond");
if (exCond > 0)
{
htmltext = "32023-06.htm";
st.set("exCond", String.valueOf(exCond + (event.endsWith("chisel") ? 1 : 2)));
playSound(player, QuestSound.ITEMSOUND_BROKEN_KEY);
takeItems(player, 8077, 1);
}
}
else if (event.startsWith("32023-07-"))
{
exCond = st.getInt("exCond");
if (exCond > 0)
{
val = exCond / 10;
if (val == ((exCond - (val * 10)) + (event.endsWith("knife") ? 0 : 2)))
{
htmltext = "32023-07.htm";
playSound(player, QuestSound.ITEMSOUND_ENCHANT_SUCCESS);
rewardItems(player, 8078, 1);
}
else
{
htmltext = "32023-08.htm";
playSound(player, QuestSound.ITEMSOUND_ENCHANT_FAILED);
}
st.set("exCond", "0");
}
}
}
else
{
st.exitQuest(true, true);
}
}
else
{
exCond = getQuestItemsCount(player, 8078);
val = getQuestItemsCount(player, 8077);
if ((val + exCond) > 0)
{
takeItems(player, 8078, -1);
takeItems(player, 8077, -1);
giveAdena(player, (val * 300) + (exCond * 1200), true);
}
else
{
htmltext = "32020-16a.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 (npc.getId() == RAFFORTY)
{
if (player.getLevel() < 53)
{
htmltext = "32020-01.htm";
}
else
{
QuestState st2 = player.getQuestState(Q00115_TheOtherSideOfTruth.class.getSimpleName());
htmltext = ((st2 != null) && st2.isCompleted()) ? "32020-02.htm" : "32020-03.htm";
}
}
else
{
htmltext = "32023-01.htm";
}
break;
}
case State.STARTED:
{
if (npc.getId() == RAFFORTY)
{
final boolean hasItem = (hasAtLeastOneQuestItem(player, SILVER_ICE_CRYSTAL, BLACK_ICE_CRYSTAL));
QuestState st2 = player.getQuestState(Q00115_TheOtherSideOfTruth.class.getSimpleName());
if ((st2 != null) && st2.isCompleted())
{
htmltext = (hasItem) ? "32020-11.htm" : "32020-09.htm";
if (st.isCond(1))
{
st.setCond(2, true);
}
}
else
{
htmltext = (hasItem) ? "32020-10.htm" : "32020-08.htm";
}
}
else
{
if (!hasQuestItems(player, SILVER_ICE_CRYSTAL))
{
htmltext = "32023-02.htm";
}
else
{
if ((st.getInt("exCond") % 10) == 0)
{
htmltext = "32023-03.htm";
st.set("exCond", "0");
}
else
{
htmltext = "32023-04.htm";
}
}
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player player, boolean isPet)
{
final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
if ((st == null) || !st.isStarted())
{
return;
}
final Player partyMember = st.getPlayer();
final int[] chance = CHANCES.get(npc.getId());
if (getRandom(1000000) < chance[0])
{
giveItems(partyMember, SILVER_ICE_CRYSTAL, 1);
playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
if (st.isCond(2) && (chance[1] > 0) && (getRandom(1000000) < chance[1]))
{
giveItems(partyMember, SILVER_HEMOCYTE, 1);
playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
}