__init__.py 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. # Made by Mr. Have fun! Version 0.2
  2. import sys
  3. from com.l2jserver.gameserver.model.quest import State
  4. from com.l2jserver.gameserver.model.quest import QuestState
  5. from com.l2jserver.gameserver.model.quest import Quest as JQuest
  6. qn = "330_AdeptOfTaste"
  7. INGREDIENT_LIST_ID = 1420
  8. SONIAS_BOTANYBOOK_ID = 1421
  9. RED_MANDRAGORA_ROOT_ID = 1422
  10. WHITE_MANDRAGORA_ROOT_ID = 1423
  11. RED_MANDRAGORA_SAP_ID = 1424
  12. WHITE_MANDRAGORA_SAP_ID = 1425
  13. JAYCUBS_INSECTBOOK_ID = 1426
  14. NECTAR_ID = 1427
  15. ROYAL_JELLY_ID = 1428
  16. HONEY_ID = 1429
  17. GOLDEN_HONEY_ID = 1430
  18. PANOS_CONTRACT_ID = 1431
  19. HOBGOBLIN_AMULET_ID = 1432
  20. DIONIAN_POTATO_ID = 1433
  21. GLYVKAS_BOTANYBOOK_ID = 1434
  22. GREEN_MARSH_MOSS_ID = 1435
  23. BROWN_MARSH_MOSS_ID = 1436
  24. GREEN_MOSS_BUNDLE_ID = 1437
  25. BROWN_MOSS_BUNDLE_ID = 1438
  26. ROLANTS_CREATUREBOOK_ID = 1439
  27. MONSTER_EYE_BODY_ID = 1440
  28. MONSTER_EYE_MEAT_ID = 1441
  29. JONAS_STEAK_DISH1_ID = 1442
  30. JONAS_STEAK_DISH2_ID = 1443
  31. JONAS_STEAK_DISH3_ID = 1444
  32. JONAS_STEAK_DISH4_ID = 1445
  33. JONAS_STEAK_DISH5_ID = 1446
  34. MIRIENS_REVIEW1_ID = 1447
  35. MIRIENS_REVIEW2_ID = 1448
  36. MIRIENS_REVIEW3_ID = 1449
  37. MIRIENS_REVIEW4_ID = 1450
  38. MIRIENS_REVIEW5_ID = 1451
  39. ADENA_ID = 57
  40. JONAS_SALAD_RECIPE_ID = 1455
  41. JONAS_SAUCE_RECIPE_ID = 1456
  42. JONAS_STEAK_RECIPE_ID = 1457
  43. def has_list(st) :
  44. return st.getQuestItemsCount(INGREDIENT_LIST_ID)
  45. def has_review(st) :
  46. return st.getQuestItemsCount(MIRIENS_REVIEW1_ID)+\
  47. st.getQuestItemsCount(MIRIENS_REVIEW2_ID)+\
  48. st.getQuestItemsCount(MIRIENS_REVIEW3_ID)+\
  49. st.getQuestItemsCount(MIRIENS_REVIEW4_ID)+\
  50. st.getQuestItemsCount(MIRIENS_REVIEW5_ID)
  51. def has_dish(st) :
  52. return st.getQuestItemsCount(JONAS_STEAK_DISH1_ID)+\
  53. st.getQuestItemsCount(JONAS_STEAK_DISH2_ID)+\
  54. st.getQuestItemsCount(JONAS_STEAK_DISH3_ID)+\
  55. st.getQuestItemsCount(JONAS_STEAK_DISH4_ID)+\
  56. st.getQuestItemsCount(JONAS_STEAK_DISH5_ID)
  57. def special_ingredients(st):
  58. return st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID)+\
  59. st.getQuestItemsCount(GOLDEN_HONEY_ID)+\
  60. st.getQuestItemsCount(BROWN_MOSS_BUNDLE_ID)
  61. def ingredients_count(st) :
  62. return st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+\
  63. st.getQuestItemsCount(HONEY_ID)+\
  64. st.getQuestItemsCount(DIONIAN_POTATO_ID)+\
  65. st.getQuestItemsCount(GREEN_MOSS_BUNDLE_ID)+\
  66. st.getQuestItemsCount(MONSTER_EYE_MEAT_ID)+\
  67. special_ingredients(st)
  68. class Quest (JQuest) :
  69. def __init__(self,id,name,descr):
  70. JQuest.__init__(self,id,name,descr)
  71. self.questItemIds = range(1420,1452)
  72. def onEvent (self,event,st) :
  73. htmltext = event
  74. if event == "1" :
  75. st.set("cond","1")
  76. st.setState(State.STARTED)
  77. st.playSound("ItemSound.quest_accept")
  78. htmltext = "30469-03.htm"
  79. st.giveItems(INGREDIENT_LIST_ID,1)
  80. elif event == "30062_1" :
  81. htmltext = "30062-05.htm"
  82. st.takeItems(SONIAS_BOTANYBOOK_ID,1)
  83. st.takeItems(RED_MANDRAGORA_ROOT_ID,-1)
  84. st.takeItems(WHITE_MANDRAGORA_ROOT_ID,-1)
  85. st.giveItems(RED_MANDRAGORA_SAP_ID,1)
  86. elif event == "30073_1" :
  87. htmltext = "30073-05.htm"
  88. st.takeItems(JAYCUBS_INSECTBOOK_ID,1)
  89. st.takeItems(NECTAR_ID,-1)
  90. st.takeItems(ROYAL_JELLY_ID,-1)
  91. st.giveItems(HONEY_ID,1)
  92. elif event == "30067_1" :
  93. htmltext = "30067-05.htm"
  94. st.takeItems(GLYVKAS_BOTANYBOOK_ID,1)
  95. st.takeItems(GREEN_MARSH_MOSS_ID,-1)
  96. st.takeItems(BROWN_MARSH_MOSS_ID,-1)
  97. st.giveItems(GREEN_MOSS_BUNDLE_ID,1)
  98. return htmltext
  99. def onTalk (self,npc,player):
  100. htmltext = Quest.getNoQuestMsg(player)
  101. st = self.getQuestState(player, True)
  102. if not st : return htmltext
  103. npcId = npc.getId()
  104. id = st.getState()
  105. if npcId != 30469 and id != State.STARTED : return htmltext
  106. if id == State.CREATED :
  107. st.set("cond","0")
  108. if npcId == 30469 and st.getInt("cond")==0 :
  109. if player.getLevel() >= 24 :
  110. htmltext = "30469-02.htm"
  111. return htmltext
  112. else:
  113. htmltext = "30469-01.htm"
  114. st.exitQuest(1)
  115. elif npcId == 30469 and st.getInt("cond") and has_list(st) and ingredients_count(st) < 5 :
  116. htmltext = "30469-04.htm"
  117. elif npcId == 30469 and st.getInt("cond") and has_list(st) and ingredients_count(st) >= 5 :
  118. if special_ingredients(st) == 0 :
  119. if self.getRandom(10)<1 :
  120. htmltext = "30469-05t2.htm"
  121. st.giveItems(JONAS_STEAK_DISH2_ID,1)
  122. else:
  123. htmltext = "30469-05t1.htm"
  124. st.giveItems(JONAS_STEAK_DISH1_ID,1)
  125. elif special_ingredients(st) == 1 :
  126. if self.getRandom(10)<1 :
  127. htmltext = "30469-05t3.htm"
  128. st.giveItems(JONAS_STEAK_DISH3_ID,1)
  129. else:
  130. htmltext = "30469-05t2.htm"
  131. st.giveItems(JONAS_STEAK_DISH2_ID,1)
  132. elif special_ingredients(st) == 2 :
  133. if self.getRandom(10)<1 :
  134. htmltext = "30469-05t4.htm"
  135. st.giveItems(JONAS_STEAK_DISH4_ID,1)
  136. else:
  137. htmltext = "30469-05t3.htm"
  138. st.giveItems(JONAS_STEAK_DISH3_ID,1)
  139. elif special_ingredients(st) == 3 :
  140. if self.getRandom(10)<1 :
  141. htmltext = "30469-05t5.htm"
  142. st.giveItems(JONAS_STEAK_DISH5_ID,1)
  143. st.playSound("ItemSound.quest_jackpot")
  144. else:
  145. htmltext = "30469-05t4.htm"
  146. st.giveItems(JONAS_STEAK_DISH4_ID,1)
  147. st.takeItems(INGREDIENT_LIST_ID,1)
  148. st.takeItems(RED_MANDRAGORA_SAP_ID,1)
  149. st.takeItems(WHITE_MANDRAGORA_SAP_ID,1)
  150. st.takeItems(HONEY_ID,1)
  151. st.takeItems(GOLDEN_HONEY_ID,1)
  152. st.takeItems(DIONIAN_POTATO_ID,1)
  153. st.takeItems(GREEN_MOSS_BUNDLE_ID,1)
  154. st.takeItems(BROWN_MOSS_BUNDLE_ID,1)
  155. st.takeItems(MONSTER_EYE_MEAT_ID,1)
  156. elif npcId == 30469 and st.getInt("cond") and ingredients_count(st) == 0 and not has_list(st) and has_dish(st) and not has_review(st) :
  157. htmltext = "30469-06.htm"
  158. elif npcId == 30469 and st.getInt("cond") and ingredients_count(st) == 0 and not has_list(st) and not has_dish(st) and has_review(st) :
  159. if st.getQuestItemsCount(MIRIENS_REVIEW1_ID) :
  160. htmltext = "30469-06t1.htm"
  161. st.takeItems(MIRIENS_REVIEW1_ID,1)
  162. st.giveItems(ADENA_ID,7500)
  163. st.addExpAndSp(6000,0)
  164. elif st.getQuestItemsCount(MIRIENS_REVIEW2_ID) :
  165. htmltext = "30469-06t2.htm"
  166. st.takeItems(MIRIENS_REVIEW2_ID,1)
  167. st.giveItems(ADENA_ID,9000)
  168. st.addExpAndSp(7000,0)
  169. elif st.getQuestItemsCount(MIRIENS_REVIEW3_ID) :
  170. htmltext = "30469-06t3.htm"
  171. st.takeItems(MIRIENS_REVIEW3_ID,1)
  172. st.giveItems(ADENA_ID,5800)
  173. st.giveItems(JONAS_SALAD_RECIPE_ID,1)
  174. st.addExpAndSp(9000,0)
  175. elif st.getQuestItemsCount(MIRIENS_REVIEW4_ID) :
  176. htmltext = "30469-06t4.htm"
  177. st.takeItems(MIRIENS_REVIEW4_ID,1)
  178. st.giveItems(ADENA_ID,6800)
  179. st.giveItems(JONAS_SAUCE_RECIPE_ID,1)
  180. st.addExpAndSp(10500,0)
  181. elif st.getQuestItemsCount(MIRIENS_REVIEW5_ID) :
  182. htmltext = "30469-06t5.htm"
  183. st.takeItems(MIRIENS_REVIEW5_ID,1)
  184. st.giveItems(ADENA_ID,7800)
  185. st.giveItems(JONAS_STEAK_RECIPE_ID,1)
  186. st.addExpAndSp(12000,0)
  187. st.playSound("ItemSound.quest_finish")
  188. st.exitQuest(1)
  189. elif npcId == 30461 and st.getInt("cond") and has_list(st) :
  190. htmltext = "30461-01.htm"
  191. elif npcId == 30461 and st.getInt("cond") and ingredients_count(st) == 0 and not has_list(st) and has_dish(st) and not has_review(st) :
  192. if st.getQuestItemsCount(JONAS_STEAK_DISH1_ID) :
  193. htmltext = "30461-02t1.htm"
  194. st.takeItems(JONAS_STEAK_DISH1_ID,1)
  195. st.giveItems(MIRIENS_REVIEW1_ID,1)
  196. elif st.getQuestItemsCount(JONAS_STEAK_DISH2_ID) :
  197. htmltext = "30461-02t2.htm"
  198. st.takeItems(JONAS_STEAK_DISH2_ID,1)
  199. st.giveItems(MIRIENS_REVIEW2_ID,1)
  200. elif st.getQuestItemsCount(JONAS_STEAK_DISH3_ID) :
  201. htmltext = "30461-02t3.htm"
  202. st.takeItems(JONAS_STEAK_DISH3_ID,1)
  203. st.giveItems(MIRIENS_REVIEW3_ID,1)
  204. elif st.getQuestItemsCount(JONAS_STEAK_DISH4_ID) :
  205. htmltext = "30461-02t4.htm"
  206. st.takeItems(JONAS_STEAK_DISH4_ID,1)
  207. st.giveItems(MIRIENS_REVIEW4_ID,1)
  208. elif st.getQuestItemsCount(JONAS_STEAK_DISH5_ID) :
  209. htmltext = "30461-02t5.htm"
  210. st.takeItems(JONAS_STEAK_DISH5_ID,1)
  211. st.giveItems(MIRIENS_REVIEW5_ID,1)
  212. elif npcId == 30461 and st.getInt("cond") and ingredients_count(st) == 0 and not has_list(st) and not has_dish(st) and has_review(st) :
  213. htmltext = "30461-04.htm"
  214. elif npcId == 30062 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and not st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID)==0) :
  215. htmltext = "30062-01.htm"
  216. st.giveItems(SONIAS_BOTANYBOOK_ID,1)
  217. elif npcId == 30062 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID))<40 and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID)==0) :
  218. htmltext = "30062-02.htm"
  219. elif npcId == 30062 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID))>=40 and st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID)<40 and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID)==0) :
  220. htmltext = "30062-03.htm"
  221. elif npcId == 30062 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID))>=40 and st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID)>=40 and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID)==0) :
  222. htmltext = "30062-06.htm"
  223. st.takeItems(SONIAS_BOTANYBOOK_ID,1)
  224. st.takeItems(RED_MANDRAGORA_ROOT_ID,-1)
  225. st.takeItems(WHITE_MANDRAGORA_ROOT_ID,-1)
  226. st.giveItems(WHITE_MANDRAGORA_SAP_ID,1)
  227. elif npcId == 30062 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID)==0 and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID)>0) :
  228. htmltext = "30062-07.htm"
  229. elif npcId == 30073 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID)==0 and (st.getQuestItemsCount(HONEY_ID)+st.getQuestItemsCount(GOLDEN_HONEY_ID)==0) :
  230. htmltext = "30073-01.htm"
  231. st.giveItems(JAYCUBS_INSECTBOOK_ID,1)
  232. elif npcId == 30073 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID) and st.getQuestItemsCount(NECTAR_ID)<20 :
  233. htmltext = "30073-02.htm"
  234. elif npcId == 30073 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID) and st.getQuestItemsCount(NECTAR_ID)>=20 and st.getQuestItemsCount(ROYAL_JELLY_ID)<10 :
  235. htmltext = "30073-03.htm"
  236. elif npcId == 30073 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID) and st.getQuestItemsCount(NECTAR_ID)>=20 and st.getQuestItemsCount(ROYAL_JELLY_ID)>=10 :
  237. htmltext = "30073-06.htm"
  238. st.takeItems(JAYCUBS_INSECTBOOK_ID,1)
  239. st.takeItems(NECTAR_ID,-1)
  240. st.takeItems(ROYAL_JELLY_ID,-1)
  241. st.giveItems(GOLDEN_HONEY_ID,1)
  242. elif npcId == 30073 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID)==0 and (st.getQuestItemsCount(HONEY_ID)+st.getQuestItemsCount(GOLDEN_HONEY_ID)==1) :
  243. htmltext = "30073-07.htm"
  244. elif npcId == 30078 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(PANOS_CONTRACT_ID)==0 and st.getQuestItemsCount(DIONIAN_POTATO_ID)==0 :
  245. htmltext = "30078-01.htm"
  246. st.giveItems(PANOS_CONTRACT_ID,1)
  247. elif npcId == 30078 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(PANOS_CONTRACT_ID) and st.getQuestItemsCount(HOBGOBLIN_AMULET_ID)<30 :
  248. htmltext = "30078-02.htm"
  249. elif npcId == 30078 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(PANOS_CONTRACT_ID) and st.getQuestItemsCount(HOBGOBLIN_AMULET_ID)>=30 :
  250. htmltext = "30078-03.htm"
  251. st.takeItems(PANOS_CONTRACT_ID,1)
  252. st.takeItems(HOBGOBLIN_AMULET_ID,-1)
  253. st.giveItems(DIONIAN_POTATO_ID,1)
  254. elif npcId == 30078 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(PANOS_CONTRACT_ID)==0 and st.getQuestItemsCount(DIONIAN_POTATO_ID) :
  255. htmltext = "30078-04.htm"
  256. elif npcId == 30067 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID)==0 and (st.getQuestItemsCount(GREEN_MOSS_BUNDLE_ID)+st.getQuestItemsCount(BROWN_MOSS_BUNDLE_ID)==0) :
  257. htmltext = "30067-01.htm"
  258. st.giveItems(GLYVKAS_BOTANYBOOK_ID,1)
  259. elif npcId == 30067 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(GREEN_MARSH_MOSS_ID)+st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)<20) :
  260. htmltext = "30067-02.htm"
  261. elif npcId == 30067 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(GREEN_MARSH_MOSS_ID)+st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)>=20) and st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)<20 :
  262. htmltext = "30067-03.htm"
  263. elif npcId == 30067 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(GREEN_MARSH_MOSS_ID)+st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)>=20) and st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)>=20 :
  264. htmltext = "30067-06.htm"
  265. st.takeItems(GLYVKAS_BOTANYBOOK_ID,1)
  266. st.takeItems(GREEN_MARSH_MOSS_ID,-1)
  267. st.takeItems(BROWN_MARSH_MOSS_ID,-1)
  268. st.giveItems(BROWN_MOSS_BUNDLE_ID,1)
  269. elif npcId == 30067 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID)==0 and (st.getQuestItemsCount(GREEN_MOSS_BUNDLE_ID)+st.getQuestItemsCount(BROWN_MOSS_BUNDLE_ID)==1) :
  270. htmltext = "30067-07.htm"
  271. elif npcId == 30069 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(ROLANTS_CREATUREBOOK_ID)==0 and st.getQuestItemsCount(MONSTER_EYE_MEAT_ID)==0 :
  272. htmltext = "30069-01.htm"
  273. st.giveItems(ROLANTS_CREATUREBOOK_ID,1)
  274. elif npcId == 30069 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(ROLANTS_CREATUREBOOK_ID) and st.getQuestItemsCount(MONSTER_EYE_BODY_ID)<30 :
  275. htmltext = "30069-02.htm"
  276. elif npcId == 30069 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(ROLANTS_CREATUREBOOK_ID) and st.getQuestItemsCount(MONSTER_EYE_BODY_ID)>=30 :
  277. htmltext = "30069-03.htm"
  278. st.takeItems(ROLANTS_CREATUREBOOK_ID,1)
  279. st.takeItems(MONSTER_EYE_BODY_ID,-1)
  280. st.giveItems(MONSTER_EYE_MEAT_ID,1)
  281. elif npcId == 30069 and st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(ROLANTS_CREATUREBOOK_ID)==0 and st.getQuestItemsCount(MONSTER_EYE_MEAT_ID)==1 :
  282. htmltext = "30069-04.htm"
  283. return htmltext
  284. def onKill(self,npc,player,isPet):
  285. st = self.getQuestState(player, False)
  286. if not st : return
  287. if st.getState() != State.STARTED : return
  288. npcId = npc.getId()
  289. if npcId == 20265 :
  290. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(ROLANTS_CREATUREBOOK_ID) and st.getQuestItemsCount(MONSTER_EYE_BODY_ID)<30 :
  291. n = self.getRandom(100)
  292. if n<75 :
  293. st.giveItems(MONSTER_EYE_BODY_ID,1)
  294. if st.getQuestItemsCount(MONSTER_EYE_BODY_ID) == 30 :
  295. st.playSound("ItemSound.quest_middle")
  296. else:
  297. st.playSound("ItemSound.quest_itemget")
  298. else:
  299. if st.getQuestItemsCount(MONSTER_EYE_BODY_ID) == 29 :
  300. st.giveItems(MONSTER_EYE_BODY_ID,1)
  301. st.playSound("ItemSound.quest_middle")
  302. else:
  303. st.giveItems(MONSTER_EYE_BODY_ID,2)
  304. st.playSound("ItemSound.quest_itemget")
  305. elif npcId == 20266 :
  306. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(ROLANTS_CREATUREBOOK_ID) and st.getQuestItemsCount(MONSTER_EYE_BODY_ID)<30 :
  307. n = self.getRandom(10)
  308. if n<7 :
  309. st.giveItems(MONSTER_EYE_BODY_ID,1)
  310. if st.getQuestItemsCount(MONSTER_EYE_BODY_ID) == 30 :
  311. st.playSound("ItemSound.quest_middle")
  312. else:
  313. st.playSound("ItemSound.quest_itemget")
  314. else:
  315. if st.getQuestItemsCount(MONSTER_EYE_BODY_ID) == 29 :
  316. st.giveItems(MONSTER_EYE_BODY_ID,1)
  317. st.playSound("ItemSound.quest_middle")
  318. else:
  319. st.giveItems(MONSTER_EYE_BODY_ID,2)
  320. st.playSound("ItemSound.quest_itemget")
  321. elif npcId == 20226 :
  322. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID) :
  323. n = self.getRandom(10)
  324. if n<9 :
  325. if st.getQuestItemsCount(GREEN_MARSH_MOSS_ID)<20 :
  326. st.giveItems(GREEN_MARSH_MOSS_ID,1)
  327. if st.getQuestItemsCount(GREEN_MARSH_MOSS_ID) == 20 :
  328. st.playSound("ItemSound.quest_middle")
  329. else:
  330. st.playSound("ItemSound.quest_itemget")
  331. else:
  332. if st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)<20 :
  333. st.giveItems(BROWN_MARSH_MOSS_ID,1)
  334. if st.getQuestItemsCount(BROWN_MARSH_MOSS_ID) == 20 :
  335. st.playSound("ItemSound.quest_middle")
  336. else:
  337. st.playSound("ItemSound.quest_itemget")
  338. elif npcId == 20228 :
  339. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(GLYVKAS_BOTANYBOOK_ID) :
  340. n = self.getRandom(100)
  341. if n<88 :
  342. if st.getQuestItemsCount(GREEN_MARSH_MOSS_ID)<20 :
  343. st.giveItems(GREEN_MARSH_MOSS_ID,1)
  344. if st.getQuestItemsCount(GREEN_MARSH_MOSS_ID) == 20 :
  345. st.playSound("ItemSound.quest_middle")
  346. else:
  347. st.playSound("ItemSound.quest_itemget")
  348. else:
  349. if st.getQuestItemsCount(BROWN_MARSH_MOSS_ID)<20 :
  350. st.giveItems(BROWN_MARSH_MOSS_ID,1)
  351. if st.getQuestItemsCount(BROWN_MARSH_MOSS_ID) == 20 :
  352. st.playSound("ItemSound.quest_middle")
  353. else:
  354. st.playSound("ItemSound.quest_itemget")
  355. elif npcId == 20147 :
  356. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(PANOS_CONTRACT_ID) and st.getQuestItemsCount(HOBGOBLIN_AMULET_ID)<30 :
  357. st.giveItems(HOBGOBLIN_AMULET_ID,1)
  358. if st.getQuestItemsCount(HOBGOBLIN_AMULET_ID) == 30 :
  359. st.playSound("ItemSound.quest_middle")
  360. else:
  361. st.playSound("ItemSound.quest_itemget")
  362. elif npcId == 20204 :
  363. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID) :
  364. n = self.getRandom(100)
  365. if n<80 :
  366. if st.getQuestItemsCount(NECTAR_ID)<20 :
  367. st.giveItems(NECTAR_ID,1)
  368. if st.getQuestItemsCount(NECTAR_ID) == 20 :
  369. st.playSound("ItemSound.quest_middle")
  370. else:
  371. st.playSound("ItemSound.quest_itemget")
  372. elif n>95 :
  373. if st.getQuestItemsCount(ROYAL_JELLY_ID)<10 :
  374. st.giveItems(ROYAL_JELLY_ID,1)
  375. if st.getQuestItemsCount(ROYAL_JELLY_ID) == 10 :
  376. st.playSound("ItemSound.quest_middle")
  377. else:
  378. st.playSound("ItemSound.quest_itemget")
  379. elif npcId == 20229 :
  380. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(JAYCUBS_INSECTBOOK_ID) :
  381. n = self.getRandom(100)
  382. if n<92 :
  383. if st.getQuestItemsCount(NECTAR_ID)<20 :
  384. st.giveItems(NECTAR_ID,1)
  385. if st.getQuestItemsCount(NECTAR_ID) == 20 :
  386. st.playSound("ItemSound.quest_middle")
  387. else:
  388. st.playSound("ItemSound.quest_itemget")
  389. else:
  390. if st.getQuestItemsCount(ROYAL_JELLY_ID)<10 :
  391. st.giveItems(ROYAL_JELLY_ID,1)
  392. if st.getQuestItemsCount(ROYAL_JELLY_ID) == 10 :
  393. st.playSound("ItemSound.quest_middle")
  394. else:
  395. st.playSound("ItemSound.quest_itemget")
  396. elif npcId == 20223 :
  397. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID) == 0) :
  398. n = self.getRandom(100)
  399. if n<67 :
  400. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)<40 :
  401. st.giveItems(RED_MANDRAGORA_ROOT_ID,1)
  402. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID) == 40 :
  403. st.playSound("ItemSound.quest_middle")
  404. else:
  405. st.playSound("ItemSound.quest_itemget")
  406. elif n>93 :
  407. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID)<40 :
  408. st.giveItems(WHITE_MANDRAGORA_ROOT_ID,1)
  409. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID) == 40 :
  410. st.playSound("ItemSound.quest_middle")
  411. else:
  412. st.playSound("ItemSound.quest_itemget")
  413. elif npcId == 20154 :
  414. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID) == 0) :
  415. n = self.getRandom(100)
  416. if n<74 :
  417. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)<40 :
  418. st.giveItems(RED_MANDRAGORA_ROOT_ID,1)
  419. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID) == 40 :
  420. st.playSound("ItemSound.quest_middle")
  421. else:
  422. st.playSound("ItemSound.quest_itemget")
  423. elif n>92 :
  424. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID)<40 :
  425. st.giveItems(WHITE_MANDRAGORA_ROOT_ID,1)
  426. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID) == 40 :
  427. st.playSound("ItemSound.quest_middle")
  428. else:
  429. st.playSound("ItemSound.quest_itemget")
  430. elif npcId == 20155 :
  431. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID) == 0) :
  432. n = self.getRandom(100)
  433. if n<80 :
  434. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)<40 :
  435. st.giveItems(RED_MANDRAGORA_ROOT_ID,1)
  436. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID) == 40 :
  437. st.playSound("ItemSound.quest_middle")
  438. else:
  439. st.playSound("ItemSound.quest_itemget")
  440. elif n>91 :
  441. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID)<40 :
  442. st.giveItems(WHITE_MANDRAGORA_ROOT_ID,1)
  443. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID) == 40 :
  444. st.playSound("ItemSound.quest_middle")
  445. else:
  446. st.playSound("ItemSound.quest_itemget")
  447. elif npcId == 20156 :
  448. if st.getInt("cond") and has_list(st) and ingredients_count(st)<5 and st.getQuestItemsCount(SONIAS_BOTANYBOOK_ID) and (st.getQuestItemsCount(RED_MANDRAGORA_SAP_ID)+st.getQuestItemsCount(WHITE_MANDRAGORA_SAP_ID) == 0) :
  449. n = self.getRandom(100)
  450. if n<90 :
  451. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID)<40 :
  452. st.giveItems(RED_MANDRAGORA_ROOT_ID,1)
  453. if st.getQuestItemsCount(RED_MANDRAGORA_ROOT_ID) == 40 :
  454. st.playSound("ItemSound.quest_middle")
  455. else:
  456. st.playSound("ItemSound.quest_itemget")
  457. else:
  458. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID)<40 :
  459. st.giveItems(WHITE_MANDRAGORA_ROOT_ID,1)
  460. if st.getQuestItemsCount(WHITE_MANDRAGORA_ROOT_ID) == 40 :
  461. st.playSound("ItemSound.quest_middle")
  462. else:
  463. st.playSound("ItemSound.quest_itemget")
  464. return
  465. QUEST = Quest(330,qn,"Adept Of Taste")
  466. QUEST.addStartNpc(30469)
  467. QUEST.addTalkId(30469)
  468. QUEST.addTalkId(30062)
  469. QUEST.addTalkId(30067)
  470. QUEST.addTalkId(30069)
  471. QUEST.addTalkId(30073)
  472. QUEST.addTalkId(30078)
  473. QUEST.addTalkId(30461)
  474. QUEST.addKillId(20147)
  475. QUEST.addKillId(20154)
  476. QUEST.addKillId(20155)
  477. QUEST.addKillId(20156)
  478. QUEST.addKillId(20204)
  479. QUEST.addKillId(20223)
  480. QUEST.addKillId(20226)
  481. QUEST.addKillId(20228)
  482. QUEST.addKillId(20229)
  483. QUEST.addKillId(20265)
  484. QUEST.addKillId(20266)