Pārlūkot izejas kodu

BETA: Quest '''A Dark Twilight''' (626)
Patch by: Citizen
Reviewed by: malyelfik

malyelfik 12 gadi atpakaļ
vecāks
revīzija
61fedfa726

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

@@ -658,7 +658,7 @@ quests/622_DeliveryOfSpecialLiquor/__init__.py
 quests/623_TheFinestFood/__init__.py
 quests/624_TheFinestIngredientsPart1/__init__.py
 quests/625_TheFinestIngredientsPart2/__init__.py
-quests/626_ADarkTwilight/__init__.py
+quests/Q00626_ADarkTwilight/Q00626_ADarkTwilight.java
 quests/627_HeartInSearchOfPower/__init__.py
 quests/628_HuntGoldenRam/__init__.py
 quests/629_CleanUpTheSwampOfScreams/__init__.py

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-3.htm

@@ -1,4 +0,0 @@
-<html><body>Hierarch:<br>
-Here you go! Take your pick! Of course, you must first give me 300 units of Blood of Saint. Just put it over there. Now choose your reward!<br>
-<a action="bypass -h Quest 626_ADarkTwilight 31517-4.htm">Increase Exp and SP</a><br>
-<a action="bypass -h Quest 626_ADarkTwilight 31517-5.htm">Receive adena</a></body></html>

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-5.htm

@@ -1,4 +0,0 @@
-<html><body>Hierarch:<br>
-Good choice! I hope you're satisfied!<br>
-The proofs you brought will be very useful to us. Just wait!
-</body></html>

+ 0 - 95
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/__init__.py

@@ -1,95 +0,0 @@
-# Made by disKret
-import sys
-from com.l2jserver import Config
-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 = "626_ADarkTwilight"
-
-#NPC
-HIERARCH = 31517
-
-#ITEMS
-BLOOD_OF_SAINT = 7169
-
-#REWARDS
-ADENA = 57
-
-class Quest (JQuest) :
-
- def __init__(self,id,name,descr):
-     JQuest.__init__(self,id,name,descr)
-     self.questItemIds = [BLOOD_OF_SAINT]
-
- def onEvent (self,event,st) :
-   htmltext = event
-   count = st.getQuestItemsCount(BLOOD_OF_SAINT)
-   if event == "31517-1.htm" :
-     st.set("cond","1")
-     st.setState(State.STARTED)
-     st.playSound("ItemSound.quest_accept")
-   elif event == "31517-3.htm" :
-     if count < 300 :
-        htmltext = "31517-3a.htm"
-   elif event == "31517-4.htm" :
-     if count < 300 :
-        htmltext = "31517-3a.htm"
-     else :
-        st.addExpAndSp(162773,12500)
-        st.takeItems(BLOOD_OF_SAINT,-1)
-        st.playSound("ItemSound.quest_finish")
-        st.exitQuest(1)
-   elif event == "31517-5.htm" :
-     if count < 300 :
-        htmltext = "31517-3a.htm"
-     else :
-        st.giveItems(ADENA,100000)
-        st.takeItems(BLOOD_OF_SAINT,-1)
-        st.playSound("ItemSound.quest_finish")
-        st.exitQuest(1)
-   return htmltext
-
- def onTalk (self,npc,player):
-   htmltext = Quest.getNoQuestMsg(player)
-   st = player.getQuestState(qn)
-   if st :
-       npcId = npc.getNpcId()
-       id = st.getState()
-       cond = st.getInt("cond")
-       if cond == 0 :
-         if player.getLevel() >= 60 : # and player.getLevel() <= 71
-           htmltext = "31517-0.htm"
-         else:
-           htmltext = "31517-0a.htm"
-           st.exitQuest(1)
-       elif id == State.STARTED :
-           if st.getQuestItemsCount(BLOOD_OF_SAINT) == 300 :
-             htmltext = "31517-2.htm"
-           else :
-             htmltext = "31517-2a.htm"
-   return htmltext
-
- def onKill(self,npc,player,isPet):
-   partyMember = self.getRandomPartyMember(player, 1)
-   if not partyMember : return
-   st = partyMember.getQuestState(qn)
-   if st :
-      if st.getState() == State.STARTED :  
-         count = st.getQuestItemsCount(BLOOD_OF_SAINT)  
-         if st.getInt("cond") == 1 and count < 300 :  
-            st.giveItems(BLOOD_OF_SAINT,1)  
-            if count == 299 :  
-               st.playSound("ItemSound.quest_middle")  
-               st.set("cond","2")  
-            else:  
-               st.playSound("ItemSound.quest_itemget") 
-   return
-
-QUEST       = Quest(626,qn,"A Dark Twilight")
-
-QUEST.addStartNpc(31517)
-QUEST.addTalkId(31517)
-
-for mobs in range(21520,21541):
-  QUEST.addKillId(mobs)

