Explorar o código

BETA/STABLE: Q287_FiguringItOut by malyelfik.

MELERIX %!s(int64=14) %!d(string=hai) anos
pai
achega
47294f2ca1

+ 1 - 0
L2J_DataPack_BETA/data/scripts.cfg

@@ -429,6 +429,7 @@ quests/281_HeadForTheHills/__init__.py
 quests/283_TheFewTheProudTheBrave/__init__.py
 quests/284_MuertosFeather/__init__.py
 quests/286_FabulousFeathers/__init__.py
+quests/Q287_FiguringItOut/Q287_FiguringItOut.java
 quests/291_RedBonnetsRevenge/__init__.py
 quests/292_CrushBrigands/__init__.py
 quests/293_HiddenVein/__init__.py

+ 5 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-01.htm

@@ -0,0 +1,5 @@
+<html><body>Investigator Laki:<br>
+If all you did was look from out here at the Plains of the Lizardmen, you'd describe it as a beautiful magical place. If only that were true. I was naive enough to believe that once, but the scars on my skin that I will leave here with will forever remind me of the truth. Look at this... and here... you see? That's from the poisons that cover the Plains. I'm just lucky to be alive. How can I study under these conditions?<br>
+Further, how does a species survive amidst the cursed magical energy that came from Antharas' blood that flows through the land? Not only survive... they seem to to actually thrive on the magic and poisons. That is the root of my research. How a species could adapt to that?<br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-02.htm">Ask about the research.</a>
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-02.htm

@@ -0,0 +1,4 @@
+<html><body>Investigator Laki:<br>
+Primarily, I am investigating the intelligence of the Tanta Lizardmen, and whether or not they are cognitive enough to know how much they've changed to fit this new environment. The root of my research lies in the study of their blood... so much blood. But I've used it all and still my results are unsatisfying. Could you possibly gather more of the Tanta's blood for me? it's very important!<br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-03.htm">Agree to help.</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-03.htm

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+For the investigation, I'll need at least 100 vials of <font color="LEVEL">Tanta Lizardmen blood</font>. But, if you bring more, I can offer more and greater rewards. The more, the better.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-04.html

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+We're on the right track, but we need much more blood. I calculate that a proper investigation prequires at least 100 vials of Tanta blood.
+</body></html>

+ 7 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-05.html

@@ -0,0 +1,7 @@
+<html><body>Investigator Laki:<br>
+Well well! You've brought quite a bit of blood. Thanks to you, my research can continue! As soon as we get some results, I'll be sure to share them with you. Hard work deserves proper payment, however. Take your choice.<br>
+<a action="bypass -h Quest 287_FiguringItOut Icarus">Recipe and ingredients of Icarus Spitter</a><br1>
+<font color="LEVEL">(500 vials of blood)</font><br>
+<a action="bypass -h Quest 287_FiguringItOut Moirai">Recipe and ingredients of Sealed Moirai armor set</a><br1>
+<font color="LEVEL">(100 vials of blood)</font>
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-06.html

@@ -0,0 +1,5 @@
+<html><body>Investigator Laki:<br>
+There you are. I'd like to give you even more if I could. At least take what I have for now. But in the meantime, I can always use more Tanta Lizardmen blood!<br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-10.html">Say you will keep helping.</a><br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-11.html">Say you quit.</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-07.html

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+I'm sorry but the Recipe and Ingredients of Icarus Spitter is rewarded to the first adventurer to bring me more than <font color="LEVEL">500 vials of Tanta blood.</font>
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-08.html

@@ -0,0 +1,5 @@
+<html><body>Investigator Laki:<br>
+Here you are. I'd like to give you even more if I could. At least take what I have for now. But in the mean time, I can always use more Tanta Lizardmen blood!<br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-10.html">Say you will keep helping.</a><br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-11.html">Say you quit.</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-09.html

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+I'm sorry but the recipe and Ingredients of Sealed Moirai Armor will be given to the first adventurer to bring me more than <font color="LEVEL">more than 100 vials of of Tanta blood</font>.
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-10.html

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+I knew you would help! You truly have the spirit of a keen researcher and adventurer. But my research must continue. If you could bring me more <font color="LEVEL">Tanta blood</font>, I'd appreciate it.
+</body></html>

