소스 검색

BETA: Quest '''An Aged Ex-Adventurer'''
* Translated to Java and updated
* Thanks valdaron for report

malyelfik 12 년 전
부모
커밋
db09bb147c

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

@@ -655,7 +655,7 @@ quests/648_AnIceMerchantsDream/__init__.py
 quests/649_ALooterAndARailroadMan/__init__.py
 quests/650_ABrokenDream/__init__.py
 quests/651_RunawayYouth/__init__.py
-quests/652_AnAgedExAdventurer/__init__.py
+quests/Q00652_AnAgedExAdventurer/Q00652_AnAgedExAdventurer.java
 quests/653_WildMaiden/__init__.py
 quests/654_JourneytoaSettlement/__init__.py
 quests/659_IdRatherBeCollectingFairyBreath/__init__.py

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/32012-00.htm

@@ -1,4 +0,0 @@
-<html><body>Tantan:<br>
-Ah-ha! You're a novice adventurer... I haven't met anyone like you on the plains for long time. I'm Tantan. I may be old now, but in my day, I was a famous adventurer! You've heard of me, haven't you? Those young fellows in the village say I'm making it all up! Youngsters these days are just plain rude! So, I've come all the way out here to catch some monsters to show them. I'm out of Soulshots, and my strength is not what it used to be... I'm in a bit of a fix... Maybe one day you'll be able to help me.<br>
-(Quest for characters level 46 and above)
-</body></html>

+ 0 - 5
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/32012-01.htm

@@ -1,5 +0,0 @@
-<html><body>Tantan:<br>
-Ah-ha! You're a novice adventurer... I haven't met anyone like you on the plains for long time. I'm Tantan. I may be old now, but in my day, I was a famous adventurer! You've heard of me, haven't you? Those young fellows in the village say I'm making it all up! Youngsters these days are just plain rude! So, I've come all the way out here to catch some monsters to show them. I'm out of Soulshots, and my strength is not what it used to be... I'm in a bit of a fix...<br>
-<a action="bypass -h Quest 652_AnAgedExAdventurer 32012-02.htm">"I'll share 100 C-grade Soulshots with you. Please make your way home safely with these."</a><br>
-<a action="bypass -h Quest 652_AnAgedExAdventurer 32012-02a.htm">"I've got problems of my own! Beat it!"</a>
-</body></html>

+ 0 - 3
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/32012-02a.htm

@@ -1,3 +0,0 @@
-<html><body>Tantan:<br>
-Hump! Very well. Never mind an old fart like me, just go about your business! Like I said, young ones these days are just plain rude! It's different from my day... I want to go back home to my daughter-in-law...
-</body></html>

+ 0 - 65
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/__init__.py

@@ -1,65 +0,0 @@
-# Made by Kerb
-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 = "652_AnAgedExAdventurer"
-#Npc
-TANTAN = 32012
-SARA = 30180
-
-#Items
-CSS = 1464
-
-class Quest (JQuest) :
-
- def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
-
- def onAdvEvent (self,event,npc,player) :
-    st = player.getQuestState(qn)
-    if not st: return
-    htmltext = event
-    if event == "32012-02.htm" :
-      if st.getQuestItemsCount(CSS) > 99 :
-        st.set("cond","1")
-        st.setState(State.STARTED)
-        st.playSound("ItemSound.quest_accept")
-        st.takeItems(CSS,100)
-        htmltext = "32012-03.htm"
-        npc.deleteMe()
-    elif event == "32012-02a.htm" :
-        st.exitQuest(1)
-        st.playSound("ItemSound.quest_giveup")
-    return htmltext
-
- def onTalk (Self,npc,player):
-   st = player.getQuestState(qn)
-   htmltext = Quest.getNoQuestMsg(player)
-   if not st : return htmltext
-   npcId = npc.getNpcId()
-   id = st.getState()
-   cond=st.getInt("cond")
-   if npcId == TANTAN and id == State.CREATED:
-       if st.getPlayer().getLevel() >= 46 :
-           htmltext = "32012-01.htm"
-       else:
-           htmltext = "32012-00.htm"
-           st.exitQuest(1)
-   elif npcId == SARA and st.getInt("cond") :
-       htmltext = "30180-01.htm"
-       EAD_CHANCE = self.getRandom(100)
-       st.giveItems(57,5026)
-       if EAD_CHANCE <= 50:
-          st.rewardItems(956,1)
-       st.playSound("ItemSound.quest_finish")
-       st.exitQuest(1)
-   return htmltext
-
-QUEST       = Quest(652,qn,"AnAgedExAdventurer")
-
-QUEST.addStartNpc(TANTAN)
-
-QUEST.addTalkId(TANTAN)
-QUEST.addTalkId(SARA)

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/30180-01.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/30180-01.html

@@ -1,3 +1,3 @@
 <html><body>Sara:<br>
-Thank you so mutch! My father-in-law came home safely, thanks to your help. You made him very happy, by the way! He hadn't met any fellow adventurers for quite a while. Please accept this as a token of my appreciation! Thank you again.
+Thank you so much! My father-in-law came home safely, thanks to your help. You made him very happy, by the way!  He hadn't met any fellow adventurers for quite a while. Please accept this as a token of my appreciation! Thank you again.
 </body></html>

+ 3 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/30180-02.html