+ 2 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-0a.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-00.htm

@@ -1,4 +1,5 @@
 <html><body>Hierarch:<br>
 We think alike, you and me! Will you join us in our work to make this world a better place? We're making great advances every day, but there are some who are jealous and are trying to interfere with our work...<br>
 They're keeping us from attaining our goal! You know, we really do need help, but you're not yet up to the task! Come back when you've developed your skills further.<br>
-(Only characters of level 62 and above may undertake this quest.)</body></html>
+(Only characters of level 60 and above may undertake this quest.)
+</body></html>

+ 2 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-0.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-01.htm

@@ -1,4 +1,5 @@
 <html><body>Hierarch:<br>
 We think alike, you and me! Will you join us in our work to make this world a better place? We're making great advances every day, but there are some who are jealous and are trying to interfere with our work...<br>
 They're keeping us from attaining our goal! Will you help us?<br>
-<a action="bypass -h Quest 626_ADarkTwilight 31517-1.htm">I'll help you.</a></body></html>
+<a action="bypass -h Quest Q00626_ADarkTwilight 31517-02.htm">I'll help you.</a>
+</body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-1.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-02.htm

@@ -1,4 +1,4 @@
 <html><body>Hierarch:<br>
 Your passionate resolve is breathtaking!<br>
-Your job is deceptively simple! You must merely exterminate those execrable servants of Einhasad that infest this altar. They're called the<font color="LEVEL"> Eye of Splendor, Flash of Splendor, Blade of Splendor, Wisdom of Splendor, Soul of Splendor, Victory of Splendor, Vengeance of Splendor, Shout of Splendor, Seal of Splendor, Crown of Splendor and Wailing of Splendor.</font> Slaughter them all! As proof of their demise, bring back 300 units of<font color="LEVEL"> Blood of Saint</font>, the source of their power.
+Your job is deceptively simple! You must merely exterminate those execrable servants of Einhasad that infest this altar. They're called the <font color="LEVEL">Eye of Splendor, Flash of Splendor, Blade of Splendor, Wisdom of Splendor, Soul of Splendor, Victory of Splendor, Vengeance of Splendor, Shout of Splendor, Seal of Splendor, Crown of Splendor and Wailing of Splendor</font>. Slaughter them all! As proof of their demise, bring back 300 units of <font color="LEVEL">Blood of Saint</font>, the source of their power.
 </body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-2a.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-03.html

@@ -1,3 +1,3 @@
 <html><body>Hierarch:<br>
-Hey! What are you doing? You promised to help us! Bring justice to those<font color="LEVEL"> Eyes of Splendor, Flashes of Splendor, Knife Edges of Splendor, Wisdom of Splendor, Souls of Splendor, Victories of Splendor, Vengeance of Splendor, Shouts of Splendor, Seals of Splendor, Crowns of Splendor and Wailing of Splendor</font>, and don't forget to bring back proof.
+Hey! What are you doing? You promised to help us! Bring justice to those <font color="LEVEL">Eyes of Splendor, Flashes of Splendor, Knife Edges of Splendor, Wisdom of Splendor, Souls of Splendor, Victories of Splendor, Vengeance of Splendor, Shouts of Splendor, Seals of Splendor, Crowns of Splendor and Wailing of Splendor</font>, and don't forget to bring back proof.
 </body></html>

+ 2 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-2.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-04.html

@@ -1,4 +1,5 @@
 <html><body>Hierarch:<br>
 Have you brought the Blood of Saint?<br>
 Your success has helped us achieve our goal! We couldn't have done it without you! Now choose your reward!<br>
-<a action="bypass -h Quest 626_ADarkTwilight 31517-3.htm">A reward?</a></body></html>
+<a action="bypass -h Quest Q00626_ADarkTwilight 31517-05.html">"A reward?"</a>
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-05.html

@@ -0,0 +1,5 @@
+<html><body>Hierarch:<br>
+Here you go! Take your pick! Of course, you must first give me 300 units of Blood of Saint. Just put it over there. Now choose your reward!<br>
+<a action="bypass -h Quest Q00626_ADarkTwilight Exp">Increase Exp and SP</a><br>
+<a action="bypass -h Quest Q00626_ADarkTwilight Adena">Receive Adena</a>
+</body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-3a.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-06.html


+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/626_ADarkTwilight/31517-4.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/31517-07.html


+ 176 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00626_ADarkTwilight/Q00626_ADarkTwilight.java

