Bring Wolf Pelts
- ID
- 258
- Название
- Bring Wolf Pelts
- start_npcs_json
- [30001]
- npc_ids_json
- []
- constants_json
- {"WOLF_PELT":702,"COTTON_SHIRT":390,"LEATHER_PANTS":29,"LEATHER_SHIRT":22,"SHORT_LEATHER_GLOVES":1119,"TUNIC":426}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00258_BringWolfPelts/Q00258_BringWolfPelts.java
NPC квеста
Записей нет.
Условия уровней: выражения из Java
htmltext = (player.getLevel() < 3) ? "30001-01.htm" : "30001-02.htm";
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, COTTON_SHIRT, 1); giveItems(player, LEATHER_PANTS, 1); giveItems(player, LEATHER_SHIRT, 1); giveItems(player, SHORT_LEATHER_GLOVES, 1); giveItems(player, TUNIC, 1); giveItems(player, WOLF_PELT, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30001-01.htm] Trader Lector: I am a trader now, but I used to be a leather craftsman. Even now, I buy materials every now and then to make leather clothing, gloves, cloaks, and boots. May I ask you later to find me materials if I need them? (This quest may only be undertaken by a character of level 3 and above.)
[30001-02.htm] Trader Lector: I am a trader now, but I used to be a leather craftsman. In my youth, I served under Duke Van Daek. During the wars with Elmore, I made hundreds of suits of leather armor in just ten days for the duke's archers to wear. Even after retiring from the army, I buy materials from time to time and practice making leather armor so that my skills will not become rusty. A few days ago Governor Windawood personally paid me a visit, saying that the newly formed militia needs armor, and placed an order for fifty suits of leather armor. It is no problem for me to make that amount of armor by myself, but I am worried because I am short on materials. I need quite a few Wolf Pelts. Can I ask you to get them for me? Say you will help
[30001-03.htm] Trader Lector: Hunt wolves and bring me their pelts. Bring me forty of the pelts and, in return, I will give you a piece of equipment that is useful to you. There is little time left if I am to finish the fifty leather armors that the governor has ordered by this week. So please hurry.
[30001-05.htm] Trader Lector: So you haven't gotten all of the wolf pelts yet. I know it is difficult, but please gather forty pelts and bring them back to me. In return, I will give you a piece of equipment that will be quite useful to you.
[30001-06.htm] Trader Lector: Oh, I see you've brought me forty wolf pelts. Well done! As promised, I will give you a defense armor that will be useful to you. It has been made by the Dwarven craftsmen of Giran, and is guaranteed to be of the highest quality.
Исходник условий и наград (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.Q00258_BringWolfPelts;
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 Q00258_BringWolfPelts extends Quest
{
// Item
private static final int WOLF_PELT = 702;
// Rewards
private static final int COTTON_SHIRT = 390;
private static final int LEATHER_PANTS = 29;
private static final int LEATHER_SHIRT = 22;
private static final int SHORT_LEATHER_GLOVES = 1119;
private static final int TUNIC = 426;
public Q00258_BringWolfPelts()
{
super(258, "Bring Wolf Pelts");
registerQuestItems(WOLF_PELT);
addStartNpc(30001); // Lector
addTalkId(30001);
addKillId(20120, 20442); // Wolf, Elder Wolf
}
@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("30001-03.htm"))
{
st.startQuest();
}
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() < 3) ? "30001-01.htm" : "30001-02.htm";
break;
}
case State.STARTED:
{
if (getQuestItemsCount(player, WOLF_PELT) < 40)
{
htmltext = "30001-05.htm";
}
else
{
takeItems(player, WOLF_PELT, -1);
final int randomNumber = getRandom(16);
// Reward is based on a random number (1D16).
if (randomNumber == 0)
{
giveItems(player, COTTON_SHIRT, 1);
}
else if (randomNumber < 6)
{
giveItems(player, LEATHER_PANTS, 1);
}
else if (randomNumber < 9)
{
giveItems(player, LEATHER_SHIRT, 1);
}
else if (randomNumber < 13)
{
giveItems(player, SHORT_LEATHER_GLOVES, 1);
}
else
{
giveItems(player, TUNIC, 1);
}
htmltext = "30001-06.htm";
if (randomNumber == 0)
{
playSound(player, QuestSound.ITEMSOUND_QUEST_JACKPOT);
}
else
{
playSound(player, QuestSound.ITEMSOUND_QUEST_FINISH);
}
st.exitQuest(true);
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player player, boolean isPet)
{
final QuestState st = getQuestState(player, false);
if ((st == null) || !st.isCond(1))
{
return;
}
giveItems(player, WOLF_PELT, 1);
if (getQuestItemsCount(player, WOLF_PELT) >= 40)
{
st.setCond(2, true);
}
else
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
}