Skip to content
Snippets Groups Projects
Commit f0c85d34 authored by Zoey76's avatar Zoey76
Browse files

BETA: Quests in Java by nonom:

	* Secret Meeting With Ketra Orcs (11)
	* Secret Meeting With Varka Silenos (12)
	* Parcel Delivery (13)
	* Whereabouts of the Archaeologist (14)
	* Sweet Whispers (15)
	* The Coming Darkness (16)
	* Light and Darkness (17)
	* Meeting with the Golden Ram (18)
	* Added SQL update queries for quests that changed it's name.

Review, tests and fixes by me, thanks jurchiks for suggestions for improvements and typos.
parent 18babf72
No related branches found
No related tags found
No related merge requests found
Showing
with 163 additions and 4 deletions
<html><body>Saint Altar:<br>
At last, the third Altar of Saints! No less forbidding than the first two!<br>
<a action="bypass -h Quest 17_LightAndDarkness 31510-02.htm">Sprinkle the Blood of Saint.</a>
<a action="bypass -h Quest 17_LightAndDarkness 31510-02.html">Sprinkle the Blood of Saint.</a>
</body></html>
\ No newline at end of file
<html><body>Saint Altar:<br>
The last Altar of Saints looks the same as the others. You're starting to feel more comfortable. That could be good or bad!<br>
<a action="bypass -h Quest 17_LightAndDarkness 31511-02.htm">Sprinkle the Blood of Saint.</a>
<a action="bypass -h Quest 17_LightAndDarkness 31511-02.html">Sprinkle the Blood of Saint.</a>
</body></html>
\ No newline at end of file
<html><body>Hierarch:<br>
Before I tell you, I need to ask you something. How strong is your faith in the work that we do? Are you certain that you can persevere no matter what happens while carrying out this mission?<br>
<a action="bypass -h Quest 17_LightAndDarkness 31517-02.htm">"I will persevere"</a>
<a action="bypass -h Quest 17_LightAndDarkness 31517-02.html">"I will persevere"</a>
</body></html>
\ No newline at end of file
<html><body>Heirarch:<br>
Quest Sweet Whispers need to be finished first.
</body></html>
\ No newline at end of file
/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package quests.Q17_LightAndDarkness;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
/**
* Light And Darkness (17).<br>
* Original jython script by disKret, Skeleton & DrLecter.
* @author nonom
*/
public class Q17_LightAndDarkness extends Quest
{
private static final String qn = "17_LightAndDarkness";
// NPCs
private static final int HIERARCH = 31517;
private static final int SAINT_ALTAR_1 = 31508;
private static final int SAINT_ALTAR_2 = 31509;
private static final int SAINT_ALTAR_3 = 31510;
private static final int SAINT_ALTAR_4 = 31511;
// Items
private static final int BLOOD_OF_SAINT = 7168;
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
final QuestState st = player.getQuestState(qn);
if (st == null)
{
return htmltext;
}
switch (event)
{
case "31517-02.html":
if (player.getLevel() >= 61)
{
st.giveItems(BLOOD_OF_SAINT, 4);
st.set("cond", "1");
st.setState(State.STARTED);
st.playSound("ItemSound.quest_accept");
}
else
{
htmltext = "31517-02a.html";
}
break;
case "31508-02.html":
case "31509-02.html":
case "31510-02.html":
case "31511-02.html":
final int cond = st.getInt("cond");
final int npcId = Integer.parseInt(event.replace("-02.html", ""));
if ((cond == (npcId - 31507)) && st.hasQuestItems(BLOOD_OF_SAINT))
{
htmltext = npcId + "-01.html";
st.takeItems(BLOOD_OF_SAINT, 1);
st.set("cond", String.valueOf(cond + 1));
st.playSound("ItemSound.quest_middle");
}
break;
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = player.getQuestState(qn);
if (st == null)
{
return htmltext;
}
switch (st.getState())
{
case State.COMPLETED:
htmltext = getAlreadyCompletedMsg(player);
break;
case State.CREATED:
final QuestState st2 = player.getQuestState("15_SweetWhispers");
htmltext = ((st2 != null) && (st2.isCompleted())) ? "31517-00.htm" : "31517-06.html";
break;
case State.STARTED:
final long blood = st.getQuestItemsCount(BLOOD_OF_SAINT);
final int cond = st.getInt("cond");
final int npcId = npc.getNpcId();
switch (npcId)
{
case HIERARCH:
if (cond < 5)
{
htmltext = (blood >= 5) ? "31517-05.html" : "31517-04.html";
}
else
{
htmltext = "31517-03.html";
st.addExpAndSp(697040, 54887);
st.playSound("ItemSound.quest_finish");
st.exitQuest(false);
}
break;
case SAINT_ALTAR_1:
case SAINT_ALTAR_2:
case SAINT_ALTAR_3:
case SAINT_ALTAR_4:
if ((npcId - 31507) == cond)
{
htmltext = npcId + ((blood > 0) ? "-00.html" : "-02.html");
}
else if (cond > (npcId - 31507))
{
htmltext = npcId + "-03.html";
}
break;
}
break;
}
return htmltext;
}
public Q17_LightAndDarkness(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(HIERARCH);
addTalkId(HIERARCH, SAINT_ALTAR_1, SAINT_ALTAR_2, SAINT_ALTAR_3, SAINT_ALTAR_4);
}
public static void main(String[] args)
{
new Q17_LightAndDarkness(17, qn, "Light and Darkness");
}
}
<html><body>Warehouse Chief Donal:<br>
The Golden Ram Mercenary Force are in the the Swamp of Screams fighting stakatos. I'm looking for someone to deliver war supplies, are you interested?<br>
<a action="bypass -h Quest 18_MeetingWithTheGoldenRam 31314-03.htm">Say you are interested.</a>
<a action="bypass -h Quest 18_MeetingWithTheGoldenRam 31314-03.html">Say you are interested.</a>
</body></html>
\ No newline at end of file
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