Browse Source

BETA: Quest '''Cure for Fever''' (151)

malyelfik 12 years ago
parent
commit
27947efd74

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts.cfg

@@ -398,7 +398,7 @@ quests/Q00143_FallenAngelRequestOfDusk/Q00143_FallenAngelRequestOfDusk.java
 quests/Q00146_TheZeroHour/Q00146_TheZeroHour.java
 quests/Q00147_PathtoBecominganEliteMercenary/Q00147_PathtoBecominganEliteMercenary.java
 quests/Q00148_PathtoBecominganExaltedMercenary/Q00148_PathtoBecominganExaltedMercenary.java
-quests/151_SaveMySister1/__init__.py
+quests/Q00151_CureForFever/Q00151_CureForFever.java
 quests/152_ShardsOfGolem/__init__.py
 quests/Q00153_DeliverGoods/Q00153_DeliverGoods.java
 quests/154_SacrificeToSea/__init__.py

+ 0 - 5
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30050-02.htm

@@ -1,5 +0,0 @@
-<html><body>Elias:<br>
-I am Elias, one of the teachers from the Einhovant's School of Wizardry. My students and I went to the forest to the north of the island on a field trip recently, but some of my students have fallen ill with a<font color="LEVEL"> strange fever</font>. It has been more than a week since they became ill, but we have yet to find a treatment. I am going crazy with worry that my students may die.<br>
-Thankfully, the Priest Yohanes has created a medicine, but he is running short on ingredients. Will you not go and gather the<font color="LEVEL"> necessary ingredients</font> for my dying students? Your aid is urgently needed. We need the<font color="LEVEL"> poison sac of the giant spider</font>, and I am asking you because I trust that someone of your abilities can easily manage this task.<br>
-<a action="bypass -h Quest 151_SaveMySister1 30050-03.htm">Say you will help</a>
-</body></html>

+ 0 - 5
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30050-03.htm

@@ -1,5 +0,0 @@
-<html><body>Elias:<br>
-I can't thank you enough for your help. The<font color="LEVEL"> giant spiders</font> abound in the northern parts of the island, so hunt them and bring back their poison sacs.<br>
-Once you have obtained the poison sacs, go to<font color="LEVEL"> Priest Yohanes</font>. He will create a fever medicine from the poison sacs. Bring the medicine back to me.<br>
-If one of my students should die, how will I ever face their parents? I just want to run far, far away. I implore you, please find those poison sacs. My students are dying!
-</body></html>

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30050-04.htm

@@ -1,4 +0,0 @@
-<html><body>Elias:<br>
-You haven't left yet? Hurry and fetch the poison sacs. My students are dying, and it pains my heart to see those youngsters in feverish hallucinations.<br>
-Go to the northern end of Talking Island to hunt the<font color="LEVEL"> giant spiders</font> and obtain their poison sacs. Take the poison sacs to Priest Yohanes, and he will make a fever medicine for you. Bring the medicine back to me. I beg you to help, my dear friend!
-</body></html>

+ 0 - 3
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30050-05.htm

@@ -1,3 +0,0 @@
-<html><body>Elias:<br>
-Ah ... You have managed to obtain the poison sacs! I sincerely thank you!! Go at once and take them to<font color="LEVEL"> Priest Yohanes</font> at the Temple of Einhasad. He will create a fever medicine for you. When he has finished creating the medicine, bring it back to me.
-</body></html>

+ 0 - 89
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/__init__.py

