Delicious Top Choice Meat
- ID
- 631
- Название
- Delicious Top Choice Meat
- start_npcs_json
- [31537]
- npc_ids_json
- [31537]
- constants_json
- {"TUNATUN":31537,"TOP_QUALITY_MEAT":7546}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00631_DeliciousTopChoiceMeat/Q00631_DeliciousTopChoiceMeat.java
NPC квеста
| ID | Название | Старт квеста | Уровень |
|---|---|---|---|
| 31537 | Tunatun | Да | 70 |
Условия уровней: выражения из Java
if (player.getLevel() >= 65)
Выдача предметов, адены и опыта: выражения из Java
rewardItems(player, reward[0], reward[1]); giveItems(partyMember, TOP_QUALITY_MEAT, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[31537-01.htm] Beast Herder Tunatun: The meat of wild beasts is renowned for its succulence! From the clean taste of Kookaburra to the gamy taste of Cougar, and Buffalo, with it's strong, musky taste... Unfortunately, there's no one left to raise and slaughter them... As they mature, they become ever more menacing and ferocious! None of us dare go near them! "I'll do it."
[31537-02.htm] Beast Herder Tunatun: You're very brave! But don't underestimate those creatures! They may look cute now, but the bigger they get, the more powerful they become! Honestly, my friend, I don't think you're up to it... (This quest may only be undertaken by a character of level 65 and above.)
[31537-03.htm] Beast Herder Tunatun: You're very brave! The best meat is obtained after a beast has grown a bit Not too young, nor fully grown... If they've become vicious, their meat will be bitter. You'll get a better feeling for this when you've done it a while... Bring me 120 pieces of meat... I need that much for one shipment. Please bring only the hightest quality meat! It's for Mr. Vladimir! I'm counting on you!
[31537-03a.htm] Beast Herder Tunatun: Bring me 120 pieces of meat. One piece of meat makes a meal for one person. My customer needs 120 pieces of meat per day.
[31537-04.htm] Beast Herder Tunatun: You've brought the meat! Good job! Mr. Vladimir will be very pleased! Thank you! While managing the pastureland, I often get items in lieu of money. As you can imagine, I have a lot of items! Would you be willing to accept an item in lieu of money...? "Sure, no problem."
[31537-05.htm] Beast Herder Tunatun: Go ahead and choose! I have a vast selection, I'm sure you'll find something you like! 15 units of Mold Glue 15 units of Asofe 15 Thons 10 units of Mold Lubricant 10 Enrias 5 units of Mold Hardener
[31537-06.htm] Beast Herder Tunatun: Thanks for your help! If you get a chance, come back and help me again. People always need meat! My customers can't get enough of it!
[31537-07.htm] Beast Herder Tunatun: And here is your reward! Hey, wait! Where did that piece of meat go? It was right here!?
Исходник условий и наград (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.Q00631_DeliciousTopChoiceMeat;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.commons.util.StringUtil;
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;
public class Q00631_DeliciousTopChoiceMeat extends Quest
{
// NPC
private static final int TUNATUN = 31537;
// Item
private static final int TOP_QUALITY_MEAT = 7546;
// Drop chances
private static final Map<Integer, Integer> CHANCES = new HashMap<>();
static
{
CHANCES.put(21460, 601000);
CHANCES.put(21461, 480000);
CHANCES.put(21462, 447000);
CHANCES.put(21463, 808000);
CHANCES.put(21464, 447000);
CHANCES.put(21465, 808000);
CHANCES.put(21466, 447000);
CHANCES.put(21467, 808000);
CHANCES.put(21479, 477000);
CHANCES.put(21480, 863000);
CHANCES.put(21481, 477000);
CHANCES.put(21482, 863000);
CHANCES.put(21483, 477000);
CHANCES.put(21484, 863000);
CHANCES.put(21485, 477000);
CHANCES.put(21486, 863000);
CHANCES.put(21498, 509000);
CHANCES.put(21499, 920000);
CHANCES.put(21500, 509000);
CHANCES.put(21501, 920000);
CHANCES.put(21502, 509000);
CHANCES.put(21503, 920000);
CHANCES.put(21504, 509000);
CHANCES.put(21505, 920000);
}
// Rewards
private static final int[][] REWARDS =
{
// @formatter:off
{4039, 15},
{4043, 15},
{4044, 15},
{4040, 10},
{4042, 10},
{4041, 5}
// @formatter:on
};
public Q00631_DeliciousTopChoiceMeat()
{
super(631, "Delicious Top Choice Meat");
registerQuestItems(TOP_QUALITY_MEAT);
addStartNpc(TUNATUN);
addTalkId(TUNATUN);
addKillId(CHANCES.keySet());
}
@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("31537-03.htm"))
{
if (player.getLevel() >= 65)
{
st.startQuest();
}
else
{
htmltext = "31537-02.htm";
st.exitQuest(true);
}
}
else if (StringUtil.isNumeric(event))
{
if (getQuestItemsCount(player, TOP_QUALITY_MEAT) >= 120)
{
htmltext = "31537-06.htm";
takeItems(player, TOP_QUALITY_MEAT, -1);
final int[] reward = REWARDS[Integer.parseInt(event)];
rewardItems(player, reward[0], reward[1]);
st.exitQuest(true, true);
}
else
{
st.setCond(1);
htmltext = "31537-07.htm";
}
}
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 = "31537-01.htm";
break;
}
case State.STARTED:
{
final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31537-03a.htm";
}
else if (cond == 2)
{
if (getQuestItemsCount(player, TOP_QUALITY_MEAT) >= 120)
{
htmltext = "31537-04.htm";
}
else
{
st.setCond(1);
htmltext = "31537-03a.htm";
}
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player player, boolean isPet)
{
final QuestState qs = getRandomPartyMemberState(player, 1, 3, npc);
if (qs == null)
{
return;
}
final Player partyMember = qs.getPlayer();
final QuestState st = getQuestState(partyMember, false);
if (st == null)
{
return;
}
if (getRandom(1000000) < CHANCES.get(npc.getId()))
{
giveItems(partyMember, TOP_QUALITY_MEAT, 1);
if (getQuestItemsCount(partyMember, TOP_QUALITY_MEAT) < 120)
{
playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
st.setCond(2, true);
}
}
}
}