소스 검색

BETA: Quest Q00299_GatherIngredientsForPie in Java.
* Reviewed by: ivantotov

xban1x 10 년 전
부모
커밋
6484d93c0f
33개의 변경된 파일351개의 추가작업 그리고 140개의 파일을 삭제
  1. 0 1
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-1.htm
  2. 0 2
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-0.htm
  3. 0 1
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0.htm
  4. 0 4
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-1.htm
  5. 0 3
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-2.htm
  6. 0 1
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-3.htm
  7. 0 2
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-4.htm
  8. 0 3
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-6.htm
  9. 0 116
      L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/__init__.py
  10. 3 2
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-01.html
  11. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-02.html
  12. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30063-03.html
  13. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-01.html
  14. 2 1
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-02.html
  15. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30466-03.html
  16. 1 1
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-01.htm
  17. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-02.htm
  18. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-03.htm
  19. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-04.html
  20. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-05.html
  21. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-06.html
  22. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-07.html
  23. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-08.html
  24. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-09.html
  25. 1 1
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-10.html
  26. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-11.html
  27. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-12.html
  28. 4 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-13.html
  29. 3 2
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-14.html
  30. 3 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/30620-15.html
  31. 284 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00299_GatherIngredientsForPie/Q00299_GatherIngredientsForPie.java
  32. 2 0
      L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
  33. 1 0
      L2J_DataPack_BETA/dist/sql/game/updates/20141021update.sql

+ 0 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-1.htm

@@ -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>

+ 0 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-0.htm

@@ -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>

+ 0 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0.htm

@@ -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>

+ 0 - 4
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-1.htm

@@ -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>

+ 0 - 3
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-2.htm

@@ -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>

+ 0 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-3.htm

@@ -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>

+ 0 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-4.htm

@@ -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>

+ 0 - 3
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-6.htm

@@ -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>

+ 0 - 116
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/__init__.py

@@ -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)

+ 3 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30063-0.htm → 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>
+<a action="bypass -h Quest Q00299_GatherIngredientsForPie 30063-02.html">"I'll take it to her."</a>
+</body></html>

+ 3 - 0
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>

+ 3 - 0
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>

+ 4 - 0
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>

+ 2 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30466-1.htm → 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>
+Can you take her this basket? I can't leave my post. Thank you!
+</body></html>

+ 3 - 0
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>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-0a.htm → 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>

+ 4 - 0
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>

+ 4 - 0
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>

+ 4 - 0
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>

+ 3 - 0
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>

+ 3 - 0
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>

+ 3 - 0
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>

+ 3 - 0
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>

+ 4 - 0
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>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-5.htm → 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>

+ 3 - 0
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>

+ 3 - 0
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>

+ 4 - 0
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>

+ 3 - 2
L2J_DataPack_BETA/dist/game/data/scripts/quests/299_GatherIngredientsForPie/30620-7.htm → 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>
+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>

+ 3 - 0
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>

+ 284 - 0
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;
+	}
+}

+ 2 - 0
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,

+ 1 - 0
L2J_DataPack_BETA/dist/sql/game/updates/20141021update.sql

@@ -0,0 +1 @@
+UPDATE character_quests SET name='299_GatherIngredientsForPie' WHERE name='Q00299_GatherIngredientsForPie';