@@ -1,89 +0,0 @@
-# Made by Mr. - Version 0.3 by DrLecter
-import sys
-from com.l2jserver.gameserver.model.quest import State
-from com.l2jserver.gameserver.model.quest import QuestState
-from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
-
-qn = "151_SaveMySister1"
-
-POISON_SAC = 703
-FEVER_MEDICINE = 704
-
-class Quest (JQuest) :
-
- def __init__(self,id,name,descr):
-     JQuest.__init__(self,id,name,descr)
-     self.questItemIds = [FEVER_MEDICINE, POISON_SAC]
-
- def onAdvEvent (self,event,npc, player) :
-    htmltext = event
-    st = player.getQuestState(qn)
-    if not st : return
-    if event == "30050-03.htm" :
-      st.set("cond","1")
-      st.setState(State.STARTED)
-      st.playSound("ItemSound.quest_accept")
-    return htmltext
-
- def onTalk (self,npc,player):
-   htmltext = Quest.getNoQuestMsg(player)
-   st = player.getQuestState(qn)
-   if not st : return htmltext
-
-   npcId = npc.getNpcId()
-   id = st.getState()
-   cond = st.getInt("cond")
-   sac = st.getQuestItemsCount(POISON_SAC)
-   med = st.getQuestItemsCount(FEVER_MEDICINE)
-   if npcId == 30050 :
-      if id == State.COMPLETED :
-        htmltext = Quest.getAlreadyCompletedMsg(player)
-      elif cond == 0 :
-        if player.getLevel() >= 15 :
-          htmltext = "30050-02.htm"
-        else:
-          htmltext = "30050-01.htm"
-          st.exitQuest(1)
-      elif cond == 1 and (sac == med == 0) :
-        htmltext = "30050-04.htm"
-      elif cond == 2 or sac :
-        htmltext = "30050-05.htm"
-      elif cond == 3 or med :
-        st.giveItems(102,1)
-        st.addExpAndSp(13106,613)
-        st.takeItems(FEVER_MEDICINE,1)
-        htmltext = "30050-06.htm"
-        st.unset("cond")
-        st.exitQuest(False)
-        st.playSound("ItemSound.quest_finish")
-   elif npcId == 30032 :
-      if cond == 2 or sac :
-        st.set("cond","3")
-        st.takeItems(POISON_SAC,1)
-        st.giveItems(FEVER_MEDICINE,1)
-        htmltext = "30032-01.htm"
-      elif cond == 3 or med :
-        htmltext = "30032-02.htm"
-   return htmltext
-
- def onKill(self,npc,player,isPet):
-   st = player.getQuestState(qn)
-   if not st : return
-   if st.getState() != State.STARTED: return
-   
-   if not st.getQuestItemsCount(POISON_SAC) and st.getInt("cond") == 1 :
-      if self.getRandom(5) == 0 :
-         st.giveItems(POISON_SAC,1)
-         st.playSound("ItemSound.quest_middle")
-         st.set("cond","2")
-   return
-
-QUEST       = Quest(151,qn,"Save My Sister1")
-
-QUEST.addStartNpc(30050)
-QUEST.addTalkId(30050)
-
-QUEST.addTalkId(30032)
-
-for mob in [20103,20106,20108] :
-   QUEST.addKillId(mob)

+ 2 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30032-01.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30032-01.html

@@ -1,4 +1,4 @@
 <html><body>Priest Yohanes:<br>
-Elias has sent you, I presume. I will hurry and make the<font color="LEVEL"> medicine</font> from the poison sacs you have brought me. Anyhow, Elias must be devastated at the turn of events that has happened to his students. But I think that Elias is largely responsible... taking the students to such a dangerous place and all. We Priests always request the protection of the guards when venturing outside the village, but they say that Elias refused the help of the guards, relying only on his magic. So his students pay for his folly... tsk tsk...<br>
-Here, the medicine is finished. Take this and hurry back to<font color="LEVEL"> Elias.</font> I'd like to see the students from the magic school run through the streets again. I pray that the blessings of Einhasad be with them. With this medicine and the powers of Einhasad, I am sure that the students will recover soon. May the blessings of Einhasad be with you.
+Elias has sent you, I presume. I will hurry and make the <font color="LEVEL">medicine</font> from the Poison Sacs you have brought me. Anyhow, Elias must be devastated at the turn of events that has happened to his students. But I think that Elias is largely responsible... taking the students to such a dangerous place and all. We Priests always request the protection of the guards when venturing outside the village, but they say that Elias refused the help of the guards, relying only on his magic. So his students pay for his folly... tsk tsk...<br>
+Here, the medicine is finished. Take this and hurry back to <font color="LEVEL">Elias.</font> I'd like to see the students from the magic school run through the streets again. I pray that the blessings of Einhasad be with them. With this medicine and the powers of Einhasad, I am sure that the students will recover soon. May the blessings of Einhasad be with you.
 </body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30032-02.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30032-02.html


+ 2 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30050-01.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30050-01.htm

@@ -1,5 +1,5 @@
 <html><body>Elias:<br>
