From 6484d93c0f2fd965cc80bbbbaf9d453f10c81dad Mon Sep 17 00:00:00 2001
From: xban1x <urban.lavbic@gmail.com>
Date: Tue, 21 Oct 2014 18:48:27 +0000
Subject: [PATCH] BETA: Quest Q00299_GatherIngredientsForPie in Java. 	*
 Reviewed by: ivantotov

---
 .../299_GatherIngredientsForPie/30063-1.htm   |   1 -
 .../299_GatherIngredientsForPie/30466-0.htm   |   2 -
 .../299_GatherIngredientsForPie/30620-0.htm   |   1 -
 .../299_GatherIngredientsForPie/30620-1.htm   |   4 -
 .../299_GatherIngredientsForPie/30620-2.htm   |   3 -
 .../299_GatherIngredientsForPie/30620-3.htm   |   1 -
 .../299_GatherIngredientsForPie/30620-4.htm   |   2 -
 .../299_GatherIngredientsForPie/30620-6.htm   |   3 -
 .../299_GatherIngredientsForPie/__init__.py   | 116 -------
 .../30063-01.html}                            |   5 +-
 .../30063-02.html                             |   3 +
 .../30063-03.html                             |   3 +
 .../30466-01.html                             |   4 +
 .../30466-02.html}                            |   3 +-
 .../30466-03.html                             |   3 +
 .../30620-01.htm}                             |   2 +-
 .../30620-02.htm                              |   4 +
 .../30620-03.htm                              |   4 +
 .../30620-04.html                             |   4 +
 .../30620-05.html                             |   3 +
 .../30620-06.html                             |   3 +
 .../30620-07.html                             |   3 +
 .../30620-08.html                             |   3 +
 .../30620-09.html                             |   4 +
 .../30620-10.html}                            |   2 +-
 .../30620-11.html                             |   3 +
 .../30620-12.html                             |   3 +
 .../30620-13.html                             |   4 +
 .../30620-14.html}                            |   5 +-
 .../30620-15.html                             |   3 +
 .../Q00299_GatherIngredientsForPie.java       | 284 ++++++++++++++++++
 .../scripts/quests/QuestMasterHandler.java    |   2 +
 .../dist/sql/game/updates/20141021update.sql  |   1 +
 33 files changed, 351 insertions(+), 140 deletions(-)
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-1.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-0.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-1.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-2.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-3.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-4.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-6.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/__init__.py
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{299_GatherIngredientsForPie/30063-0.htm => Q00299_GatherIngredientsForPie/30063-01.html} (55%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-02.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-03.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-01.html
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{299_GatherIngredientsForPie/30466-1.htm => Q00299_GatherIngredientsForPie/30466-02.html} (59%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-03.html
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{299_GatherIngredientsForPie/30620-0a.htm => Q00299_GatherIngredientsForPie/30620-01.htm} (85%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-02.htm
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-03.htm
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-04.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-05.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-06.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-07.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-08.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-09.html
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{299_GatherIngredientsForPie/30620-5.htm => Q00299_GatherIngredientsForPie/30620-10.html} (83%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-11.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-12.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-13.html
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{299_GatherIngredientsForPie/30620-7.htm => Q00299_GatherIngredientsForPie/30620-14.html} (66%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-15.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/Q00299_GatherIngredientsForPie.java
 create mode 100644 L2J_DataPack_BETA/dist/sql/game/updates/20141021update.sql

diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-1.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-1.htm
deleted file mode 100644
index c46c9e9715..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-1.htm
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Grocer Lara:<br>The fruit aroma is pleasant, isn't it? The spice is specially imported! Please take it to Emily.</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-0.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-0.htm
deleted file mode 100644
index 4cf63b5fc5..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-0.htm
+++ /dev/null
@@ -1,2 +0,0 @@
-<html><body>Guard Bright:<br>
-You again? I'm on duty! What do you need?<br><a action="bypass -h Quest 299_GatherIngredientsForPie 30466-1.htm">Your mother sent me.</a></body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0.htm
deleted file mode 100644
index cb8cb1ca00..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0.htm
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Emily:<br>Do I sound suspicious? At one time, this village was renowned for its hospitality... But then, something terrible happened here... We've been very wary of strangers since that dark day!<br>But recently, there have been promising signs... High Priest Sylvan is planning a small tea party after the Sunday worship service at the temple. Worshippers and visitors are all invited! Hopefully, this will bring our village back to life! I want to bake some pies for the party, but I'm out of honey. Could you help me?<br><a action="bypass -h Quest 299_GatherIngredientsForPie 30620-1.htm">I'll help you.</a></body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-1.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-1.htm
deleted file mode 100644
index 0cdc2cf90a..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-1.htm
+++ /dev/null
@@ -1,4 +0,0 @@
-<html><body>Emily:<br>
-The highest quality honey can be found in the beehive, but the insects that guard it are actually wasps! These wasps store honey in a organ called a honey sac inside their body. This is by far the finest honey, but it's extreamely scarce! To make a pie I'll need at least 100 honey sacs! Get them by killing<font color="LEVEL"> wasp leaders</font> and<font color="LEVEL"> wasp workers</font>.<br>
-Get<font color="LEVEL"> 100 honey sacs</font> and bring them to me.
-</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-2.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-2.htm
deleted file mode 100644
index 554bc241fb..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-2.htm
+++ /dev/null
@@ -1,3 +0,0 @@
-<html><body>Emily:<br>
-Oh... Very impressive! That was quick work! But now what am I going to do? I don't have the spice I need for the pie! Could you get some for me? You can't bake a fruit pie without fruit spice! Will you help me again?<br>
-<a action="bypass -h Quest 299_GatherIngredientsForPie 30620-3.htm">I'll help you.</a></body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-3.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-3.htm
deleted file mode 100644
index 4f995efd21..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-3.htm
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Emily:<br>Please go to Grocer Lara in the Magic Shop in Dion. She will have a spice for me</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-4.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-4.htm
deleted file mode 100644
index d89a112d8c..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-4.htm
+++ /dev/null
@@ -1,2 +0,0 @@
-<html><body>Emily:<br>Oh, wonderful! You brought the spice! You're my hero! But, you see, I've got a problem... There's just one more thing...<br>
-<a action="bypass -h Quest 299_GatherIngredientsForPie 30620-5.htm">OK, I'll help you again.</a></body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-6.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-6.htm
deleted file mode 100644
index 9d1003a56d..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-6.htm
+++ /dev/null
@@ -1,3 +0,0 @@
-<html><body>Emily:<br>
-Ah, you're back already? Since I've gotten old, when it's cold and damp like this, I can't move around because of my bad knees. Did you bring me the fruit basket?<br>
-<a action="bypass -h Quest 299_GatherIngredientsForPie 30620-7.htm">Here's your fruit basket.</a></body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/__init__.py
deleted file mode 100644
index 656f72032c..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/__init__.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# Made by disKret
-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
-
-qn = "299_GatherIngredientsForPie"
-
-#NPC
-LARA = 30063
-BRIGHT = 30466
-EMILY = 30620
-
-#MOBS
-WASP_WORKER = 20934
-WASP_LEADER = 20935
-
-#ITEMS
-FRUIT_BASKET = 7136
-AVELLAN_SPICE = 7137
-HONEY_POUCH = 7138
-
-#REWARDS
-ADENA = 57
-VARNISH = 1865
-
-class Quest (JQuest) :
-
- def __init__(self,id,name,descr):
-     JQuest.__init__(self,id,name,descr)
-     self.questItemIds = [HONEY_POUCH, AVELLAN_SPICE, FRUIT_BASKET]
-
- def onAdvEvent (self,event,npc, player) :
-   htmltext = event
-   st = player.getQuestState(qn)
-   if not st : return
-   cond = st.getInt("cond")
-   if event == "30620-1.htm" :
-     st.set("cond","1")
-     st.setState(State.STARTED)
-     st.playSound("ItemSound.quest_accept")
-   elif event == "30620-3.htm" and st.getQuestItemsCount(HONEY_POUCH)==100:
-     st.takeItems(HONEY_POUCH,100)
-     st.set("cond","3")
-   elif event == "30063-1.htm" and cond == 3:
-     st.giveItems(AVELLAN_SPICE,1)
-     st.set("cond","4")
-   elif event == "30620-5.htm" and st.getQuestItemsCount(AVELLAN_SPICE):
-     st.takeItems(AVELLAN_SPICE,1)
-     st.set("cond","5")
-   elif event == "30466-1.htm" and cond == 5:
-     st.giveItems(FRUIT_BASKET,1)
-     st.set("cond","6")
-   elif event == "30620-7.htm" and st.getQuestItemsCount(FRUIT_BASKET):
-     st.takeItems(FRUIT_BASKET,1)
-     st.giveItems(ADENA,25000)
-     st.giveItems(VARNISH,50)
-     st.unset("cond")
-     st.playSound("ItemSound.quest_finish")
-     st.exitQuest(1)
-   return htmltext
-
- def onTalk (self,npc,player):
-   htmltext = Quest.getNoQuestMsg(player)
-   st = player.getQuestState(qn)
-   if not st : return htmltext
-
-   npcId = npc.getId()
-   id = st.getState()
-   if npcId != 30620 and id != State.STARTED : return htmltext
-
-   cond = st.getInt("cond")
-   if npcId == EMILY and cond == 0 :
-     if player.getLevel() >= 34 and player.getLevel() <= 40 :
-       htmltext = "30620-0.htm"
-     else:
-       htmltext = "30620-0a.htm"
-       st.exitQuest(1)
-   elif npcId == EMILY and st.getQuestItemsCount(HONEY_POUCH) == 100 :
-     htmltext = "30620-2.htm"
-   elif npcId == LARA and cond == 3 :
-     htmltext = "30063-0.htm"
-   elif npcId == EMILY and st.getQuestItemsCount(AVELLAN_SPICE) == 1 :
-     htmltext = "30620-4.htm"
-   elif npcId == BRIGHT and cond == 5 :
-     htmltext = "30466-0.htm"
-   elif npcId == EMILY and st.getQuestItemsCount(FRUIT_BASKET) == 1 :
-     htmltext = "30620-6.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.getId()
-   count = st.getQuestItemsCount(HONEY_POUCH)
-   if st.getInt("cond") == 1 and count < 100 :
-     st.giveItems(HONEY_POUCH,1)
-     if count == 99 :
-       st.playSound("ItemSound.quest_middle")
-       st.set("cond","2")
-     else :
-       st.playSound("ItemSound.quest_itemget")  
-   return
-
-QUEST       = Quest(299,qn,"Gather Ingredients For A Pie")
-
-QUEST.addStartNpc(30620)
-QUEST.addTalkId(30620)
-
-QUEST.addTalkId(30063)
-QUEST.addTalkId(30466)
-
-QUEST.addKillId(WASP_LEADER)
-QUEST.addKillId(WASP_WORKER)
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-0.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-01.html
similarity index 55%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-0.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-01.html
index e9196e0400..6cbd031ee9 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-0.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-01.html
@@ -1,4 +1,5 @@
-<html><body>Grocer Lara:<br>
+<html><body>Trader Lara:<br>
 Emily's imported spice just arrived. Here, take a sniff! Isn't it fragrant?<br>
 As she requested, I ordered a wonderfully aromatic spice! She'll be able to bake a delicious pie!<br>
-<a action="bypass -h Quest 299_GatherIngredientsForPie 30063-1.htm">I'll take it to her.</a></body></html>
\ No newline at end of file
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30063-02.html">"I'll take it to her."</a>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-02.html
new file mode 100644
index 0000000000..854abe5179
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-02.html
@@ -0,0 +1,3 @@
+<html><body>Trader Lara:<br>
+The fruit aroma is pleasant, isn't it? The spice is specially imported! Please take it to Emily.
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-03.html
new file mode 100644
index 0000000000..2bd65fa964
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-03.html
@@ -0,0 +1,3 @@
+<html><body>Trader Lara:<br>
+Why haven't  you returned to Emily yet? Deliver it to her before the fragrance of the spice dissipates. She must be waiting, so please hurry!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-01.html
new file mode 100644
index 0000000000..3d20110f56
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-01.html
@@ -0,0 +1,4 @@
+<html><body>Guard Bright:<br>
+You again? I'm on duty! What do you need?<br>
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30466-02.html">"Your mother sent me."</a>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-1.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-02.html
similarity index 59%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-1.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-02.html
index 80e0285817..1088b826a7 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-1.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-02.html
@@ -1,3 +1,4 @@
 <html><body>Guard Bright:<br>
 My mother? Oh yeah, she asked for some fruit. Her bad knee keeps her in the house.<br>
-Can you take her this basket? I can't leave my post. Thank you!</body></html>
\ No newline at end of file
+Can you take her this basket? I can't leave my post. Thank you!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-03.html
new file mode 100644
index 0000000000..f67214516a
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-03.html
@@ -0,0 +1,3 @@
+<html><body>Guard Bright:<br>
+Keep it down! I'm on duty here. Are you done? Find someone else to bother.
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0a.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-01.htm
similarity index 85%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0a.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-01.htm
index 1d1525aabc..1841c26e92 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0a.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-01.htm
@@ -1,5 +1,5 @@
 <html><body>Emily:<br>
 Do I sound suspicious? At one time, this village was renowned for its hospitality... But then, something terrible happened here... We've been very wary of strangers since that dark day!<br>
 But recently, there have been promising signs... High Priest Sylvan is planning a small tea party after the Sunday worship service at the temple. Worshippers and visitors are all invited! Hopefully, this will bring our village back to life! I want to bake some pies for the party, but I'm out of honey. Could you help me?<br>
-(Quest for characters level between 34 and 40)
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30620-03.htm">"I'll help you."</a>
 </body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-02.htm
new file mode 100644
index 0000000000..3a98c667d8
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-02.htm
@@ -0,0 +1,4 @@
+<html><body>Emily:<br>
+I'd like to take you up on your offer, stranger, but catching bees isn't for the inexperienced. Come back later.<br>
+(Only a character of level 34 or above may undertake this quest.)
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-03.htm
new file mode 100644
index 0000000000..beb7c71e1b
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-03.htm
@@ -0,0 +1,4 @@
+<html><body>Emily:<br>
+The highest quality honey can be found in the Beehive, but the insects that guard it are actually wasps! These wasps store honey in a organ called a honey sac inside their body. This is by far the finest honey, but it's extremely scarce! To make a pie I'll need at least 100 honey sacs! Get them by killing <font color="LEVEL">Wasp Leaders</font> and <font color="LEVEL">Wasp Workers</font>.<br>
+Get <font color="LEVEL">100 honey sacs</font> and bring them to me.
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-04.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-04.html
new file mode 100644
index 0000000000..563c12cee3
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-04.html
@@ -0,0 +1,4 @@
+<html><body>Emily:<br>
+Oh.... Very impressive! That was quick work! But now what am I going to do? I don't have the spice I need for the pie! Could you get some for me? You can't bake a fruit pie without fruit spice! Will you help me again?<br>
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30620-06.html">"I'll help you."</a>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-05.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-05.html
new file mode 100644
index 0000000000..7285791cc5
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-05.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+Hello again! How's the collection of honey sacs going? I need at least 100 honey sacs. Get busy!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-06.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-06.html
new file mode 100644
index 0000000000..bd0f008f00
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-06.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+Oh, thank you! Please go and see Miss Lara in the village. She knows the kind of fruit spice I want!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-07.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-07.html
new file mode 100644
index 0000000000..987cf983f7
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-07.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+These aren't enough honey sacs! Don't you realize I need to make enough pies for the villagers and the visitors alike? I'll need at least 100 honey sacs!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-08.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-08.html
new file mode 100644
index 0000000000..8bdba1c07e
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-08.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+Why are you still here? I need that fruit spice! Get going, you loafer!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-09.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-09.html
new file mode 100644
index 0000000000..4b5cf597b4
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-09.html
@@ -0,0 +1,4 @@
+<html><body>Emily:<br>
+Oh, wonderful! You brought the spice! You're my hero! But, you see, I've got a problem... There's just one more thing...<br>
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30620-10.html">"OK, I'll help you again."</a>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-5.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-10.html
similarity index 83%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-5.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-10.html
index 306c9b6602..62b4f6120e 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-5.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-10.html
@@ -1,4 +1,4 @@
 <html><body>Emily:<br>
 My son Bright stands guard at the front gate. He's not allowed to leave his post for personal reasons while he's on duty. When the weather is bad like this, my knees hurt so badly I can't walk!<br>
-Occasionally my son has to leave his post to chase a criminal. Would you go and find him? Get a fruit basket from him and bring it to me. I can't walk a step!
+Occasionally my son has to leave his post to chase a criminal. Would you go and find him? Get a Fruit Basket from him and bring it to me. I can't walk a step!
 </body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-11.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-11.html
new file mode 100644
index 0000000000..aa8867ca62
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-11.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+I thought you had the spice I needed, but I don't see it on you. Go to the grocery store and get it from Trader Lara!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-12.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-12.html
new file mode 100644
index 0000000000..7035e4ebb1
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-12.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+You haven't seen my son Bright yet? It won't take long... Please help me!
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-13.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-13.html
new file mode 100644
index 0000000000..6c874107f8
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-13.html
@@ -0,0 +1,4 @@
+<html><body>Emily:<br>
+Ah, you're back already? Since I've gotten old, when it's cold and damp like this, I can't move around because of my bad knees. Did you bring me the Fruit Basket?<br>
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30620-14.html">"Here's your Fruit Basket."</a>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-7.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-14.html
similarity index 66%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-7.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-14.html
index f36685149a..8207cd450a 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-7.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-14.html
@@ -1,3 +1,4 @@
 <html><body>Emily:<br>
-You brought the fruit basket! It's so refreshing to see a young person that is so helpful! Thank you kindly, dear!<br>
-I'll be baking pies every weekend for the tea at the temple, so if you need something to do, come back and see me! Here's a little something for you.</body></html>
\ No newline at end of file
+You brought the Fruit Basket! It's so refreshing to see a young person that is so helpful! Thank you kindly, dear!<br>
+I'll be baking pies every weekend for the tea at the temple, so if you need something to do, come back and see me! Here's a little something for you.
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-15.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-15.html
new file mode 100644
index 0000000000..641d205a84
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-15.html
@@ -0,0 +1,3 @@
+<html><body>Emily:<br>
+Didn't you say that you brought the Fruit Basket? Well, where is it? Look, my son's just right around the corner. Go get it for me, would you?
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/Q00299_GatherIngredientsForPie.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/Q00299_GatherIngredientsForPie.java
new file mode 100644
index 0000000000..3049fe6e88
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/Q00299_GatherIngredientsForPie.java
@@ -0,0 +1,284 @@
+/*
+ * Copyright (C) 2004-2014 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.Q00299_GatherIngredientsForPie;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.holders.QuestItemHolder;
+import com.l2jserver.gameserver.model.quest.Quest;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.model.quest.State;
+
+/**
+ * Gather Ingredients for Pie (299)
+ * @author xban1x
+ */
+public final class Q00299_GatherIngredientsForPie extends Quest
+{
+	// NPCs
+	private static final int LARS = 30063;
+	private static final int BRIGHT = 30466;
+	private static final int EMILLY = 30620;
+	// Monsters
+	private static final Map<Integer, Integer> MONSTERS_CHANCES = new HashMap<>(2);
+	// Items
+	private static final int FRUIT_BASKET = 7136;
+	private static final int AVELLAN_SPICE = 7137;
+	private static final int HONEY_POUCH = 7138;
+	// Rewards
+	private static final List<QuestItemHolder> REWARDS = new ArrayList<>(5);
+	// Misc
+	private static final int MIN_LVL = 34;
+	static
+	{
+		MONSTERS_CHANCES.put(20934, 700); // Wasp Worker
+		MONSTERS_CHANCES.put(20935, 770); // Wasp Leader
+		REWARDS.add(new QuestItemHolder(57, 400, 2500)); // Adena
+		REWARDS.add(new QuestItemHolder(1865, 550, 50)); // Varnish
+		REWARDS.add(new QuestItemHolder(1870, 700, 50)); // Coal
+		REWARDS.add(new QuestItemHolder(1869, 850, 50)); // Iron Ore
+		REWARDS.add(new QuestItemHolder(1871, 1000, 50)); // Charcoal
+	}
+	
+	public Q00299_GatherIngredientsForPie()
+	{
+		super(299, Q00299_GatherIngredientsForPie.class.getSimpleName(), "Gather Ingredients for Pie");
+		addStartNpc(EMILLY);
+		addTalkId(LARS, BRIGHT, EMILLY);
+		addKillId(MONSTERS_CHANCES.keySet());
+		registerQuestItems(FRUIT_BASKET, HONEY_POUCH, AVELLAN_SPICE);
+	}
+	
+	@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 "30063-02.html":
+			{
+				if (qs.isCond(3))
+				{
+					giveItems(player, AVELLAN_SPICE, 1);
+					qs.setCond(4, true);
+					html = event;
+				}
+				break;
+			}
+			case "30466-02.html":
+			{
+				if (qs.isCond(5))
+				{
+					giveItems(player, FRUIT_BASKET, 1);
+					qs.setCond(6, true);
+					html = event;
+				}
+				break;
+			}
+			case "30620-03.htm":
+			{
+				if (qs.isCreated())
+				{
+					qs.startQuest();
+					html = event;
+				}
+				break;
+			}
+			case "30620-06.html":
+			{
+				if (qs.isCond(2) && (getQuestItemsCount(player, HONEY_POUCH) >= 100))
+				{
+					takeItems(player, HONEY_POUCH, -1);
+					qs.setCond(3, true);
+					html = event;
+				}
+				else
+				{
+					html = "30620-07.html";
+				}
+				break;
+			}
+			case "30620-10.html":
+			{
+				if (qs.isCond(4) && hasQuestItems(player, AVELLAN_SPICE))
+				{
+					takeItems(player, AVELLAN_SPICE, -1);
+					qs.setCond(5, true);
+					html = event;
+				}
+				else
+				{
+					html = "30620-11.html";
+				}
+				break;
+			}
+			case "30620-14.html":
+			{
+				if (qs.isCond(6) && hasQuestItems(player, FRUIT_BASKET))
+				{
+					takeItems(player, FRUIT_BASKET, -1);
+					final int chance = getRandom(1000);
+					for (QuestItemHolder holder : REWARDS)
+					{
+						if (holder.getChance() > chance)
+						{
+							rewardItems(player, holder);
+							break;
+						}
+					}
+					qs.exitQuest(true, true);
+					html = event;
+				}
+				else
+				{
+					html = "30620-15.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) && (getRandom(1000) < MONSTERS_CHANCES.get(npc.getId())) && (getQuestItemsCount(killer, HONEY_POUCH) < 100))
+		{
+			if (giveItemRandomly(killer, npc, HONEY_POUCH, 1, 2, 100, 1, true))
+			{
+				qs.setCond(2);
+			}
+		}
+		return super.onKill(npc, killer, isSummon);
+	}
+	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance talker)
+	{
+		final QuestState qs = getQuestState(talker, true);
+		String html = getNoQuestMsg(talker);
+		switch (npc.getId())
+		{
+			case LARS:
+			{
+				switch (qs.getCond())
+				{
+					case 3:
+					{
+						html = "30063-01.html";
+						break;
+					}
+					case 4:
+					{
+						html = "30063-03.html";
+						break;
+					}
+				}
+				break;
+			}
+			case BRIGHT:
+			{
+				switch (qs.getCond())
+				{
+					case 5:
+					{
+						html = "30466-01.html";
+						break;
+					}
+					case 6:
+					{
+						html = "30466-03.html";
+						break;
+					}
+				}
+				break;
+			}
+			case EMILLY:
+			{
+				switch (qs.getState())
+				{
+					case State.CREATED:
+					{
+						html = (talker.getLevel() >= MIN_LVL) ? "30620-01.htm" : "30620-02.htm";
+						break;
+					}
+					case State.STARTED:
+					{
+						switch (qs.getCond())
+						{
+							case 1:
+							{
+								html = "30620-05.html";
+								break;
+							}
+							case 2:
+							{
+								if (getQuestItemsCount(talker, HONEY_POUCH) >= 100)
+								{
+									html = "30620-04.html";
+								}
+								break;
+							}
+							case 3:
+							{
+								html = "30620-08.html";
+								break;
+							}
+							case 4:
+							{
+								if (hasQuestItems(talker, AVELLAN_SPICE))
+								{
+									html = "30620-09.html";
+								}
+								break;
+							}
+							case 5:
+							{
+								html = "30620-12.html";
+								break;
+							}
+							case 6:
+							{
+								if (hasQuestItems(talker, FRUIT_BASKET))
+								{
+									html = "30620-13.html";
+								}
+								break;
+							}
+						}
+						break;
+					}
+				}
+				break;
+			}
+		}
+		return html;
+	}
+}
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
index d41c75a5c1..83400d730c 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
@@ -208,6 +208,7 @@ import quests.Q00295_DreamingOfTheSkies.Q00295_DreamingOfTheSkies;
 import quests.Q00296_TarantulasSpiderSilk.Q00296_TarantulasSpiderSilk;
 import quests.Q00297_GatekeepersFavor.Q00297_GatekeepersFavor;
 import quests.Q00298_LizardmensConspiracy.Q00298_LizardmensConspiracy;
+import quests.Q00299_GatherIngredientsForPie.Q00299_GatherIngredientsForPie;
 import quests.Q00300_HuntingLetoLizardman.Q00300_HuntingLetoLizardman;
 import quests.Q00303_CollectArrowheads.Q00303_CollectArrowheads;
 import quests.Q00306_CrystalOfFireAndIce.Q00306_CrystalOfFireAndIce;
@@ -594,6 +595,7 @@ public class QuestMasterHandler
 		Q00296_TarantulasSpiderSilk.class,
 		Q00297_GatekeepersFavor.class,
 		Q00298_LizardmensConspiracy.class,
+		Q00299_GatherIngredientsForPie.class,
 		Q00300_HuntingLetoLizardman.class,
 		Q00303_CollectArrowheads.class,
 		Q00306_CrystalOfFireAndIce.class,
diff --git a/L2J_DataPack_BETA/dist/sql/game/updates/20141021update.sql b/L2J_DataPack_BETA/dist/sql/game/updates/20141021update.sql
new file mode 100644
index 0000000000..3245c5ef71
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/sql/game/updates/20141021update.sql
@@ -0,0 +1 @@
+UPDATE character_quests SET name='299_GatherIngredientsForPie' WHERE name='Q00299_GatherIngredientsForPie';
\ No newline at end of file
-- 
GitLab