Browse Source

BETA: Quest Q00286_FabulousFeathers in Java.
* Reviewed by: Zoey76, UnAfraid

xban1x 11 years ago
parent
commit
789f7dad10
17 changed files with 167 additions and 123 deletions
  1. 1 1
      L2J_DataPack_BETA/dist/game/data/scripts.cfg
  2. 0 7
      L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-01.htm
  3. 0 6
      L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-02.htm
  4. 0 4
      L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-04.htm
  5. 0 7
      L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-05.htm
  6. 0 4
      L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-06.htm
  7. 0 86
      L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/__init__.py
  8. 1 5
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00284_MuertosFeather/Q00284_MuertosFeather.java
  9. 6 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-01.htm
  10. 5 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-02.htm
  11. 2 2
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-03.htm
  12. 7 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-04.html
  13. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-05.html
  14. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-06.html
  15. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-07.html
  16. 131 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/Q00286_FabulousFeathers.java
  17. 2 1
      L2J_DataPack_BETA/dist/sql/game/updates/20131111update.sql

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

@@ -427,7 +427,7 @@ quests/Q00280_TheFoodChain/Q00280_TheFoodChain.java
 quests/Q00281_HeadForTheHills/Q00281_HeadForTheHills.java
 quests/Q00283_TheFewTheProudTheBrave/Q00283_TheFewTheProudTheBrave.java
 quests/Q00284_MuertosFeather/Q00284_MuertosFeather.java
-quests/286_FabulousFeathers/__init__.py
+quests/Q00286_FabulousFeathers/Q00286_FabulousFeathers.java
 quests/Q00287_FiguringItOut/Q00287_FiguringItOut.java
 quests/Q00288_HandleWithCare/Q00288_HandleWithCare.java
 quests/Q00289_NoMoreSoupForYou/Q00289_NoMoreSoupForYou.java

+ 0 - 7
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-01.htm

@@ -1,7 +0,0 @@
-<html><body>Trader Erinu:<br>
-I have heard that you attained the level necessery to enter Nornil's Cave.<br>
-If that is the case, I suppose the time is drawing near for you to leave this island. Well, they say that the continent is also filled with adventure.<br>
-Before you leave, though, would you do me a small favor? I need something, but I can get it only by entering Nornil's Cave.<br>
-All the friends who used to help me in this regard have left the island, so I am at loose ends...<br>
-<a action="bypass -h Quest 286_FabulousFeathers 32164-03.htm">Ask what it is.</a>
-</body></html>

+ 0 - 6
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-02.htm

@@ -1,6 +0,0 @@
-<html><body>Trader Erinu:<br>
-How is your training progressing?<br>
-When you have reached the level where you need more challenges than this island can offer, please come and see me again.<br>
-I have something to ask of you.<br>
-(Only characters level 17 or higher can embark on this quest.)
-</body></html>

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-04.htm

@@ -1,4 +0,0 @@
-<html><body>Trader Erinu:<br>
-Bring me 80 feathers of the Muertos Leader and I will give you a fair price for them<br>
-You can get the feathers by defeating the Shady Muertos <font color="LEVEL">Captains, Warriors, Archers, Leaders and Wizards</font> that live in Nornil's Cave.
-</body></html>

+ 0 - 7
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-05.htm

@@ -1,7 +0,0 @@
-<html><body>Trader Erinu:<br>
-Oh, you brought back all 80 Muertos Commander feathers?<br>
-Well done! I hear that the noblewomen in those big mainland castles are eager large fans constructed from these feathers.<br>
-I'll be happy to buy them from you at a fair price.<br>
-Let's see... how does 4,160 Adena sound?<br>
-<a action="bypass -h Quest 286_FabulousFeathers 32164-06.htm">Tell him that's enough.</a>
-</body></html>

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-06.htm

@@ -1,4 +0,0 @@
-<html><body>Trader Erinu:<br>
-Good. Then it's a deal.<br>
-We've managed to fill one box, but we can certainly sell more if you're willing to go back and collect another batch of feathers.
-</body></html>

+ 0 - 86
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/__init__.py