-I'm Elias, one of the teachers from the Einhovant School of Wizardry. My students and I went to the forest to the north of the island on a field trip recently, but some of my students have fallen ill with a<font color="LEVEL"> strange fever</font>. It has been more than a week since they became ill, but we have yet to find a treatment. I am going crazy with worry that my students may die.<br>
-Thankfully, the Priest Yohanes is researching methods to create a<font color="LEVEL"> medicine</font> for them. He is very learned in herb lore, and has treated many illnesses. I trust that he will soon find a way to create a medicine for them. But I worry that because there are so many students that need to be treated, he may not have enough ingredients. If we are short on ingredients, I will ask for your aid, so please help us if it is necessary.<br>
+I'm Elias, one of the teachers from the Einhovant School of Wizardry. My students and I went to the forest to the north of the island on a field trip recently, but some of my students have fallen ill with a <font color="LEVEL">strange fever</font>. It has been more than a week since they became ill, but we have yet to find a treatment. I am going crazy with worry that my students may die.<br>
+Thankfully, the Priest Yohanes is researching methods to create a <font color="LEVEL">medicine</font> for them. He is very learned in herb lore, and has treated many illnesses. I trust that he will soon find a way to create a medicine for them. But I worry that because there are so many students that need to be treated, he may not have enough ingredients. If we are short on ingredients, I will ask for your aid, so please help us if it is necessary.<br>
 (Quest for characters level 15 and above.)
 </body></html>

+ 5 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30050-02.htm

@@ -0,0 +1,5 @@
+<html><body>Elias:<br>
+I am Elias, a teacher at Einhovant's School of Magic. Some time ago, my students and I went on a field trip to the northern part of the island to collect herbs needed for class, and many of the students fainted after catching a <font color="LEVEL">strange fever.</font> It has been a week since they fell ill, and we still have not found a cure. I'm worried out of my mind when I think that my students might die from this.<br>
+Thankfully, Priest Yohanes thinks he might have a remedy. Won't you find me some <font color="LEVEL">medicine ingredients</font> for my young students who are dying? I truly need your help. That ingredient is the <font color="LEVEL">Giant Spider's Poison Sac,</font> but I believe that someone like you can easily obtain it.<br>
+<a action="bypass -h Quest Q00151_CureForFever 30050-03.htm">Say that you'll help.</a>
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30050-03.htm

@@ -0,0 +1,5 @@
+<html><body>Elias:<br>
+I can't thank you enough for your help. The <font color="LEVEL">giant spiders</font> abound in the northern parts of the island, so hunt them and bring back their Poison Sacs.<br>
+Once you have obtained the Poison Sacs, go to <font color="LEVEL">Priest Yohanes</font>. He will create a Fever Medicine from the Poison Sacs. Bring the medicine back to me.<br>
+If one of my students should die, how will I ever face their parents? I just want to run far, far away. I implore you, please find those Poison Sacs. My students are dying!
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30050-04.html

@@ -0,0 +1,4 @@
+<html><body>Elias:<br>
+Are you still here? Please hury and bring back the poison sac. My students are dying, and watching those youngsters muttering in their delirium just breaks my heart.<br>
+Go to the northern part of Talking Island, kill the <font color="LEVEL">Giant Spider,</font> and bring back its poison sac. If you bring the poison sac to Priest Yohanes, he will make the medicine for the fever, so bring that to me. Please make haste!
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30050-05.html

@@ -0,0 +1,3 @@
+<html><body>Elias:<br>
+Ahh... You have obtained a poison sac. Thank you! Please hurry and take it to <font color="LEVEL">Priest Yohanes</font> who is at the Temple of Einhasad. He will make the medicine for you. When he is done, you just have to bring the medicine back to me.
+</body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/151_SaveMySister1/30050-06.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/30050-06.html

@@ -1,4 +1,4 @@
 <html><body>Elias:<br>
-So this is the fever medicine. Ahh ... I am deeply grateful to you. Because you have so willingly helped others, we can save the lives of my students. May the angels bless you. I must hurry and send this medicine off to the school.<br>
+So this is the Fever Medicine. Ahh ... I am deeply grateful to you. Because you have so willingly helped others, we can save the lives of my students. May the angels bless you. I must hurry and send this medicine off to the school.<br>
 But first ... Please accept this. This is a token of appreciation for having saved my students.
 </body></html>

+ 150 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00151_CureForFever/Q00151_CureForFever.java