@@ -0,0 +1,3 @@
+<html><body>Sara:<br>
+I'm so sorry. I thought you were just a customer... You're the one who helped my father-in-law! Unfortunately, he was seriously injured on the way home by monsters! Luckily, he escaped with his life and is now at home. But still, you helped him make it out alive. Thank you so much! (Because the old man was injured, you don't have the heart to ask for a reward.)
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/32012-01.htm

@@ -0,0 +1,5 @@
+<html><body>Tantan:<br>
+Ah-ha!  You're a novice adventurer... I haven't met anyone like you on the plains for a long time. I'm Tantan. I may be old now, but in my day, I was a famous adventurer! You've heard of me, haven't you? Those young fellows in the village say I'm making it all up! Youngsters these days are just plain rude! So, I've come all the way out here to catch some monsters to show them. I'm out of Soulshots, and my strength is not what it used to be... I'm in a bit of a fix...<br>
+<a action="bypass -h Quest Q00652_AnAgedExAdventurer 32012-04.htm">"I'll share 100 C-grade Soulshots with you. Please make your way home safely with these."</a><br>
+<a action="bypass -h Quest Q00652_AnAgedExAdventurer 32012-03.html">"I've got problems of my own! Beat it!"</a>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/32012-01a.htm

@@ -0,0 +1,6 @@
+<html><body>Tantan:<br>
+Ah-ha!  You're a novice adventurer... I haven't met anyone like you on the plains for a long time. I'm Tantan. I may be old now, but in my day, I was a famous adventurer! You've heard of me, haven't you? Those young fellows in the village say I'm making it all up! Youngsters these days are just plain rude! So, I've come all the way out here to catch some monsters to show them. I'm out of Soulshots, and my strength is not what it used to be... I'm in a bit of a fix...<br>
+If you were a little more experienced, I would've asked for your help.<br>
+Take care of yourself.<br>
+(Only characters of level 46 or above may undertake this quest.)
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/32012-02.html

@@ -0,0 +1,4 @@
+<html><body>Tantan:<br>
+You were the young fellow who helped me out! Thanks to you, I can now fight a monster if I meet one on my way back home... Thank you!<br>
+If you ever visit <font color = "LEVEL">the Town of Oren</font>... speak with <font color = "LEVEL">Grocer Sara</font>! She's my daughter-in-law and will reward you for your good heart.
+</body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/32012-02.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/32012-03.html


+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/652_AnAgedExAdventurer/32012-03.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/32012-04.htm

@@ -1,6 +1,6 @@
 <html><body>Tantan:<br>
 Thank you so much... There is still chivalry left in this world! You've made me realize that I can still have adventures! I'll show those whippersnappers! It's so nice to meet someone like you who understands me..<br>
-If you ever visit<font color="LEVEL"> the Town of Oren</font>... speak with<font color="LEVEL"> Grocer Sara</font>, my daughter-in-law. She's a good one who's always worrying about me... She'll reward you for your good heart.<br>
+If you ever visit <font color = "LEVEL">the Town of Oren</font>... speak with <font color = "LEVEL">Grocer Sara</font>, my daughter-in-law. She's a good one who's always worrying about me... She'll reward you for your good heart. <br>
 I'm going back home then...<br>
 Good luck.
 </body></html>

+ 4 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/32012-05.htm

@@ -0,0 +1,4 @@
+<html><body>Tantan:<br>
+I guess you've used all your Soulshots... If you happen to meet any  adventurers who have Soulshots... Would you ask them to help me out? Good luck! <br>
+(You need 100 C-grade Soulshots.)
+</body></html>

+ 121 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00652_AnAgedExAdventurer/Q00652_AnAgedExAdventurer.java

@@ -0,0 +1,121 @@
+/*
+ * 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.Q00652_AnAgedExAdventurer;
+
+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;
+
+/**
+ * An Aged Ex-Adventurer (652)
+ * @author malyelfik
+ */
+public class Q00652_AnAgedExAdventurer extends Quest
+{
+	// NPCs
+	private static final int TANTAN = 32012;
+	private static final int SARA = 30180;
+	
+	// Items
+	private static final int SOULSHOT_C = 1464;
+	private static final int ENCHANT_ARMOR_D = 956;
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final QuestState st = player.getQuestState(getName());
+		if (st == null)
+		{
+			return null;
+		}
+		
+		String htmltext = null;
+		if (event.equals("32012-04.htm"))
+		{
+			if (st.getQuestItemsCount(SOULSHOT_C) < 100)
+			{
+				return "32012-05.htm";
+			}
+			
+			st.startQuest();
+			st.takeItems(SOULSHOT_C, 100);
+			npc.deleteMe();
+			htmltext = event;
+		}
+		else if (event.equals("32012-03.html"))
+		{
+			htmltext = event;
+		}
+		return htmltext;
+	}
+	
+	@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 TANTAN:
+				switch (st.getState())
+				{
+					case State.CREATED:
+						htmltext = (player.getLevel() >= 46) ? "32012-01.htm" : "32012-01a.htm";
+						break;
+					case State.STARTED:
+						htmltext = "32012-02.html";
+						break;
+				}
+				break;
+			case SARA:
+				if (st.isStarted())
+				{
+					if (getRandom(10) <= 4)
+					{
+						st.giveItems(ENCHANT_ARMOR_D, 1);
+						st.giveAdena(5026, true);
+						htmltext = "30180-01.html";
+					}
+					else
+					{
+						st.giveAdena(10000, true);
+						htmltext = "30180-02.html";
+					}
+					st.exitQuest(true, true);
+				}
+				break;
+		}
+		return htmltext;
+	}
+	
+	public Q00652_AnAgedExAdventurer(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		addStartNpc(TANTAN);
+		addTalkId(TANTAN, SARA);
+	}
+	
+	public static void main(String[] args)
+	{
+		new Q00652_AnAgedExAdventurer(652, Q00652_AnAgedExAdventurer.class.getSimpleName(), "An Aged Ex-Adventurer");
+	}
+}