@@ -1,86 +0,0 @@
-# Contributed by t0rm3nt0r (tormentor2000@mail.ru) to the Official L2J Datapack Project.
-# Visit http://www.l2jdp.com/forum/ for more details.
-
-import sys
-from com.l2jserver.gameserver.model.quest import State
-from com.l2jserver.gameserver.model.quest import QuestState
-from com.l2jserver.gameserver.model.quest import Quest as JQuest
-
-#Complete - 100%.
-qn = "286_FabulousFeathers"
-
-#NPC'S
-ERINU = 32164
-
-#ITEM'S
-FEATHER = 9746
-
-#MOB'S
-MOBS = range(22253,22257)+[22251]
-
-class Quest (JQuest) :
-
- def __init__(self,id,name,descr):
-     JQuest.__init__(self,id,name,descr)
-  
- def onAdvEvent (self,event,npc, player) :
-     htmltext = event
-     st = player.getQuestState(qn)
-     if not st : return
-     feather = st.getQuestItemsCount(FEATHER)
-     if event == "32164-03.htm" :
-       st.set("cond","1")
-       st.setState(State.STARTED)
-       st.playSound("ItemSound.quest_accept")
-     elif event == "32164-06.htm" :
-       st.giveItems(57,4160)
-       st.takeItems(FEATHER,-1)
-       st.playSound("ItemSound.quest_finish")
-       st.unset("cond")
-       st.exitQuest(1)
-     return htmltext
-
- def onTalk (self,npc,player):
-     npcId = npc.getId()
-     htmltext = Quest.getNoQuestMsg(player)
-     st = player.getQuestState(qn)
-     if not st : return htmltext
-     id = st.getState()
-     cond = st.getInt("cond")
-     feather = st.getQuestItemsCount(FEATHER)
-     if id == State.CREATED and npcId == ERINU :
-       if player.getLevel() < 17 :
-         htmltext = "32164-02.htm"
-         st.exitQuest(1)
-       else :
-         htmltext = "32164-01.htm"
-     elif id == State.STARTED and npcId == ERINU :
-       if cond == 1 :
-         htmltext = "32164-04.htm"
-       elif cond == 2 :
-         htmltext = "32164-05.htm"
-     return htmltext
-    
- def onKill(self,npc,player,isPet) :
-     st = player.getQuestState(qn)
-     if not st: return
-     if st.getState() == State.STARTED :
-       npcId = npc.getId()
-       chance = self.getRandom(100)
-       feather = st.getQuestItemsCount(FEATHER)
-       if (npcId in MOBS) and (chance < 70) and feather < 80: #Retail statistic info. 113 mob's - 80 feathers
-         st.giveItems(FEATHER,1)
-         st.playSound("ItemSound.quest_itemget")
-         if st.getQuestItemsCount(FEATHER) == 80 :
-           st.set("cond","2")
-           st.playSound("ItemSound.quest_middle")
-     return
-
-QUEST       = Quest(286, qn, "Fabulous Feathers")
-
-QUEST.addStartNpc(ERINU)
-
-QUEST.addTalkId(ERINU)
-
-for mob in MOBS :
-    QUEST.addKillId(mob)

+ 1 - 5
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00284_MuertosFeather/Q00284_MuertosFeather.java

@@ -97,7 +97,7 @@ public final class Q00284_MuertosFeather extends Quest
 			}
 			case "32166-09.html":
 			{
-				qs.exitQuest(true);
+				qs.exitQuest(true, true);
 				html = event;
 				break;
 			}