@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2004-2013 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack 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.
+ * 
+ * L2J DataPack 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.Q00151_CureForFever;
+
+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;
+import com.l2jserver.gameserver.network.NpcStringId;
+
+/**
+ * Cure for Fever (151)
+ * @author malyelfik
+ */
+public class Q00151_CureForFever extends Quest
+{
+	// NPCs
+	private static final int ELLIAS = 30050;
+	private static final int YOHANES = 30032;
+	// Monsters
+	private static final int[] MOBS =
+	{
+		20103, // Giant Spider
+		20106, // Talon Spider
+		20108, // Blade Spider
+	};
+	// Items
+	private static final int ROUND_SHIELD = 102;
+	private static final int POISON_SAC = 703;
+	private static final int FEVER_MEDICINE = 704;
+	// Misc
+	private static final int MIN_LEVEL = 15;
+	private static final int CHANCE = 0;
+	
+	private Q00151_CureForFever(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		addStartNpc(ELLIAS);
+		addTalkId(ELLIAS, YOHANES);
+		addKillId(MOBS);
+		registerQuestItems(POISON_SAC, FEVER_MEDICINE);
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final QuestState st = player.getQuestState(getName());
+		if ((st != null) && event.equalsIgnoreCase("30050-03.htm"))
+		{
+			st.startQuest();
+			return event;
+		}
+		return null;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
+	{
+		final QuestState st = killer.getQuestState(getName());
+		if ((st != null) && st.isCond(1) && (getRandom(5) == CHANCE))
+		{
+			st.giveItems(POISON_SAC, 1);
+			st.setCond(2, true);
+		}
+		return super.onKill(npc, killer, isSummon);
+	}
+	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = getNoQuestMsg(player);
+		final QuestState st = player.getQuestState(getName());
+		if (st == null)
+		{
+			return htmltext;
+		}
+		
+		switch (npc.getNpcId())
+		{
+			case ELLIAS:
+				switch (st.getState())
+				{
+					case State.CREATED:
+						htmltext = (player.getLevel() >= MIN_LEVEL) ? "30050-02.htm" : "30050-01.htm";
+						break;
+					case State.STARTED:
+						if (st.isCond(3) && st.hasQuestItems(FEVER_MEDICINE))
+						{
+							st.giveItems(ROUND_SHIELD, 1);
+							st.addExpAndSp(13106, 613);
+							st.exitQuest(false, true);
+							showOnScreenMsg(player, NpcStringId.LAST_DUTY_COMPLETE_N_GO_FIND_THE_NEWBIE_GUIDE, 2, 5000); // TODO: Newbie Guide
+							htmltext = "30050-06.html";
+						}
+						else if (st.isCond(2) && st.hasQuestItems(POISON_SAC))
+						{
+							htmltext = "30050-05.html";
+						}
+						else
+						{
+							htmltext = "30050-04.html";
+						}
+						break;
+					case State.COMPLETED:
+						htmltext = getAlreadyCompletedMsg(player);
+						break;
+				}
+				break;
+			case YOHANES:
+				if (st.isStarted())
+				{
+					if (st.isCond(2) && st.hasQuestItems(POISON_SAC))
+					{
+						st.setCond(3, true);
+						st.takeItems(POISON_SAC, -1);
+						st.giveItems(FEVER_MEDICINE, 1);
+						htmltext = "30032-01.html";
+					}
+					else if (st.isCond(3) && st.hasQuestItems(FEVER_MEDICINE))
+					{
+						htmltext = "30032-02.html";
+					}
+				}
+				break;
+		}
+		return htmltext;
+	}
+	
+	public static void main(String[] args)
+	{
+		new Q00151_CureForFever(151, Q00151_CureForFever.class.getSimpleName(), "Cure for Fever");
+	}
+}

+ 3 - 1
L2J_DataPack_BETA/dist/sql/game/updates/20130318update.sql

@@ -1 +1,3 @@
-UPDATE character_quests SET name='Q00164_BloodFiend' WHERE name='164_BloodFiend';UPDATE character_quests SET name='Q00165_ShilensHunt' WHERE name='165_WildHunt';
+UPDATE character_quests SET name='Q00151_CureForFever' WHERE name='151_SaveMySister1';
+UPDATE character_quests SET name='Q00164_BloodFiend' WHERE name='164_BloodFiend';
+UPDATE character_quests SET name='Q00165_ShilensHunt' WHERE name='165_WildHunt';