rendered paste bodyIndex: dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-08.htm
===================================================================
--- dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-08.htm (revision 8398)
+++ dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-08.htm (working copy)
@@ -1,6 +1,7 @@
<html><body>Apprentice Atra:<br>
Ah, you've finally returned! What would you like to do next?<br>
-<a action="bypass -h Quest 309_ForAGoodCause claimreward">Receive rewards.</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause claimreward">Check reward list.</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause receivepiece">Receive Moirai Robe Set ingredient item (requires 100 Mucrokian skins).</a><br>
<a action="bypass -h Quest 309_ForAGoodCause 32647-12.htm">Continue with the task.</a><br>
<a action="bypass -h Quest 309_ForAGoodCause 32647-13.htm">Stop the quest.</a>
</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-10.htm
===================================================================
--- dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-10.htm (revision 8398)
+++ dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-10.htm (working copy)
@@ -2,8 +2,31 @@
You must be in a hurry. Anyway, the reward items are as follows: You can choose an item of your choice if you have enough Mucrokian Hide or Contaminated Mucrokian Hide.<br>
Contaminated Mucrokian Hide will be double the price of the other hides. Except, Contaminated Mucrokian Hide will be settled first during the settlement.<br>
What would you like?<br>
-<a action="bypass -h Quest 309_ForAGoodCause 346">Recipe - Sealed Dynasty Earring(70%)(Requires 346 Mucrokian Hides)</a><br>
-<a action="bypass -h Quest 309_ForAGoodCause 462">Recipe - Sealed Dynasty Necklace(70%)(Requires 462 Mucrokian Hides)</a><br>
-<a action="bypass -h Quest 309_ForAGoodCause 232">Recipe - Sealed Dynasty Ring(70%)(Requires 232 Mucrokian Hides)</a><br>
-<a action="bypass -h Quest 309_ForAGoodCause 372">Recipe - Sealed Dynasty Sigil(60%)(Requires 372 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause 96">Recipe - Sealed Dynasty Earring(70%)(Requires 96 Fallen Mucrokian Hides)</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause 192">Recipe - Sealed Dynasty Earring(70%)(Requires 192 Mucrokian Hides)</a><br>346
+<a action="bypass -h Quest 309_ForAGoodCause 128">Recipe - Sealed Dynasty Necklace(70%)(Requires 128 Fallen Mucrokian Hides)</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause 256">Recipe - Sealed Dynasty Necklace(70%)(Requires 256 Mucrokian Hides)</a><br>462
+<a action="bypass -h Quest 309_ForAGoodCause 64">Recipe - Sealed Dynasty Ring(70%)(Requires 64 Fallen Mucrokian Hides)</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause 128">Recipe - Sealed Dynasty Ring(70%)(Requires 128 Mucrokian Hides)</a><br>232
+<a action="bypass -h Quest 309_ForAGoodCause 103">Recipe - Sealed Dynasty Sigil(60%)(Requires 103 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause 206">Recipe - Sealed Dynasty Sigil(60%)(Requires 206 Mucrokian Hides)</a>372
+
+<a action="bypass -h Quest 309_ForAGoodCause circlet_90">Recipe - Sealed Morai Circlet (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause circlet_180">Recipe - Sealed Morai Circlet (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause tunic_90">Recipe - Sealed Morai Tunic (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause tunic_180">Recipe - Sealed Morai Tunic (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause stockings_90">Recipe - Sealed Morai Stockings (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause stockings_180">Recipe - Sealed Morai Stockings (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause gloves_90">Recipe - Sealed Morai Gloves (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause gloves_180">Recipe - Sealed Morai Gloves (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause shoes_90">Recipe - Sealed Morai Shoes (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause shoes_180">Recipe - Sealed Morai Shoes (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause sigil_90">Recipe - Sealed Morai Sigil (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause sigil_180">Recipe - Sealed Morai Sigil (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause ring_90">Recipe - Sealed Morai Ring (70%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause ring_180">Recipe - Sealed Morai Ring (70%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause earring_90">Recipe - Sealed Morai Earring (70%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause earring_180">Recipe - Sealed Morai Earring (70%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause necklace_90">Recipe - Sealed Morai Necklace (70%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause necklace_180">Recipe - Sealed Morai Necklace (70%)(Requires 180 Mucrokian Hides)</a>
</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-11.htm
===================================================================
--- dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-11.htm (revision 8398)
+++ dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-11.htm (working copy)
@@ -2,8 +2,31 @@
You can choose an item of your choice if you have enough Mucrokian Hides or Contaminated Mucrokian Hides.<br>
Contaminated Mucrokian Hide are worth more and count as much as double of a normal Mucrokian Hide. In fact, we tend to favor those more and they will be deducted first those first before accepting normal Mucrokian Hides.<br>
What would you like?<br>
-<a action="bypass -h Quest 309_ForAGoodCause 288">Recipe - Sealed Dynasty Earring(70%)(Requires 288 Mucrokian Hides)</a><br>
-<a action="bypass -h Quest 309_ForAGoodCause 384">Recipe - Sealed Dynasty Necklace(70%)(Requires 384 Mucrokian Hides)</a><br>
-<a action="bypass -h Quest 309_ForAGoodCause 192">Recipe - Sealed Dynasty Ring(70%)(Requires 192 Mucrokian Hides)</a><br>
-<a action="bypass -h Quest 309_ForAGoodCause 310">Recipe - Sealed Dynasty Sigil(60%)(Requires 310 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause 96">Recipe - Sealed Dynasty Earring(70%)(Requires 96 Fallen Mucrokian Hides)</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause 192">Recipe - Sealed Dynasty Earring(70%)(Requires 192 Mucrokian Hides)</a><br>346
+<a action="bypass -h Quest 309_ForAGoodCause 256">Recipe - Sealed Dynasty Necklace(70%)(Requires 128 Fallen Mucrokian Hides)</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause 256">Recipe - Sealed Dynasty Necklace(70%)(Requires 256 Mucrokian Hides)</a><br>462
+<a action="bypass -h Quest 309_ForAGoodCause 128">Recipe - Sealed Dynasty Ring(70%)(Requires 64 Fallen Mucrokian Hides)</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause 128">Recipe - Sealed Dynasty Ring(70%)(Requires 128 Mucrokian Hides)</a><br>232
+<a action="bypass -h Quest 309_ForAGoodCause 372">Recipe - Sealed Dynasty Sigil(60%)(Requires 103 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause 372">Recipe - Sealed Dynasty Sigil(60%)(Requires 206 Mucrokian Hides)</a>372
+
+<a action="bypass -h Quest 309_ForAGoodCause circlet_90">Recipe - Sealed Morai Circlet (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause circlet_180">Recipe - Sealed Morai Circlet (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause tunic_90">Recipe - Sealed Morai Tunic (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause tunic_180">Recipe - Sealed Morai Tunic (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause stockings_90">Recipe - Sealed Morai Stockings (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause stockings_180">Recipe - Sealed Morai Stockings (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause gloves_90">Recipe - Sealed Morai Gloves (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause gloves_180">Recipe - Sealed Morai Gloves (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause shoes_90">Recipe - Sealed Morai Shoes (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause shoes_180">Recipe - Sealed Morai Shoes (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause sigil_90">Recipe - Sealed Morai Sigil (60%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause sigil_180">Recipe - Sealed Morai Sigil (60%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause ring_90">Recipe - Sealed Morai Ring (70%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause ring_180">Recipe - Sealed Morai Ring (70%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause earring_90">Recipe - Sealed Morai Earring (70%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause earring_180">Recipe - Sealed Morai Earring (70%)(Requires 180 Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause necklace_90">Recipe - Sealed Morai Necklace (70%)(Requires 90 Fallen Mucrokian Hides)</a>
+<a action="bypass -h Quest 309_ForAGoodCause necklace_180">Recipe - Sealed Morai Necklace (70%)(Requires 180 Mucrokian Hides)</a>
</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-13.htm
===================================================================
--- dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-13.htm (revision 8398)
+++ dist/game/data/scripts/quests/Q309_ForAGoodCause/32647-13.htm (working copy)
@@ -1,5 +1,6 @@
<html><body>Apprentice Atra:<br>
How about receiving the reward before you quit? I'm just letting you know since there is an evidence of hunting.<br>
-<a action="bypass -h Quest 309_ForAGoodCause claimreward">Submit proofs.</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause claimreward">Check reward list.</a><br>
+<a action="bypass -h Quest 309_ForAGoodCause receivepiece">Receive Moirai Robe Set ingredient item (requires 100 Mucrokian skins).</a><br>
<a action="bypass -h Quest 309_ForAGoodCause 32647-14.htm">Just quit the task.</a>
</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/quests/Q309_ForAGoodCause/Q309_ForAGoodCause.java
===================================================================
--- dist/game/data/scripts/quests/Q309_ForAGoodCause/Q309_ForAGoodCause.java (revision 0)
+++ dist/game/data/scripts/quests/Q309_ForAGoodCause/Q309_ForAGoodCause.java (revision 0)
@@ -0,0 +1,348 @@
+/*
+ * 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.Q309_ForAGoodCause;
+
+import com.l2jserver.gameserver.model.L2ItemInstance;
+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.serverpackets.InventoryUpdate;
+import com.l2jserver.gameserver.util.Util;
+import com.l2jserver.util.Rnd;
+
+/**
+ * @author nonom
+ */
+
+public class Q309_ForAGoodCause extends Quest
+{
+ private static final String qn = "309_ForAGoodCause";
+ // NPC's
+ private static final int _atra = 32647;
+
+
+ /*
+ * Detailed H5 Retail info
+ *
+ Recipe - Sealed Dynasty Earrings 70% 96 Fallen Mucrokian Hide
+ Recipe - Sealed Dynasty Earrings 70% 192 Mucrokain Hide
+ Recipe - Sealed Dynasty Necklace 70% 128 Fallen Mucrokian Hide
+ Recipe - Sealed Dynasty Necklace 70% 256 Mucrokian Hide
+ Recipe - Sealed Dynasty Ring 70% 64 Fallen Muckrokian Hide
+ Recipe - Sealed Dynasty Ring 70% 128 Muckrokian Hide
+ Recipe - Sealed Dynasty Sigil 70% 103 Fallen Muckrokian Hide
+ Recipe - Sealed Dynasty Sigil 70% 206 Muckrokian Hide
+
+ Recipe - Sealed Morai Circlet 60% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Circlet 60% 180 Muckrokian Hide
+ Recipe - Sealed Morai Tunic 60% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Tunic 60% 180 Muckrokian Hide
+ Recipe - Sealed Morai Stockings 60% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Stockings 60% 180 Muckrokian Hide
+ Recipe - Sealed Morai Gloves 60% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Gloves 60% 180 Muckrokian Hide
+ Recipe - Sealed Morai Shoes 60 % 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Shoes 60% 180 Muckrokian Hide
+ Recipe - Sealed Morai Sigil 60% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Sigil 60% 180 Muckrokian Hide
+ Recipe - Sealed Morai Ring 70% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Ring 70% 180 Muckrokian Hide
+ Recipe - Sealed Morai Earring 70% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Earring 70% 180 Muckrokian Hide
+ Recipe - Sealed Morai Necklace 70% 90 Fallen Muckrokian Hide
+ Recipe - Sealed Morai Necklace 70% 180 Muckrokian Hide
+
+ */
+
+ //Rewards
+ private static final int[] MUCROKIANS = {22650, 22651, 22652, 22653};
+ private static final int MUCROKIAN_FANATIC = 22650;
+ private static final int MUCROKIAN_ASCETIC = 22651;
+ private static final int MUCROKIAN_SAVIOR = 22652;
+ private static final int MUCROKIAN_PREACHER = 22653;
+ private static final int CONTAMINATED_MUCROKIAN = 22654;
+ private static final int CHANGED_MUCROKIAN = 22655;
+
+ private static final int MUCROKIAN_HIDE = 14873;
+ private static final int FALLEN_MUCROKIAN_HIDE = 14874;
+
+ private static final int MUCROKIAN_HIDE_CHANCE = 85;
+ private static final int FALLEN_HIDE_CHANCE = 85;
+
+ private static final int REC_DYNASTY_EARRINGS_70 = 9985;
+ private static final int REC_DYNASTY_NECKLACE_70 = 9986;
+ private static final int REC_DYNASTY_RING_70 = 9987;
+ private static final int REC_DYNASTY_SIGIL_60 = 10115;
+
+ private static final int REC_MOIRAI_CIRCLET_60 = 15777;
+ private static final int REC_MOIRAI_TUNIC_60 = 15780;
+ private static final int REC_MOIRAI_STOCKINGS_60 = 15783;
+ private static final int REC_MOIRAI_GLOVES_60 = 15786;
+ private static final int REC_MOIRAI_SHOES_60 = 15789;
+ private static final int REC_MOIRAI_SIGIL_60 = 15790;
+ private static final int REC_MOIRAI_EARRING_70 = 15814;
+ private static final int REC_MOIRAI_NECKLACE_70 = 15813;
+ private static final int REC_MOIRAI_RING_70 = 15812;
+
+ private static final int[] MOIRAI_PIECES = {15645,15646,15647,15648,15649,15650,15651,15652,15653,15654};
+
+ public Q309_ForAGoodCause(int questId, String name, String descr)
+ {
+ super(questId, name, descr);
+
+ addStartNpc(_atra);
+ addTalkId(_atra);
+
+ addKillId(MUCROKIAN_FANATIC);
+ addKillId(MUCROKIAN_ASCETIC);
+ addKillId(MUCROKIAN_SAVIOR);
+ addKillId(MUCROKIAN_PREACHER);
+ addKillId(CONTAMINATED_MUCROKIAN);
+ addKillId(CHANGED_MUCROKIAN);
+ }
+
+ @Override
+ public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+ {
+ String htmltext = event;
+ QuestState st = player.getQuestState(qn);
+ QuestState qs = player.getQuestState("239_WontYouJoinUs");
+
+ if (st == null || qs == null)
+ return htmltext;
+
+ if (event.equalsIgnoreCase("32020-03.htm"))
+ {
+ st.setState(State.STARTED);
+ st.set("cond", "1");
+ st.playSound("ItemSound.quest_accept");
+ }
+ else if (event.equalsIgnoreCase("claimreward"))
+ {
+ if (qs != null)
+ if (qs.getState() == State.COMPLETED)
+ htmltext = "32647-11.htm";
+ else
+ htmltext = "32647-10.htm";
+
+ htmltext = "32647-09.htm";
+ }
+ else if (event.equalsIgnoreCase("claimreward"))
+ {
+ if (Integer.parseInt(event) == 288 || Integer.parseInt(event) == 346)
+ player.addItem("Quest Item", REC_DYNASTY_EARRINGS_70, 1, npc,false);
+
+ htmltext = "32647-09.htm";
+ }
+ else if (event.equalsIgnoreCase("receivepiece"))
+ {
+ //Guess 4
+ exchangeQuesItems(player, npc, MOIRAI_PIECES[Rnd.get(MOIRAI_PIECES.length-1)], 4, MUCROKIAN_HIDE, 100);
+ }
+ else if(isIntNumber(event))
+ {
+ if (Integer.parseInt(event) == 96)
+ exchangeQuesItems(player, npc, REC_DYNASTY_EARRINGS_70, 1, FALLEN_MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 192)
+ exchangeQuesItems(player, npc, REC_DYNASTY_EARRINGS_70, 1, MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 128)
+ exchangeQuesItems(player, npc, REC_DYNASTY_NECKLACE_70, 1, FALLEN_MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 256)
+ exchangeQuesItems(player, npc, REC_DYNASTY_NECKLACE_70, 1, MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 64)
+ exchangeQuesItems(player, npc, REC_DYNASTY_RING_70, 1, FALLEN_MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 128)
+ exchangeQuesItems(player, npc, REC_DYNASTY_RING_70, 1, MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 103)
+ exchangeQuesItems(player, npc, REC_DYNASTY_SIGIL_60, 1, FALLEN_MUCROKIAN_HIDE, Integer.parseInt(event));
+ else if (Integer.parseInt(event) == 296)
+ exchangeQuesItems(player, npc, REC_DYNASTY_SIGIL_60, 1, MUCROKIAN_HIDE, Integer.parseInt(event));
+ }
+ else if(event.startsWith("circlet"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_CIRCLET_60, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_CIRCLET_60, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("stockings"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_STOCKINGS_60, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_STOCKINGS_60, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("tunic"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_TUNIC_60, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_TUNIC_60, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("gloves"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_GLOVES_60, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_GLOVES_60, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("shoes"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_SHOES_60, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_SHOES_60, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("sigil"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_SIGIL_60, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_SIGIL_60, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("earring"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_EARRING_70, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_EARRING_70, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("necklace"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_NECKLACE_70, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_NECKLACE_70, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if(event.startsWith("ring"))
+ {
+ if (event.endsWith("90"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_RING_70, 1, FALLEN_MUCROKIAN_HIDE, 90);
+ else if (event.endsWith("180"))
+ exchangeQuesItems(player, npc, REC_MOIRAI_RING_70, 1, MUCROKIAN_HIDE, 180);
+ }
+ else if (event.equalsIgnoreCase("32020-03.htm") || event.equalsIgnoreCase("32020-03.htm"))
+ {
+ st.exitQuest(true);
+ st.playSound("ItemSound.quest_finish");
+ }
+ return htmltext;
+ }
+
+ protected boolean isIntNumber(String num){
+ try{
+ Integer.parseInt(num);
+ } catch(NumberFormatException nfe) {
+ return false;
+ }
+ return true;
+ }
+
+
+ @Override
+ public String onTalk(L2Npc npc, L2PcInstance player)
+ {
+ String htmltext = getNoQuestMsg(player);
+ QuestState st = player.getQuestState(qn);
+ if (st == null)
+ return htmltext;
+
+ if (npc.getNpcId() == _atra)
+ {
+ switch (st.getState())
+ {
+ case State.CREATED:
+ QuestState _prev = player.getQuestState("308_ReedFieldMaintenance");
+ if ((_prev != null) && (_prev.getState() == State.COMPLETED))
+ htmltext = "32647-17.htm";
+ else
+ htmltext = "Miss HTM here";
+
+ case State.STARTED:
+ if (st.getInt("cond") == 0)
+ if (player.getLevel() >= 82)
+ htmltext = "32647-01.htm";
+ else
+ htmltext = "32647-00.htm";
+ else if (st.getQuestItemsCount(MUCROKIAN_HIDE) >= 1 || st.getQuestItemsCount(FALLEN_MUCROKIAN_HIDE) >= 1)
+ htmltext = "32647-08.htm";
+ else
+ htmltext = "32647-06.htm";
+ break;
+ case State.COMPLETED:
+ htmltext = "32647-15.htm";
+ break;
+ }
+ }
+ return htmltext;
+ }
+
+ public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
+ {
+
+ QuestState st = player.getQuestState(qn);
+
+ if (st == null)
+ return null;
+
+ if(st.getInt("cond") == 1)
+ {
+ if (Util.contains(MUCROKIANS,npc.getNpcId()))
+ if (st.getRandom(100) < MUCROKIAN_HIDE_CHANCE){
+ st.giveItems(MUCROKIAN_HIDE,1);
+ st.playSound("ItemSound.quest_itemget");
+ }
+ else if (npc.getNpcId()==CHANGED_MUCROKIAN)
+ if (st.getRandom(100) < FALLEN_HIDE_CHANCE){
+ st.giveItems(FALLEN_MUCROKIAN_HIDE,1);
+ st.playSound("ItemSound.quest_itemget");
+ }
+ else if (npc.getNpcId()==CONTAMINATED_MUCROKIAN)
+ if (st.getRandom(100) < 10){
+ st.giveItems(MUCROKIAN_HIDE,1);
+ st.playSound("ItemSound.quest_itemget");
+ }
+ }
+
+ return super.onKill(npc, player, isPet);
+ }
+
+ private void exchangeQuesItems(L2PcInstance player, L2Npc npc, int giveid, int givequanty, int takeid, int takequanty)
+ {
+
+ L2ItemInstance Item = player.getInventory().destroyItemByItemId("MucrokianHide", takeid, takequanty, player, npc);
+
+ if (Item != null)
+ {
+ // Prepare inventory update packet
+ InventoryUpdate playerIU = new InventoryUpdate();
+ playerIU.addRemovedItem(Item);
+
+ // Add new Item
+ Item = player.getInventory().addItem("Recipe", giveid, givequanty, player, npc);
+ playerIU.addItem(Item);
+
+ // Send inventory update packet
+ player.sendPacket(playerIU);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new Q309_ForAGoodCause(309, qn, "For A Good Cause");
+ }
+}
Index: dist/game/data/scripts/quests/Q309_ForAGoodCause/__init__.py
===================================================================
--- dist/game/data/scripts/quests/Q309_ForAGoodCause/__init__.py (revision 8398)
+++ dist/game/data/scripts/quests/Q309_ForAGoodCause/__init__.py (working copy)
@@ -1,150 +0,0 @@
-#Created by Bloodshed
-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 = "309_ForAGoodCause"
-
-ATRA = 32647
-
-MUCROKIANS = [22650, 22651, 22652, 22653]
-MUCROKIAN_FANATIC = 22650
-MUCROKIAN_ASCETIC = 22651
-MUCROKIAN_SAVIOR = 22652
-MUCROKIAN_PREACHER = 22653
-CONTAMINATED_MUCROKIAN = 22654
-CHANGED_MUCROKIAN = 22655
-
-MUCROKIAN_HIDE = 14873
-FALLEN_MUCROKIAN_HIDE = 14874
-
-MUCROKIAN_HIDE_CHANCE = 50
-FALLEN_HIDE_CHANCE = 50
-
-REC_DYNASTY_EARRINGS_70 = 9985
-REC_DYNASTY_NECKLACE_70 = 9986
-REC_DYNASTY_RING_70 = 9987
-REC_DYNASTY_SIGIL_60 = 10115
-
-class Quest (JQuest) :
-
- def __init__(self,id,name,descr):
- JQuest.__init__(self,id,name,descr)
- self.questItemIds = [MUCROKIAN_HIDE, FALLEN_MUCROKIAN_HIDE]
-
- def onRecipeExchangeRequest (self,event,st,recipe) :
- h1 = st.getQuestItemsCount(MUCROKIAN_HIDE)
- h2 = st.getQuestItemsCount(FALLEN_MUCROKIAN_HIDE)
- if h2 >= 1:
- if h2 >= (int(event)/2) :
- st.giveItems(recipe,1)
- st.takeItems(FALLEN_MUCROKIAN_HIDE,(int(event)/2))
- st.playSound("ItemSound.quest_finish")
- return "32647-16.htm"
- else :
- h1a = int(event) - (h2*2)
- if h1 >= h1a :
- st.giveItems(recipe,1)
- st.takeItems(FALLEN_MUCROKIAN_HIDE,h2)
- st.takeItems(MUCROKIAN_HIDE,h1a)
- st.playSound("ItemSound.quest_finish")
- return "32647-16.htm"
- else :
- return "32647-15.htm"
- elif h1 >= int(event) :
- st.giveItems(recipe,1)
- st.takeItems(MUCROKIAN_HIDE,int(event))
- st.playSound("ItemSound.quest_finish")
- return "32647-16.htm"
- else :
- return "32647-15.htm"
-
- def onAdvEvent (self,event,npc,player) :
- htmltext = event
- st = player.getQuestState(qn)
- qs = player.getQuestState("239_WontYouJoinUs")
- if not st : return
- if event == "32647-05.htm" :
- self.questItemIds = [MUCROKIAN_HIDE, FALLEN_MUCROKIAN_HIDE]
- st.set("cond","1")
- st.setState(State.STARTED)
- st.playSound("ItemSound.quest_accept")
- elif event == "claimreward" :
- if qs :
- if qs.getState() == State.COMPLETED :
- htmltext = "32647-11.htm"
- else :
- htmltext = "32647-10.htm"
- else :
- htmltext = "32647-09.htm"
- elif event.isdigit() :
- if int(event) == 288 or int(event) == 346 :
- htmltext = self.onRecipeExchangeRequest(event,st,REC_DYNASTY_EARRINGS_70)
- elif int(event) == 384 or int(event) == 462 :
- htmltext = self.onRecipeExchangeRequest(event,st,REC_DYNASTY_NECKLACE_70)
- elif int(event) == 192 or int(event) == 232 :
- htmltext = self.onRecipeExchangeRequest(event,st,REC_DYNASTY_RING_70)
- elif int(event) == 310 or int(event) == 372 :
- htmltext = self.onRecipeExchangeRequest(event,st,REC_DYNASTY_SIGIL_60)
- elif event == "32647-14.htm" or event == "32647-07.htm" :
- self.questItemIds = [] #NPC Quest Cancel does not remove the collected Quest Items.
- st.exitQuest(1)
- st.playSound("ItemSound.quest_finish")
- return htmltext
-
- def onTalk (self,npc,player) :
- htmltext = Quest.getNoQuestMsg(player)
- st = player.getQuestState(qn)
- if not st : return htmltext
-
- npcId = npc.getNpcId()
- cond = st.getInt("cond")
- qs2 = player.getQuestState("308_ReedFieldMaintenance")
- if npcId == ATRA :
- if qs2 and qs2.getState() == State.STARTED :
- htmltext = "32647-17.htm"
- elif cond == 0 :
- if player.getLevel() >= 82 :
- htmltext = "32647-01.htm"
- else :
- htmltext = "32647-00.htm"
- st.exitQuest(1)
- elif st.getState() == State.STARTED :
- if st.getQuestItemsCount(MUCROKIAN_HIDE) >= 1 or st.getQuestItemsCount(FALLEN_MUCROKIAN_HIDE) >= 1:
- htmltext = "32647-08.htm"
- else :
- htmltext = "32647-06.htm"
- return htmltext
-
- def onKill(self,npc,player,isPet) :
- st = player.getQuestState(qn)
- if not st : return
- if st.getState() != State.STARTED : return
- npcId = npc.getNpcId()
- cond = st.getInt("cond")
- if cond == 1 and npcId in MUCROKIANS :
- if st.getRandom(100) < MUCROKIAN_HIDE_CHANCE :
- st.giveItems(MUCROKIAN_HIDE,1)
- st.playSound("ItemSound.quest_itemget")
- elif cond == 1 and npcId == CHANGED_MUCROKIAN :
- if st.getRandom(100) < FALLEN_HIDE_CHANCE :
- st.giveItems(FALLEN_MUCROKIAN_HIDE,1)
- st.playSound("ItemSound.quest_itemget")
- elif cond == 1 and npcId == CONTAMINATED_MUCROKIAN :
- if st.getRandom(100) < 10 :
- st.giveItems(MUCROKIAN_HIDE,1)
- st.playSound("ItemSound.quest_itemget")
- return
-
-QUEST = Quest(309,qn,"For A Good Cause")
-
-QUEST.addStartNpc(ATRA)
-QUEST.addTalkId(ATRA)
-
-QUEST.addKillId(MUCROKIAN_FANATIC)
-QUEST.addKillId(MUCROKIAN_ASCETIC)
-QUEST.addKillId(MUCROKIAN_SAVIOR)
-QUEST.addKillId(MUCROKIAN_PREACHER)
-QUEST.addKillId(CONTAMINATED_MUCROKIAN)
-QUEST.addKillId(CHANGED_MUCROKIAN)
\ No newline at end of file