Quests rework.

This commit is contained in:
MobiusDev
2016-02-11 21:39:33 +00:00
parent b2cafd8e2e
commit 09976b0ce6
173 changed files with 6416 additions and 4720 deletions

View File

@@ -54,16 +54,16 @@ public class Q10291_FireDragonDestroyer extends Quest
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState st = getQuestState(player, false);
if (st == null)
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return getNoQuestMsg(player);
}
if (event.equals("31540-05.htm"))
{
st.startQuest();
st.giveItems(POOR_NECKLACE, 1);
qs.startQuest();
giveItems(player, POOR_NECKLACE, 1);
}
return event;
@@ -81,13 +81,13 @@ public class Q10291_FireDragonDestroyer extends Quest
{
if (Util.checkIfInRange(8000, npc, p, false))
{
final QuestState st = getQuestState(p, false);
final QuestState qs = getQuestState(p, false);
if ((st != null) && st.isCond(1) && st.hasQuestItems(POOR_NECKLACE))
if ((qs != null) && qs.isCond(1) && hasQuestItems(player, POOR_NECKLACE))
{
st.takeItems(POOR_NECKLACE, -1);
st.giveItems(VALOR_NECKLACE, 1);
st.setCond(2, true);
takeItems(player, POOR_NECKLACE, -1);
giveItems(player, VALOR_NECKLACE, 1);
qs.setCond(2, true);
}
}
return true;
@@ -109,14 +109,14 @@ public class Q10291_FireDragonDestroyer extends Quest
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = getQuestState(player, true);
final QuestState qs = getQuestState(player, true);
if (st == null)
if (qs == null)
{
return htmltext;
}
switch (st.getState())
switch (qs.getState())
{
case State.CREATED:
{
@@ -126,31 +126,31 @@ public class Q10291_FireDragonDestroyer extends Quest
}
else
{
htmltext = st.hasQuestItems(FLOATING_STONE) ? "31540-02.htm" : "31540-01.htm";
htmltext = hasQuestItems(player, FLOATING_STONE) ? "31540-02.htm" : "31540-01.htm";
}
break;
}
case State.STARTED:
{
if (st.isCond(1))
if (qs.isCond(1))
{
if (st.hasQuestItems(POOR_NECKLACE))
if (hasQuestItems(player, POOR_NECKLACE))
{
htmltext = "31540-06.html";
}
else
{
st.giveItems(POOR_NECKLACE, 1);
giveItems(player, POOR_NECKLACE, 1);
htmltext = "31540-07.html";
}
}
else if (st.isCond(2) && st.hasQuestItems(VALOR_NECKLACE))
else if (qs.isCond(2) && hasQuestItems(player, VALOR_NECKLACE))
{
htmltext = "31540-08.html";
st.giveAdena(126549, true);
st.addExpAndSp(717291, 77397);
st.giveItems(VALAKAS_SLAYER_CIRCLET, 1);
st.exitQuest(false, true);
giveAdena(player, 126549, true);
addExpAndSp(player, 717291, 77397);
giveItems(player, VALAKAS_SLAYER_CIRCLET, 1);
qs.exitQuest(false, true);
}
break;
}