Warehouse Keeper's Ambition
- ID
- 357
- Название
- Warehouse Keeper's Ambition
- start_npcs_json
- [30686]
- npc_ids_json
- [20594,20595,20596,20597]
- constants_json
- {"FOREST_RUNNER":20594,"FLINE_ELDER":20595,"LIELE_ELDER":20596,"VALLEY_TREANT_ELDER":20597,"JADE_CRYSTAL":5867}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00357_WarehouseKeepersAmbition/Q00357_WarehouseKeepersAmbition.java
NPC квеста
| ID | Название | Старт квеста | Уровень |
|---|---|---|---|
| 20594 | Forest Runner | Нет | 50 |
| 20595 | Fline Elder | Нет | 51 |
| 20596 | Liele Elder | Нет | 52 |
| 20597 | Valley Treant Elder | Нет | 53 |
Условия уровней: выражения из Java
htmltext = (player.getLevel() < 47) ? "30686-0a.htm" : "30686-0.htm";
Выдача предметов, адены и опыта: выражения из Java
giveAdena(player, reward, true);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30686-0.htm] Warehouse Freightman Silva: Are you an adventurer? Could I speak with you privately? I want to tell you about a new layaway service that the Iron Gate Guild is offering... This is a great chance for you to get in on the ground floor! "Tell me more."
[30686-0a.htm] Warehouse Freightman Silva: Are you an adventurer? Could I speak with you privately? I want to tell you about a new layaway service that the Iron Gate Guild is offering... This is a great chance for you to get in on the ground floor! (This quest may only be undertaken by a character of level 47 and above.)
[30686-1.htm] Warehouse Freightman Silva: ... Keep your voice down! If old man Sorint overhears us, I could lose my job! Where to start? Never mind all that stuff about the layaway service... I just wanted to get you alone! I need to hire an adventurer... Someone to be my partner in a business I'm starting... "What sort of business?"
[30686-2.htm] Warehouse Freightman Silva: Ah, yes, I suppose you would want to know that, wouldn't you? No harm in that. The truth is ... The Warehouse Chief over there just announced that he'll be retiring next year. He's narrowed the choice for his successor down to old man Sorint and myself. He says that whichever of us generates the most profit in the coming year will fill his position. This is my big chance! No more working for the man! I've been in the warehouse business since I was 10 years old! I deserve this position! "Hey, I think he heard you."
[30686-3.htm] Warehouse Freightman Silva: Oops, oh yeah, him... Ah! Mr. Sorint. It's nothing! Yes! Nothing unusual going here, sir! Just helping this customer. Damn that idiotic old fool... Anyway, this should be easy for you. Just bring me some Jade Crystals. They are all the rage this year among the noblewomen of Aden! The more of them you bring me, the greater your reward shall be. Bring me 100 or more at once and I'll give you a bonus. Do we have a deal? You'll find Jade Crystals in the Enchanted Valley. You may have some trouble with the forest runners, the fline elders, the liele elders and the valley treant elders. Are you taking notes? Ah, one more thing. Enchanted Valley is too dangerous a place to walk around by yourself. So, bring me a few of your friends who can keep a secret. Not too many though... Once we have enough people, you can go there with them. It's too dangerous to go there alone.
[30686-4.htm] Warehouse Freightman Silva: Wait here a moment, please... Mr. Sorint! Would you like a cup of tea? Do you need anything? Very well! Please come this way... That doddering old fool! I'm surprised he hasn't fallen off a cliff by now... Have you brought me any Jade Crystals? What's with the empty hands? Have you been to the Enchanted Valley and met any forest runners, fline elders, liele elders or valley treant elders? "On my way, sir!" "I quit."
[30686-5.htm] Warehouse Freightman Silva: You do remember about the bonus for bringing me 100 or more crystals, don't you? Keep up the good work! Pardon me... Yes? What's that, Mr. Sorint? What did you say? Oh, you want a massage? Very well, sir, but there shall be no happy ending!
[30686-6.htm] Warehouse Freightman Silva: Wait here a moment, please... Mr. Sorint! Would you like a cup of tea? Do you need anything? Very well! Please come this way... ... That doddering old fool! I'm surprised he hasn't fallen off a cliff by now... Have you brought me any Jade Crystals? Do you remember my offer? Bring me 100 or more of them and you get a bonus! "Here are your crystals." "I'll go for more crystals." "I quit."
[30686-7.htm] Warehouse Freightman Silva: Ah, yes, very high-quality crystals. Great job! You shall have your reward. Here you go! It's a fair price, no? "I will bring you more Jade Crystals." "I quit."
[30686-8.htm] Warehouse Freightman Silva: How can you quit such a great job? I don't understand! Oh, well, you guys are a dime a dozen... Dammit! Old man Sorint is calling me again. I wonder what it is this time... If you change your mind, come back and see me! Okay? Mr. Sorint, did you call me? I'm coming!
Исходник условий и наград (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.Q00357_WarehouseKeepersAmbition;
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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
public class Q00357_WarehouseKeepersAmbition extends Quest
{
// Monsters
private static final int FOREST_RUNNER = 20594;
private static final int FLINE_ELDER = 20595;
private static final int LIELE_ELDER = 20596;
private static final int VALLEY_TREANT_ELDER = 20597;
// Item
private static final int JADE_CRYSTAL = 5867;
// Drop chances
private static final Map<Integer, Double> DROP_DATA = new HashMap<>();
static
{
DROP_DATA.put(FOREST_RUNNER, 0.577); // Forest Runner
DROP_DATA.put(FLINE_ELDER, 0.6); // Fline Elder
DROP_DATA.put(LIELE_ELDER, 0.638); // Liele Elder
DROP_DATA.put(VALLEY_TREANT_ELDER, 0.062); // Valley Treant Elder
}
public Q00357_WarehouseKeepersAmbition()
{
super(357, "Warehouse Keeper's Ambition");
registerQuestItems(JADE_CRYSTAL);
addStartNpc(30686); // Silva
addTalkId(30686);
addKillId(FOREST_RUNNER, FLINE_ELDER, LIELE_ELDER, VALLEY_TREANT_ELDER);
}
@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 "30686-2.htm":
{
st.startQuest();
break;
}
case "30686-7.htm":
{
final int count = getQuestItemsCount(player, JADE_CRYSTAL);
if (count == 0)
{
htmltext = "30686-4.htm";
}
else
{
int reward = (count * 425) + 3500;
if (count >= 100)
{
reward += 7400;
}
takeItems(player, JADE_CRYSTAL, -1);
giveAdena(player, reward, true);
}
break;
}
case "30686-8.htm":
{
st.exitQuest(true, true);
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() < 47) ? "30686-0a.htm" : "30686-0.htm";
break;
}
case State.STARTED:
{
htmltext = (!hasQuestItems(player, JADE_CRYSTAL)) ? "30686-4.htm" : "30686-6.htm";
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
if (qs != null)
{
giveItemRandomly(qs.getPlayer(), npc, JADE_CRYSTAL, 1, 0, DROP_DATA.get(npc.getId()), true);
}
}
}