+ 5 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-11.html

@@ -0,0 +1,5 @@
+<html><body>Investigator Laki:<br>
+Hm... I can't reward you if there's not enough Tanta blood. Are you quitting?<br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-10.html">Say you will continue to help.</a><br>
+<a action="bypass -h Quest 287_FiguringItOut 32742-13.html">Say you quit.</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-12.html

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+I see. That's it then. Perhaps you can help next time. 
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-13.html

@@ -0,0 +1,3 @@
+<html><body>Investigator Laki:<br>
+It is so... And I'm at a loss. We just have to hope for next time. 
+</body></html>

+ 4 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/32742-14.htm

@@ -0,0 +1,4 @@
+<html><body>Investigator Laki:<br>
+At first glance, the Plain of Lizardmen is a beautiful world torn from a fantasy book. It's hard to believe the dangers that lurk there, until you see for yourself. These scars are my lesson to that reality, and my investigations are stalled because of it. Don't go unless you are more prepared.<br>
+(Only characters with levels of 82 or above, and completed the &quot;Watch What You Eat&quot; quest can play this quest)
+</body></html>

+ 236 - 0
L2J_DataPack_BETA/data/scripts/quests/Q287_FiguringItOut/Q287_FiguringItOut.java

@@ -0,0 +1,236 @@
+package quests.Q287_FiguringItOut;
+
+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.util.Rnd;
+
+/**
+ * Figuring It Out! (287)
+ * @author malyelfik
+ */
+public class Q287_FiguringItOut extends Quest
+{
+	private static final String qn = "287_FiguringItOut";
+	//NPC
+	private static final int Laki = 32742;
+	private static final int[] Monsters = { 22771, 22770, 22774, 22769, 22772, 22768, 22773 };
+	// Items
+	private static final int VialOfTantaBlood = 15499;
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = event;
+		QuestState st = player.getQuestState(qn);
+		
+		if (st == null)
+			return htmltext;
+		
+		if (event.equalsIgnoreCase("32742-03.htm"))
+		{
+			st.set("cond", "1");
+			st.playSound("ItemSound.quest_accept");
+			st.setState(State.STARTED);
+		}
+		else if (event.equalsIgnoreCase("Icarus"))
+		{
+			if (st.getQuestItemsCount(VialOfTantaBlood) >= 500)
+			{
+				st.takeItems(VialOfTantaBlood, 500);
+				int i0 = Rnd.get(5);
+				if (i0 == 0)
+					st.giveItems(10381, 1);
+				else if (i0 == 1)
+					st.giveItems(10405, 1);
+				else if (i0 == 2)
+					st.giveItems(10405, 4);
+				else if (i0 == 3)
+					st.giveItems(10405, 4);
+				else
+					st.giveItems(10405, 6);
+				st.playSound("ItemSound.quest_finish");
+				htmltext = "32742-06.html";
+			}
+			else
+				htmltext = "32742-07.html";
+		}
+		else if (event.equalsIgnoreCase("Moirai"))
+		{
+			if (st.getQuestItemsCount(VialOfTantaBlood) >= 100)
+			{
+				st.takeItems(VialOfTantaBlood, 100);
+				int i0 = Rnd.get(10);
+				if (i0 == 0)
+					st.giveItems(15776, 1);
+				else if (i0 == 1)
+					st.giveItems(15779, 1);
+				else if (i0 == 2)
+					st.giveItems(15782, 1);
+				else if (i0 == 3)
+				{
+					boolean i1 = Rnd.nextBoolean();
+					if (!i1)
+						st.giveItems(15785, 1);
+					else
+						st.giveItems(15788, 1);
+				}
+				else if (i0 == 4)
+				{
+					int i1 = Rnd.get(10);
+					if (i1 < 4)
+						st.giveItems(15812, 1);
+					else if (i1 < 8)
+						st.giveItems(15813, 1);
+					else
+						st.giveItems(15814, 1);
+				}
+				else if (i0 == 5)
+					st.giveItems(15646, 5);
+				else if (i0 == 6)
+					st.giveItems(15649, 5);
+				else if (i0 == 7)
+					st.giveItems(15652, 5);
+				else if (i0 == 8)
+				{
+					boolean i1 = Rnd.nextBoolean();
+					if (!i1)
+						st.giveItems(15655, 5);
+					else
+						st.giveItems(15658, 5);
+				}
+				else
+				{
+					int i1 = Rnd.get(10);
+					if (i1 < 4)
+						st.giveItems(15772, 1);
+					else if (i1 < 7)
+						st.giveItems(15773, 1);
+					else
+						st.giveItems(15774, 1);
+				}
+				st.playSound("ItemSound.quest_finish");
+				htmltext = "32742-08.html";
+			}
+			else
+				htmltext = "32742-09.html";
+		}
+		else if (event.equalsIgnoreCase("32742-11.html"))
+		{
+			if (st.getQuestItemsCount(VialOfTantaBlood) >= 1)
+				htmltext = "32742-11.html";
+			else
+			{
+				st.playSound("ItemSound.quest_finish");
+				st.exitQuest(true);
+				htmltext = "32742-12.html";
+			}
+		}
+		else if (event.equalsIgnoreCase("32742-13.html"))
+		{
+			st.takeItems(VialOfTantaBlood, -1);
+			st.playSound("ItemSound.quest_finish");
+			st.exitQuest(true);
+			htmltext = "32742-12.html";
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = getNoQuestMsg(player);
+		QuestState st = player.getQuestState(qn);
+		QuestState prev = player.getQuestState("250_WatchWhatYouEat");
+		
+		if (st == null)
+			return htmltext;
+		
+		switch (st.getState())
+		{
+			case State.CREATED:
+				if (player.getLevel() >= 82 && prev != null && prev.getState() == State.COMPLETED)
+					htmltext = "32742-01.htm";
+				else
+					htmltext = "32742-14.htm";
+				break;
+			case State.STARTED:
+				if (st.getQuestItemsCount(VialOfTantaBlood) < 100)
+					htmltext = "32742-04.html";
+				else
+					htmltext = "32742-05.html";
+				break;
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
+	{
+		L2PcInstance partyMember = getRandomPartyMember(player, "1");
+		if (partyMember == null)
+			return null;
+		final QuestState st = partyMember.getQuestState(qn);
+		int chance = Rnd.get(1000);
+		boolean giveItem = false;
+		
+		switch (npc.getNpcId())
+		{
+			case 22771: // Tanta Lizardman Berserker
+				if (chance < 159)
+					giveItem = true;
+				break;
+			case 22770: // Tanta Lizardman Soldier
+				if (chance < 123)
+					giveItem = true;
+				break;
+			case 22774: // Tanta Lizardman Summoner
+				if (chance < 261)
+					giveItem = true;
+				break;
+			case 22769: // Tanta Lizardman Warrior
+				if (chance < 689)
+					giveItem = true;
+				break;
+			case 22772: // Tanta Lizardman Archer
+				if (chance < 739)
+					giveItem = true;
+				break;
+			case 22768: // Tanta Lizardman Scout
+				if (chance < 509)
+					giveItem = true;
+				break;
+			case 22773: // Tanta Lizardman Magician
+				if (chance < 737)
+					giveItem = true;
+				break;
+		}
+		
+		if (giveItem)
+		{
+			st.giveItems(VialOfTantaBlood, 1);
+			st.playSound("ItemSound.quest_itemget");
+		}
+		return null;
+	}
+	
+	public Q287_FiguringItOut(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		addStartNpc(Laki);
+		addTalkId(Laki);
+		for (int i : Monsters)
+		{
+			addKillId(i);
+		}
+		
+		questItemIds = new int[] { VialOfTantaBlood };
+	}
+	
+	public static void main(String[] args)
+	{
+		new Q287_FiguringItOut(287, qn, "Figuring It Out!");
+	}
+}