@@ -0,0 +1,176 @@
+/*
+ * 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.Q00626_ADarkTwilight;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.l2jserver.Config;
+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;
+
+/**
+ * A Dark Twilight (626)<br>
+ * Original Jython script by disKret.
+ * @author Citizen
+ */
+public class Q00626_ADarkTwilight extends Quest
+{
+	// NPCs
+	private static final int HIERARCH = 31517;
+	// Items
+	private static final int BLOOD_OF_SAINT = 7169;
+	// Monsters
+	private static final Map<Integer, Integer> MONSTERS = new HashMap<>();
+	static
+	{
+		MONSTERS.put(21520, 641); // Eye of Splendor
+		MONSTERS.put(21523, 648); // Flash of Splendor
+		MONSTERS.put(21524, 692); // Blade of Splendor
+		MONSTERS.put(21525, 710); // Blade of Splendor
+		MONSTERS.put(21526, 772); // Wisdom of Splendor
+		MONSTERS.put(21529, 639); // Soul of Splendor
+		MONSTERS.put(21530, 683); // Victory of Splendor
+		MONSTERS.put(21531, 767); // Punishment of Splendor
+		MONSTERS.put(21532, 795); // Shout of Splendor
+		MONSTERS.put(21535, 802); // Signet of Splendor
+		MONSTERS.put(21536, 774); // Crown of Splendor
+		MONSTERS.put(21539, 848); // Wailing of Splendor
+		MONSTERS.put(21540, 880); // Wailing of Splendor
+		MONSTERS.put(21658, 790); // Punishment of Splendor
+	}
+	// Misc
+	private static final int MIN_LEVEL_REQUIRED = 60;
+	private static final int ITEMS_COUNT_REQUIRED = 300;
+	// Rewards
+	private static final int ADENA_COUNT = 100000;
+	private static final int XP_COUNT = 162773;
+	private static final int SP_COUNT = 12500;
+	
+	private Q00626_ADarkTwilight(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		addStartNpc(HIERARCH);
+		addTalkId(HIERARCH);
+		addKillId(MONSTERS.keySet());
+		registerQuestItems(BLOOD_OF_SAINT);
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final QuestState st = player.getQuestState(getName());
+		if (st == null)
+		{
+			return null;
+		}
+		String htmltext = event;
+		switch (event)
+		{
+			case "31517-05.html":
+				break;
+			case "31517-02.htm":
+				st.startQuest();
+				break;
+			case "Exp":
+				if (st.getQuestItemsCount(BLOOD_OF_SAINT) < ITEMS_COUNT_REQUIRED)
+				{
+					return "31517-06.html";
+				}
+				st.addExpAndSp(XP_COUNT, SP_COUNT);
+				st.exitQuest(true, true);
+				htmltext = "31517-07.html";
+				break;
+			case "Adena":
+				if (st.getQuestItemsCount(BLOOD_OF_SAINT) < ITEMS_COUNT_REQUIRED)
+				{
+					return "31517-06.html";
+				}
+				st.giveAdena(ADENA_COUNT, true);
+				st.exitQuest(true, true);
+				htmltext = "31517-07.html";
+				break;
+			default:
+				htmltext = null;
+				break;
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
+	{
+		final L2PcInstance partyMember = getRandomPartyMember(killer, 1);
+		if (partyMember != null)
+		{
+			final QuestState st = partyMember.getQuestState(getName());
+			final float chance = (MONSTERS.get(npc.getNpcId()) * Config.RATE_QUEST_DROP);
+			if (getRandom(1000) < chance)
+			{
+				st.giveItems(BLOOD_OF_SAINT, 1);
+				if (st.getQuestItemsCount(BLOOD_OF_SAINT) < ITEMS_COUNT_REQUIRED)
+				{
+					st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
+				}
+				else
+				{
+					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 (st.getState())
+		{
+			case State.CREATED:
+				htmltext = (player.getLevel() >= MIN_LEVEL_REQUIRED) ? "31517-01.htm" : "31517-00.htm";
+				break;
+			case State.STARTED:
+				switch (st.getCond())
+				{
+					case 1:
+						htmltext = "31517-03.html";
+						break;
+					case 2:
+						htmltext = "31517-04.html";
+						break;
+				}
+				break;
+		}
+		return htmltext;
+	}
+	
+	public static void main(String[] args)
+	{
+		new Q00626_ADarkTwilight(626, Q00626_ADarkTwilight.class.getSimpleName(), "A Dark Twilight");
+	}
+}

+ 1 - 0
L2J_DataPack_BETA/dist/sql/game/updates/20130308update.sql

@@ -0,0 +1 @@
+UPDATE character_quests SET name='Q00626_ADarkTwilight' WHERE name='626_ADarkTwilight';