Skip to content
Snippets Groups Projects
Commit 434756ef authored by ivantotov's avatar ivantotov
Browse files

Quest: Lost Dream (190) update.

Reviewed by: @Zoey76
parent e756b2c6
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ import com.l2jserver.gameserver.model.actor.L2Npc; ...@@ -24,7 +24,6 @@ import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
/** /**
* Lost Dream (190) * Lost Dream (190)
...@@ -33,10 +32,10 @@ import com.l2jserver.gameserver.model.quest.State; ...@@ -33,10 +32,10 @@ import com.l2jserver.gameserver.model.quest.State;
public final class Q00190_LostDream extends Quest public final class Q00190_LostDream extends Quest
{ {
// NPCs // NPCs
private static final int JURIS = 30113;
private static final int HEAD_BLACKSMITH_KUSTO = 30512; private static final int HEAD_BLACKSMITH_KUSTO = 30512;
private static final int RESEARCHER_LORAIN = 30673;
private static final int MAESTRO_NIKOLA = 30621; private static final int MAESTRO_NIKOLA = 30621;
private static final int JURIS = 30113; private static final int RESEARCHER_LORAIN = 30673;
// Misc // Misc
private static final int MIN_LEVEL = 42; private static final int MIN_LEVEL = 42;
private static final int MAX_LEVEL_FOR_EXP_SP = 48; private static final int MAX_LEVEL_FOR_EXP_SP = 48;
...@@ -51,43 +50,49 @@ public final class Q00190_LostDream extends Quest ...@@ -51,43 +50,49 @@ public final class Q00190_LostDream extends Quest
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
final QuestState st = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null)
if (st == null)
{ {
return null; return null;
} }
String htmltext = null; String htmltext = null;
switch (event) switch (event)
{ {
case "30113-02.html": case "30512-03.htm":
{ {
htmltext = event; if (qs.isCreated())
{
qs.startQuest();
qs.setMemoState(1);
htmltext = event;
}
break; break;
} }
case "30512-03.htm": case "30512-06.html":
{ {
if (st.isCreated()) if (qs.isMemoState(2))
{ {
st.startQuest(); qs.setMemoState(3);
qs.setCond(3, true);
htmltext = event; htmltext = event;
} }
break; break;
} }
case "30512-06.html": case "30113-02.html":
{ {
if (st.isCond(2)) if (qs.isMemoState(1))
{ {
st.setCond(3, true);
htmltext = event; htmltext = event;
} }
break; break;
} }
case "30113-03.html": case "30113-03.html":
{ {
if (st.isCond(1)) if (qs.isMemoState(1))
{ {
st.setCond(2, true); qs.setMemoState(2);
qs.setCond(2, true);
htmltext = event; htmltext = event;
} }
break; break;
...@@ -99,122 +104,97 @@ public final class Q00190_LostDream extends Quest ...@@ -99,122 +104,97 @@ public final class Q00190_LostDream extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
final QuestState qs = getQuestState(player, true);
final int memoState = qs.getMemoState();
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
final QuestState st = getQuestState(player, true); if (qs.isCreated())
if (st == null)
{ {
return htmltext; if (npc.getId() == HEAD_BLACKSMITH_KUSTO)
{
final QuestState q187 = player.getQuestState(Q00187_NikolasHeart.class.getSimpleName());
if ((q187 != null) && q187.isCompleted())
{
htmltext = (player.getLevel() >= MIN_LEVEL) ? "30512-01.htm" : "30512-02.htm";
}
}
} }
else if (qs.isStarted())
switch (npc.getId())
{ {
case HEAD_BLACKSMITH_KUSTO: switch (npc.getId())
{ {
switch (st.getState()) case HEAD_BLACKSMITH_KUSTO:
{ {
case State.CREATED: if (memoState == 1)
{ {
final QuestState qs = player.getQuestState(Q00187_NikolasHeart.class.getSimpleName()); htmltext = "30512-04.html";
if ((qs != null) && qs.isCompleted())
{
htmltext = (player.getLevel() >= MIN_LEVEL) ? "30512-01.htm" : "30512-02.htm";
}
break;
} }
case State.STARTED: else if (memoState == 2)
{ {
switch (st.getCond()) htmltext = "30512-05.html";
{ }
case 1: else if ((memoState >= 3) && (memoState <= 4))
{ {
htmltext = "30512-04.html"; htmltext = "30512-07.html";
break;
}
case 2:
{
htmltext = "30512-05.html";
break;
}
case 3:
case 4:
{
htmltext = "30512-07.html";
break;
}
case 5:
{
htmltext = "30512-08.html";
st.giveAdena(109427, true);
if (player.getLevel() < MAX_LEVEL_FOR_EXP_SP)
{
st.addExpAndSp(309467, 20614);
}
st.exitQuest(false, true);
break;
}
}
break;
} }
case State.COMPLETED: else if (memoState == 5)
{ {
htmltext = getAlreadyCompletedMsg(player); htmltext = "30512-08.html";
break; giveAdena(player, 109427, true);
if (player.getLevel() < MAX_LEVEL_FOR_EXP_SP)
{
addExpAndSp(player, 309467, 20614);
}
qs.exitQuest(false, true);
} }
break;
} }
break; case JURIS:
}
case RESEARCHER_LORAIN:
{
switch (st.getCond())
{ {
case 3: if (memoState == 1)
{ {
st.setCond(4, true); htmltext = "30113-01.html";
htmltext = "30673-01.html";
break;
} }
case 4: else if (memoState == 2)
{ {
htmltext = "30673-02.html"; htmltext = "30113-04.html";
break;
} }
break;
} }
break; case MAESTRO_NIKOLA:
}
case MAESTRO_NIKOLA:
{
switch (st.getCond())
{ {
case 4: if (memoState == 4)
{ {
st.setCond(5, true); qs.setMemoState(5);
qs.setCond(5, true);
htmltext = "30621-01.html"; htmltext = "30621-01.html";
break;
} }
case 5: else if (memoState == 5)
{ {
htmltext = "30621-02.html"; htmltext = "30621-02.html";
break;
} }
break;
} }
break; case RESEARCHER_LORAIN:
}
case JURIS:
{
switch (st.getCond())
{ {
case 1: if (memoState == 3)
{ {
htmltext = "30113-01.html"; qs.setMemoState(4);
break; qs.setCond(4, true);
htmltext = "30673-01.html";
} }
case 2: else if (memoState == 4)
{ {
htmltext = "30113-04.html"; htmltext = "30673-02.html";
break;
} }
break;
} }
break; }
}
else if (qs.isCompleted())
{
if (npc.getId() == HEAD_BLACKSMITH_KUSTO)
{
htmltext = getAlreadyCompletedMsg(player);
} }
} }
return htmltext; return htmltext;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment