|
@@ -26,16 +26,17 @@ import com.l2jserver.gameserver.model.quest.State;
|
|
|
|
|
|
/**
|
|
|
* Bring Up With Love (20)
|
|
|
- * @author Gnacik, jurchiks
|
|
|
+ * @author Adry_85
|
|
|
*/
|
|
|
public class Q00020_BringUpWithLove extends Quest
|
|
|
{
|
|
|
// NPC
|
|
|
private static final int TUNATUN = 31537;
|
|
|
// Items
|
|
|
- private static final int BEAST_HANDLERS_WHIP = 15473;
|
|
|
private static final int WATER_CRYSTAL = 9553;
|
|
|
- private static final int JEWEL_OF_INNOCENCE = 7185;
|
|
|
+ private static final int INNOCENCE_JEWEL = 15533;
|
|
|
+ // Misc
|
|
|
+ private static final int MIN_LEVEL = 82;
|
|
|
|
|
|
public Q00020_BringUpWithLove(int questId, String name, String descr)
|
|
|
{
|
|
@@ -51,60 +52,52 @@ public class Q00020_BringUpWithLove extends Quest
|
|
|
final QuestState st = player.getQuestState(getName());
|
|
|
if (st == null)
|
|
|
{
|
|
|
- return getNoQuestMsg(player);
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
- String htmltext = event;
|
|
|
-
|
|
|
+ String htmltext = null;
|
|
|
switch (event)
|
|
|
{
|
|
|
- case "31537-12.htm":
|
|
|
- st.startQuest();
|
|
|
- break;
|
|
|
+ case "31537-02.htm":
|
|
|
case "31537-03.htm":
|
|
|
- if (hasQuestItems(player, BEAST_HANDLERS_WHIP))
|
|
|
- {
|
|
|
- return "31537-03a.htm";
|
|
|
- }
|
|
|
- giveItems(player, BEAST_HANDLERS_WHIP, 1);
|
|
|
+ case "31537-04.htm":
|
|
|
+ case "31537-05.htm":
|
|
|
+ case "31537-06.htm":
|
|
|
+ case "31537-07.htm":
|
|
|
+ case "31537-08.htm":
|
|
|
+ case "31537-09.htm":
|
|
|
+ case "31537-10.htm":
|
|
|
+ case "31537-12.htm":
|
|
|
+ {
|
|
|
+ htmltext = event;
|
|
|
break;
|
|
|
-
|
|
|
- case "31537-15.htm":
|
|
|
- takeItems(player, JEWEL_OF_INNOCENCE, -1);
|
|
|
- giveItems(player, WATER_CRYSTAL, 1);
|
|
|
- st.exitQuest(false, true);
|
|
|
+ }
|
|
|
+ case "31537-11.html":
|
|
|
+ {
|
|
|
+ st.startQuest();
|
|
|
+ htmltext = event;
|
|
|
break;
|
|
|
- case "31537-21.html":
|
|
|
- if (player.getLevel() < 82)
|
|
|
+ }
|
|
|
+ case "31537-16.html":
|
|
|
+ {
|
|
|
+ if (st.isCond(2) && st.hasQuestItems(INNOCENCE_JEWEL))
|
|
|
{
|
|
|
- return "31537-23.html";
|
|
|
+ st.giveItems(WATER_CRYSTAL, 1);
|
|
|
+ st.takeItems(INNOCENCE_JEWEL, -1);
|
|
|
+ st.exitQuest(false, true);
|
|
|
+ htmltext = event;
|
|
|
}
|
|
|
- if (hasQuestItems(player, BEAST_HANDLERS_WHIP))
|
|
|
- {
|
|
|
- return "31537-22.html";
|
|
|
- }
|
|
|
- giveItems(player, BEAST_HANDLERS_WHIP, 1);
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
return htmltext;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
|
|
- {
|
|
|
- QuestState st = player.getQuestState(getName());
|
|
|
- if (st == null)
|
|
|
- {
|
|
|
- newQuestState(player);
|
|
|
- }
|
|
|
- return "31537-20.html";
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public String onTalk(L2Npc npc, L2PcInstance player)
|
|
|
{
|
|
|
- String htmltext = getNoQuestMsg(player);
|
|
|
QuestState st = player.getQuestState(getName());
|
|
|
+ String htmltext = getNoQuestMsg(player);
|
|
|
if (st == null)
|
|
|
{
|
|
|
return htmltext;
|
|
@@ -112,18 +105,27 @@ public class Q00020_BringUpWithLove extends Quest
|
|
|
|
|
|
switch (st.getState())
|
|
|
{
|
|
|
+ case State.COMPLETED:
|
|
|
+ {
|
|
|
+ htmltext = getAlreadyCompletedMsg(player);
|
|
|
+ break;
|
|
|
+ }
|
|
|
case State.CREATED:
|
|
|
- htmltext = ((player.getLevel() < 82) ? "31537-00.htm" : "31537-01.htm");
|
|
|
+ htmltext = player.getLevel() >= MIN_LEVEL ? "31537-01.htm" : "31537-13.html";
|
|
|
break;
|
|
|
case State.STARTED:
|
|
|
switch (st.getCond())
|
|
|
{
|
|
|
case 1:
|
|
|
- htmltext = "31537-13.htm";
|
|
|
+ {
|
|
|
+ htmltext = "31537-14.html";
|
|
|
break;
|
|
|
+ }
|
|
|
case 2:
|
|
|
- htmltext = "31537-14.htm";
|
|
|
+ {
|
|
|
+ htmltext = (!st.hasQuestItems(INNOCENCE_JEWEL)) ? "31537-14.html" : "31537-15.html";
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -133,9 +135,9 @@ public class Q00020_BringUpWithLove extends Quest
|
|
|
public static void checkJewelOfInnocence(L2PcInstance player)
|
|
|
{
|
|
|
final QuestState st = player.getQuestState(Q00020_BringUpWithLove.class.getSimpleName());
|
|
|
- if ((st != null) && st.isCond(1) && !st.hasQuestItems(JEWEL_OF_INNOCENCE) && (getRandom(20) == 0))
|
|
|
+ if ((st != null) && st.isCond(1) && !st.hasQuestItems(INNOCENCE_JEWEL) && (getRandom(100) < 5))
|
|
|
{
|
|
|
- st.giveItems(JEWEL_OF_INNOCENCE, 1);
|
|
|
+ st.giveItems(INNOCENCE_JEWEL, 1);
|
|
|
st.setCond(2, true);
|
|
|
}
|
|
|
}
|