@@ -121,10 +121,6 @@ public final class Q00284_MuertosFeather extends Quest
 	{
 		final QuestState qs = getQuestState(player, true);
 		String html = getNoQuestMsg(player);
-		if (qs == null)
-		{
-			return html;
-		}
 		if (qs.isCreated())
 		{
 			html = ((player.getLevel() >= MIN_LVL) ? "32166-01.htm" : "32166-02.htm");

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-01.htm

@@ -0,0 +1,6 @@
+<html><body>Trader Erinu:<br>
+I've heard that you are ready to enter Nornil's Cave.<br>
+That means that the time is also drawing near for you to leave this island. Well, they say that the mainland is also filled with adventure.<br>
+Before you leave, though, would you do me a small favor by retrieving something for me from Nornil's Cave?<br>
+<a action="bypass -h Quest Q00286_FabulousFeathers 32164-03.htm">Ask what it is.</a>
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-02.htm

@@ -0,0 +1,5 @@
+<html><body>Trader Erinu:<br>
+How is your training progressing?<br>
+When you need more challenges than this island can offer, please come and see me again.<br>
+(Only characters who are level 17 or higher may undertake this quest.)
+</body></html>

+ 2 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/286_FabulousFeathers/32164-03.htm → L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-03.htm

@@ -1,5 +1,5 @@
 <html><body>Trader Erinu:<br>
 When you enter Nornil's Cave, you will encounter bird-like humanoid creatures called Muertos. Among them are <font color="LEVEL">Captains, Warriors, Archers, Leaders and Wizards</font>, all of which can be distinguished by their powerful wings.<br>
-Some Humans will pay a premium for Muertos feathers, whether for use as decoration in weapons.<br>
-<font color="LEVEL">Collect about 80 of those feathers.</font>
+Some Humans will pay a premium for Muertos feathers to use as decorations for accessories and weapons.<br>
+<font color="LEVEL">Collect at least 80 feathers</font> and bring them to me.
 </body></html>

+ 7 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-04.html

@@ -0,0 +1,7 @@
+<html><body>Trader Erinu:<br>
+Ah, you've returned with 80 Muertos feathers?<br>
+Well done! I hear that the noble women who inhabit those big mainland castles are eager for large fans made from these feathers.<br>
+Naturally, I'll buy them from you for a fair price.<br>
+Let's see...how does 4,160 Adena sound?<br>
+<a action="bypass -h Quest Q00286_FabulousFeathers 32164-06.html">Accept</a>
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-05.html

@@ -0,0 +1,4 @@
+<html><body>Trader Erinu:<br>
+Bring me 80 Muertos feathers and I'll pay you well!<br>
+You can obtain the feathers by defeating the Shady Muertos <font color="LEVEL">Captains, Warriors, Archers, Leaders and Magicians</font> that inhabit Nornil's Cave.
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-06.html

@@ -0,0 +1,4 @@
+<html><body>Trader Erinu:<br>
+Good! It's a deal, then.<br>
+Well, we've managed to fill one box, but we can certainly sell more if you're willing to go back and collect another batch of feathers.
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/32164-07.html

@@ -0,0 +1,4 @@
+<html><body>Trader Erinu:<br>
+Very well. Then just give me the feather...huh?<br>
+What did you do with the feather you just showed me? Give it to me!
+</body></html>

+ 131 - 0
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00286_FabulousFeathers/Q00286_FabulousFeathers.java

@@ -0,0 +1,131 @@
+/*
+ * 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.Q00286_FabulousFeathers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+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;
+
+/**
+ * Fabulous Feathers (286).
+ * @author xban1x
+ */
+public final class Q00286_FabulousFeathers extends Quest
+{
+	// NPC
+	private static final int ERINU = 32164;
+	// Item
+	private static final int COMMANDERS_FEATHER = 9746;
+	// Monsters
+	private static final Map<Integer, Double> MOB_DROP_CHANCES = new HashMap<>();
+	static
+	{
+		MOB_DROP_CHANCES.put(22251, 0.748); // Shady Muertos Captain
+		MOB_DROP_CHANCES.put(22253, 0.772); // Shady Muertos Warrior
+		MOB_DROP_CHANCES.put(22254, 0.772); // Shady Muertos Archer
+		MOB_DROP_CHANCES.put(22255, 0.796); // Shady Muertos Commander
+		MOB_DROP_CHANCES.put(22256, 0.952); // Shady Muertos Wizard
+	}
+	// Misc
+	private static final int MIN_LVL = 17;
+	
+	private Q00286_FabulousFeathers()
+	{
+		super(286, Q00286_FabulousFeathers.class.getSimpleName(), "Fabulous Feathers");
+		addStartNpc(ERINU);
+		addTalkId(ERINU);
+		addKillId(MOB_DROP_CHANCES.keySet());
+		registerQuestItems(COMMANDERS_FEATHER);
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final QuestState qs = getQuestState(player, false);
+		String html = null;
+		if (qs == null)
+		{
+			return html;
+		}
+		switch (event)
+		{
+			case "32164-03.htm":
+			{
+				qs.startQuest();
+				html = event;
+				break;
+			}
+			case "32164-06.html":
+			{
+				if (qs.isCond(2) && (getQuestItemsCount(player, COMMANDERS_FEATHER) >= 80))
+				{
+					takeItems(player, COMMANDERS_FEATHER, -1);
+					giveAdena(player, 4160, true);
+					qs.exitQuest(true, true);
+					html = event;
+				}
+				else
+				{
+					html = "32164-07.html";
+				}
+				break;
+			}
+		}
+		return html;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
+	{
+		final QuestState qs = getRandomPartyMemberState(killer, 1, 3, npc);
+		if (qs != null)
+		{
+			if (giveItemRandomly(killer, npc, COMMANDERS_FEATHER, 1, 80, MOB_DROP_CHANCES.get(npc.getId()), true))
+			{
+				qs.setCond(2);
+			}
+		}
+		return super.onKill(npc, killer, isSummon);
+	}
+	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance player)
+	{
+		final QuestState qs = getQuestState(player, true);
+		String html = getNoQuestMsg(player);
+		if (qs.isCreated())
+		{
+			html = ((player.getLevel() >= MIN_LVL) ? "32164-01.htm" : "32164-02.htm");
+		}
+		else if (qs.isStarted())
+		{
+			html = ((qs.isCond(2) && (getQuestItemsCount(player, COMMANDERS_FEATHER) >= 80)) ? "32164-04.html" : "32164-05.html");
+		}
+		return html;
+	}
+	
+	public static void main(String[] args)
+	{
+		new Q00286_FabulousFeathers();
+	}
+}

+ 2 - 1
L2J_DataPack_BETA/dist/sql/game/updates/20131111update.sql

@@ -1 +1,2 @@
-UPDATE character_quests SET name='Q00284_MuertosFeather' WHERE name='284_MuertosFeather';
+UPDATE character_quests SET name='Q00284_MuertosFeather' WHERE name='284_MuertosFeather';
+UPDATE character_quests SET name='Q00286_FabulousFeathers' WHERE name='286_FabulousFeathers';