__init__.py 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. # Arrogant Search version 0.1
  2. # by Fulminus
  3. # in this version, the quest only works as total solo (no option to work with friends) and
  4. # only for the purpose of gaining access to Baium's floor (not for making money via rewards).
  5. import sys
  6. from com.l2jserver.gameserver.model.quest import State
  7. from com.l2jserver.gameserver.model.quest import QuestState
  8. from com.l2jserver.gameserver.model.quest import Quest as JQuest
  9. #Quest info
  10. QUEST_NUMBER,QUEST_NAME,QUEST_DESCRIPTION = 348,"ArrogantSearch","An Arrogant Search"
  11. qn = "348_ArrogantSearch"
  12. #Messages
  13. default = "<html><body>I have nothing to say to you.</body></html>"
  14. #MOBS TO KILL
  15. YINTZU = 20647
  16. PALIOTE = 20648
  17. ARK_GUARDIAN_ELBEROTH = 27182
  18. ARK_GUARDIAN_SHADOWFANG = 27183
  19. ANGEL_KILLER = 27184
  20. PLATINUM_TRIBE_SHAMAN = 20828
  21. PLATINUM_TRIBE_OVERLORD = 20829
  22. GUARDIAN_ANGEL_1 = 20830
  23. GUARDIAN_ANGEL_2 = 20859
  24. SEAL_ANGEL_1 = 20831
  25. SEAL_ANGEL_2 = 20860
  26. #NPCS TO TALK TO
  27. HANELLIN = 30864
  28. HOLY_ARK_OF_SECRECY_1 = 30977
  29. HOLY_ARK_OF_SECRECY_2 = 30978
  30. HOLY_ARK_OF_SECRECY_3 = 30979
  31. ARK_GUARDIANS_CORPSE = 30980
  32. HARNE = 30144
  33. CLAUDIA_ATHEBALT = 31001
  34. MARTIEN = 30645
  35. GUSTAV_ATHEBALDT = 30760
  36. HARDIN = 30832
  37. HEINE = 30969
  38. #items
  39. SHELL_OF_MONSTERS = 14857
  40. HANELLINS_FIRST_LETTER = 4288
  41. HANELLINS_SECOND_LETTER = 4289
  42. HANELLINS_THIRD_LETTER = 4290
  43. FIRST_KEY_OF_ARK = 4291
  44. SECOND_KEY_OF_ARK = 4292
  45. THIRD_KEY_OF_ARK = 4293
  46. WHITE_FABRIC_1 = 4294 #to use on Platinum Tribe Shamans/Overlords
  47. BLOODED_FABRIC = 4295
  48. HANELLINS_WHITE_FLOWER = 4394
  49. HANELLINS_RED_FLOWER = 4395
  50. HANELLINS_YELLOW_FLOWER = 4396
  51. BOOK_OF_SAINT = 4397 # Ark2 (after fight with Elberoth)
  52. BLOOD_OF_SAINT = 4398 # Ark1 (after fight with Angel Killer)
  53. BRANCH_OF_SAINT = 4399 # Ark3 (after fight with Shadowfang)
  54. WHITE_FABRIC_0 = 4400 #talk to Hanellin to see what to do (for companions)
  55. WHITE_FABRIC_2 = 5232 #to use on Guardian Angels and Seal Angels
  56. ANTIDOTE = 1831 #potion
  57. HEALING_POTION = 1061 #potion
  58. ANIMAL_BONE = 1872 #reward for bringing the first fabric
  59. SYNTHETIC_COKES = 1888 #reward for bringing the first fabric
  60. ADENA = 57 # cheater reward
  61. #ARK: [key, summon, no-key text, openning-with-key text, already-openned text, content item]
  62. ARKS={
  63. HOLY_ARK_OF_SECRECY_1: [FIRST_KEY_OF_ARK,0,"30977-01.htm","30977-02.htm","30977-03.htm",BLOOD_OF_SAINT],
  64. HOLY_ARK_OF_SECRECY_2: [SECOND_KEY_OF_ARK,ARK_GUARDIAN_ELBEROTH,"That doesn't belong to you. Don't touch it!","30978-02.htm","30978-03.htm",BOOK_OF_SAINT],
  65. HOLY_ARK_OF_SECRECY_3: [THIRD_KEY_OF_ARK,ARK_GUARDIAN_SHADOWFANG, "Get off my sight, you infidels!","30979-02.htm","30979-03.htm",BRANCH_OF_SAINT],
  66. }
  67. # npc: letter to take, item to check for, 1st time htm, return htm, State.COMPLETED part htm, [x,y,z of chest]
  68. ARK_OWNERS={
  69. HARNE: [HANELLINS_FIRST_LETTER, BLOOD_OF_SAINT, '30144-01.htm', '30144-02.htm', '30144-03.htm', [-418,44174,-3568]],
  70. CLAUDIA_ATHEBALT: [HANELLINS_SECOND_LETTER, BOOK_OF_SAINT, '31001-01.htm', '31001-02.htm', '31001-03.htm', [181472,7158,-2725]],
  71. MARTIEN: [HANELLINS_THIRD_LETTER, BRANCH_OF_SAINT, '30645-01.htm', '30645-02.htm', '30645-03.htm', [50693,158674,376]]
  72. }
  73. # npc: fabrics to give, variable to set, ok htm, not ok htm, done htm
  74. BLOODY_OWNERS={
  75. GUSTAV_ATHEBALDT: [3, 'athebaldt_delivery', '30760-01.htm', '30760-01a.htm', '30760-01b.htm'],
  76. HARDIN: [1, 'hardin_delivery', '30832-01.htm', '30832-01a.htm', '30832-01b.htm'],
  77. HEINE: [6, 'heine_delivery', '30969-01.htm', '30969-01a.htm', '30969-01b.htm']
  78. }
  79. #mob: cond, giveItem, amount, chance%, takeItem (assumed to take only 1 of it)
  80. DROPS ={
  81. YINTZU: [2,SHELL_OF_MONSTERS,1,10,0],
  82. PALIOTE: [2,SHELL_OF_MONSTERS,1,10,0],
  83. ANGEL_KILLER: [5, FIRST_KEY_OF_ARK,1,100,0],
  84. ARK_GUARDIAN_ELBEROTH: [5, SECOND_KEY_OF_ARK,1,100,0],
  85. ARK_GUARDIAN_SHADOWFANG: [5, THIRD_KEY_OF_ARK,1,100,0],
  86. PLATINUM_TRIBE_SHAMAN: [25,BLOODED_FABRIC,1,10,WHITE_FABRIC_1],
  87. PLATINUM_TRIBE_OVERLORD: [25,BLOODED_FABRIC,1,10,WHITE_FABRIC_1],
  88. GUARDIAN_ANGEL_1: [26,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  89. GUARDIAN_ANGEL_2: [26,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  90. SEAL_ANGEL_1: [26,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  91. SEAL_ANGEL_2: [26,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  92. }
  93. #pathologic situation, mobs in stage 29 drop same items as in stage 26 :/
  94. #mob: cond, giveItem, amount, chance%, takeItem (assumed to take only 1 of it)
  95. DROPS_29 ={
  96. GUARDIAN_ANGEL_1: [29,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  97. GUARDIAN_ANGEL_2: [29,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  98. SEAL_ANGEL_1: [29,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  99. SEAL_ANGEL_2: [29,BLOODED_FABRIC,10,25,WHITE_FABRIC_1],
  100. }
  101. #mob: cond, giveItem, amount, chance%, takeItem (assumed to take only 1 of it)
  102. ATTACK_DROPS_24 = {
  103. PLATINUM_TRIBE_SHAMAN: [24,BLOODED_FABRIC,1,2,WHITE_FABRIC_1],
  104. PLATINUM_TRIBE_OVERLORD: [24,BLOODED_FABRIC,1,2,WHITE_FABRIC_1],
  105. }
  106. ATTACK_DROPS_25 = {
  107. PLATINUM_TRIBE_SHAMAN: [25,BLOODED_FABRIC,1,2,WHITE_FABRIC_1],
  108. PLATINUM_TRIBE_OVERLORD: [25,BLOODED_FABRIC,1,2,WHITE_FABRIC_1],
  109. }
  110. """
  111. notes:
  112. In order to make it easier to participate in a Baium Raid, the number of Platinum Race monsters that must be
  113. killed to get "Blooded Fabric" in the Arrogant Search quest has been reduced a bit. However, if a player clicks
  114. "Say that you will come back" to Magister Hanellin while carrying out the quest alone and repeats the quest,
  115. he must hunt the same number of Platinum Race monsters as before.
  116. In the process of delivering the Blooded Fabric to Sir Athebaldt/Iason Heine/Hardin when carrying out the
  117. Arrogant Search quest alone, if it is not the number of "Blooded Fabrics" that the related NPCs want, the
  118. game has been modified to have the player go back to Hanellin. Hanellin gives a reward in proportion to the
  119. number of errands run when the number of "Blooded Fabrics" that have to be delivered is not right and then
  120. the quest is ended.
  121. """
  122. class Quest (JQuest) :
  123. def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
  124. def onEvent (self,event,st) :
  125. htmltext = event
  126. if event == "30864-02c.htm" :
  127. st.setState(State.STARTED)
  128. st.set("cond","2")
  129. st.set("reward1","0") # for first reward in cond == 25
  130. for i in BLOODY_OWNERS.keys() : # goods are not delivered
  131. st.set(BLOODY_OWNERS[i][1],"0")
  132. elif event == "30864_04a" : #work alone
  133. st.set("cond","4")
  134. htmltext = "30864-04c.htm"
  135. st.set("companions","0")
  136. elif event == "30864_04b" : #work with friends
  137. st.set("cond","3")
  138. st.set("companions","1")
  139. st.takeItems(SHELL_OF_MONSTERS,-1)
  140. htmltext = "not yet implemented"
  141. #todo: give flowers & handle the multiperson quest...
  142. elif event == "30864_07" : #platinum tribe info
  143. htmltext = "30864-07b.htm"
  144. elif event == "30864_07b" : #platinum tribe info 2
  145. htmltext = "30864-07c.htm"
  146. elif event == "30864_07c" : #money vs meet emperor
  147. htmltext = "30864-07d.htm"
  148. elif event == "30864_07meet" : #meet emperor
  149. htmltext = "30864-07meet.htm"
  150. st.set("cond","24")
  151. elif event == "30864_07money" : #want more fabrics
  152. htmltext = "30864-07money.htm"
  153. st.set("cond","25")
  154. elif event == "30864_08" : #
  155. htmltext = "30864-08b.htm"
  156. elif event == "30864_08b" : # more about angels blood
  157. htmltext = "30864-08c.htm" # more about angels blood
  158. st.giveItems(WHITE_FABRIC_1,9)
  159. st.set("cond", "26")
  160. elif event == "30864_09" : # Who are those people?
  161. st.set("cond", "27")
  162. htmltext = "30864-09c.htm"
  163. elif event == "30864_10continue" : # next round of fabrics
  164. htmltext = "30864-08c.htm" # more about angels blood
  165. st.giveItems(WHITE_FABRIC_1,10) # next 10 fabrics
  166. for i in BLOODY_OWNERS.keys() : # must delivery again
  167. st.set(BLOODY_OWNERS[i][1],"0")
  168. st.set("cond", "29") # start hunting angels again
  169. elif event == "30864_10quit" : # done with fabrics
  170. htmltext = "30864-10c.htm" # disappointment
  171. st.takeItems(WHITE_FABRIC_1,-1) # just to be sure
  172. st.takeItems(BLOODED_FABRIC,-1) # just to be sure
  173. st.playSound("ItemSound.quest_finish")
  174. st.exitQuest(1)
  175. return htmltext
  176. def onTalk (self,npc,player):
  177. htmltext = Quest.getNoQuestMsg(player)
  178. st = self.getQuestState(player, True)
  179. if not st : return htmltext
  180. npcId = npc.getId()
  181. id = st.getState()
  182. if npcId != HANELLIN and id != State.STARTED : return htmltext
  183. cond = st.getInt("cond")
  184. reward1 = st.getInt("reward1")
  185. if npcId == HANELLIN :
  186. if id == State.CREATED :
  187. # if the quest was State.COMPLETED and the player still has a blooded fabric
  188. # tell them the "secret" that they can use it in order to visit Baium.
  189. if st.getQuestItemsCount(BLOODED_FABRIC)==1:
  190. htmltext = "30864-Baium.htm"
  191. st.exitQuest(1)
  192. else : #else, start the quest normally
  193. if player.getLevel() < 60 :
  194. st.exitQuest(1)
  195. htmltext = "30864-01.htm" #not qualified
  196. elif cond==0 :
  197. htmltext = "30864-02.htm"
  198. # Player abandoned in the middle of last dialog...repeat the dialog.
  199. elif cond==1 :
  200. htmltext = "30864-02.htm" # begin the dialog which will set cond=2
  201. # Has returned before getting the powerstone
  202. elif cond==2 :
  203. if st.getQuestItemsCount(SHELL_OF_MONSTERS)==0 :
  204. htmltext = "30864-03.htm" # go get the shell of monsters
  205. else :
  206. st.takeItems(SHELL_OF_MONSTERS,-1)
  207. htmltext = "30864-04.htm" # Ask "work alone or in group?"...only alone is implemented in v0.1
  208. elif cond==4 :
  209. st.set("cond","5")
  210. st.giveItems(HANELLINS_FIRST_LETTER,1)
  211. st.giveItems(HANELLINS_SECOND_LETTER,1)
  212. st.giveItems(HANELLINS_THIRD_LETTER,1)
  213. htmltext = "30864-05.htm" # Go get the 3 sacred relics
  214. elif cond == 5 and st.getQuestItemsCount(BOOK_OF_SAINT)+st.getQuestItemsCount(BLOOD_OF_SAINT)+st.getQuestItemsCount(BRANCH_OF_SAINT)<3 :
  215. htmltext = "30864-05.htm" # Repeat: Go get the 3 sacred relics
  216. elif cond == 5 :
  217. htmltext = "30864-06.htm" # All relics collected!...Get me antidotes & healing
  218. st.takeItems(BOOK_OF_SAINT,-1)
  219. st.takeItems(BLOOD_OF_SAINT,-1)
  220. st.takeItems(BRANCH_OF_SAINT,-1)
  221. st.set("cond","22")
  222. elif cond == 22 and st.getQuestItemsCount(ANTIDOTE)<5 and st.getQuestItemsCount(HEALING_POTION)<1:
  223. htmltext = "30864-06a.htm" # where are my antidotes & greater healing
  224. elif cond == 22 and st.getQuestItemsCount(WHITE_FABRIC_1)>0 :
  225. htmltext = "30864-07c.htm"
  226. elif cond == 22 :
  227. st.takeItems(ANTIDOTE,5)
  228. st.takeItems(HEALING_POTION,1)
  229. if st.getInt("companions") == 0 :
  230. htmltext = "30864-07.htm" # go get platinum tribe blood...
  231. st.giveItems(WHITE_FABRIC_1,1)
  232. else:
  233. st.set("cond","23")
  234. htmltext = "not implemented yet"
  235. st.giveItems(WHITE_FABRIC_0,3)
  236. elif cond == 24 and st.getQuestItemsCount(BLOODED_FABRIC)<1 :
  237. htmltext = "30864-07a.htm"
  238. elif cond == 25 and st.getQuestItemsCount(BLOODED_FABRIC)<1 :
  239. htmltext = "30864-07a.htm"
  240. elif cond == 25 and reward1 > 0:
  241. htmltext = "30864-08b.htm" # more about angels
  242. elif cond == 25 :
  243. htmltext = "30864-08.htm" #you want more of this?
  244. st.giveItems(ANIMAL_BONE,2)
  245. st.giveItems(SYNTHETIC_COKES,2)
  246. lowbgrade = self.getRandom(10)+4103 #Low B grade weapon key materials
  247. st.giveItems(lowbgrade,1)
  248. st.set("reward1","1")
  249. elif cond == 26 and st.getQuestItemsCount(WHITE_FABRIC_1)>0 :
  250. htmltext = "30864-09a.htm" #
  251. elif cond == 26 and st.getQuestItemsCount(BLOODED_FABRIC)<10 :
  252. htmltext = "30864-09b.htm" # Where are other pieces?
  253. st.giveItems(ADENA,5000)
  254. st.takeItems(BLOODED_FABRIC,-1)
  255. st.playSound("ItemSound.quest_finish")
  256. st.exitQuest(1)
  257. elif cond == 26 :
  258. htmltext = "30864-09.htm" # Ah, 10 fabrics.
  259. elif cond == 27 and st.getInt(BLOODY_OWNERS[GUSTAV_ATHEBALDT][1]) + st.getInt(BLOODY_OWNERS[HARDIN][1]) + st.getInt(BLOODY_OWNERS[HEINE][1])<3 :
  260. htmltext = "30864-10a.htm" # still not delivered?
  261. elif cond == 27 :
  262. htmltext = "30864-10.htm" # good money
  263. st.giveItems(ANIMAL_BONE,5)
  264. highbgrade = self.getRandom(8)+4113
  265. st.giveItems(highbgrade,1)
  266. st.set("cond","28")
  267. elif cond == 28:
  268. htmltext = "30864-10b.htm" # still not decided to continue or quit
  269. elif cond == 29 and st.getQuestItemsCount(WHITE_FABRIC_1)>0 :
  270. htmltext = "30864-09a.htm" #
  271. elif cond == 29 and st.getQuestItemsCount(BLOODED_FABRIC)<10 :
  272. htmltext = "30864-09b.htm" # Where are other pieces?
  273. st.giveItems(ADENA,5000)
  274. st.takeItems(BLOODED_FABRIC,-1)
  275. st.playSound("ItemSound.quest_finish")
  276. st.exitQuest(1)
  277. elif cond == 29 :
  278. htmltext = "30864-09.htm" # Ah, 10 fabrics.
  279. # Other NPCs follow:
  280. elif cond == 5:
  281. if npcId in ARK_OWNERS.keys() :
  282. # first meeting...have the letter
  283. if st.getQuestItemsCount(ARK_OWNERS[npcId][0])==1:
  284. st.takeItems(ARK_OWNERS[npcId][0],1)
  285. htmltext = ARK_OWNERS[npcId][2]
  286. st.addRadar(ARK_OWNERS[npcId][5][0],ARK_OWNERS[npcId][5][1],ARK_OWNERS[npcId][5][2])
  287. # do not have letter and do not have the item
  288. elif st.getQuestItemsCount(ARK_OWNERS[npcId][1]) < 1:
  289. htmltext = ARK_OWNERS[npcId][3]
  290. st.addRadar(ARK_OWNERS[npcId][5][0],ARK_OWNERS[npcId][5][1],ARK_OWNERS[npcId][5][2])
  291. else: #have the item (done)
  292. htmltext = ARK_OWNERS[npcId][4]
  293. elif npcId in ARKS.keys():
  294. # if you do not have the key (first meeting)
  295. if st.getQuestItemsCount(ARKS[npcId][0])==0:
  296. if ARKS[npcId][1] != 0 : # spawn the NPC, if appropriate
  297. st.addSpawn(ARKS[npcId][1],120000)
  298. return ARKS[npcId][2]
  299. # if the player already has openned the chest and has its content, show "chest empty"
  300. elif st.getQuestItemsCount(ARKS[npcId][5])==1:
  301. htmltext = ARKS[npcId][4]
  302. else: # the player has the key and doesn't have the contents, give the contents
  303. htmltext = ARKS[npcId][3]
  304. st.takeItems(ARKS[npcId][0],1)
  305. st.giveItems(ARKS[npcId][5],1)
  306. elif npcId == ARK_GUARDIANS_CORPSE :
  307. # if you do not have the key (first meeting)
  308. if st.getQuestItemsCount(FIRST_KEY_OF_ARK)==0 and st.getInt("angelKillerIsDefeated")==0 :
  309. st.addSpawn(ANGEL_KILLER,120000)
  310. htmltext = "30980-01.htm"
  311. elif st.getQuestItemsCount(FIRST_KEY_OF_ARK)==0 and st.getInt("angelKillerIsDefeated")==1 :
  312. st.giveItems(FIRST_KEY_OF_ARK,1)
  313. htmltext = "30980-02.htm"
  314. else :
  315. htmltext = "30980-03.htm"
  316. elif cond == 27 :
  317. if npcId in BLOODY_OWNERS.keys() :
  318. if st.getInt(BLOODY_OWNERS[npcId][1])<1 :
  319. if st.getQuestItemsCount(BLOODED_FABRIC)>=BLOODY_OWNERS[npcId][0] : # deliver blood
  320. st.takeItems(BLOODED_FABRIC,BLOODY_OWNERS[npcId][0])
  321. st.set(BLOODY_OWNERS[npcId][1],"1")
  322. htmltext = BLOODY_OWNERS[npcId][2]
  323. else : # not enough blood
  324. htmltext = BLOODY_OWNERS[npcId][3]
  325. else : # already delivered
  326. htmltext = BLOODY_OWNERS[npcId][4]
  327. return htmltext
  328. def onAttack (self, npc, player, damage, isPet, skill):
  329. st = self.getQuestState(player, False)
  330. if not st : return
  331. if st.getState() != State.STARTED : return
  332. npcId = npc.getId()
  333. if npcId in ATTACK_DROPS_24.keys() :
  334. cond = ATTACK_DROPS_24[npcId][0]
  335. chance = ATTACK_DROPS_24[npcId][3]
  336. if st.getInt("cond") == cond and self.getRandom(1000) < ATTACK_DROPS_24[npcId][3] and st.getQuestItemsCount(ATTACK_DROPS_24[npcId][4]) > 0 : # Attack drops are low chance
  337. st.giveItems(ATTACK_DROPS_24[npcId][1],ATTACK_DROPS_24[npcId][2])
  338. st.playSound("ItemSound.quest_itemget")
  339. st.takeItems(ATTACK_DROPS_24[npcId][4],1)
  340. if cond == 24:
  341. st.playSound("ItemSound.quest_finish")
  342. st.exitQuest(1)
  343. elif npcId in ATTACK_DROPS_25.keys() :
  344. cond = ATTACK_DROPS_25[npcId][0]
  345. chance = ATTACK_DROPS_25[npcId][3]
  346. if st.getInt("cond") == cond and self.getRandom(1000) < ATTACK_DROPS_25[npcId][3] and st.getQuestItemsCount(ATTACK_DROPS_25[npcId][4]) > 0 : # Attack drops are low chance
  347. st.giveItems(ATTACK_DROPS_25[npcId][1],ATTACK_DROPS_25[npcId][2])
  348. st.playSound("ItemSound.quest_itemget")
  349. st.takeItems(ATTACK_DROPS_25[npcId][4],1)
  350. if cond == 24:
  351. st.playSound("ItemSound.quest_finish")
  352. st.exitQuest(1)
  353. return
  354. def onKill(self,npc,player,isPet):
  355. st = self.getQuestState(player, False)
  356. if not st : return
  357. if st.getState() != State.STARTED : return
  358. npcId = npc.getId()
  359. if npcId in DROPS.keys() :
  360. cond = DROPS[npcId][0]
  361. if st.getInt("cond") == cond and st.getQuestItemsCount(DROPS[npcId][1]) < DROPS[npcId][2] and self.getRandom(100) < DROPS[npcId][3] and (DROPS[npcId][4] == 0 or st.getQuestItemsCount(DROPS[npcId][4])>0) :
  362. st.giveItems(DROPS[npcId][1],1)
  363. st.playSound("ItemSound.quest_itemget")
  364. if DROPS[npcId][4] != 0:
  365. st.takeItems(DROPS[npcId][4],1)
  366. # in accordance to http://www.l2jdp.com/forum//viewtopic.php?t=2974
  367. # quest ends when you get the blooded fabric
  368. if cond == 24:
  369. st.playSound("ItemSound.quest_finish")
  370. st.exitQuest(1)
  371. if npcId in DROPS_29.keys() :
  372. cond = DROPS_29[npcId][0]
  373. if st.getInt("cond") == cond and st.getQuestItemsCount(DROPS_29[npcId][1]) < DROPS[npcId][2] and self.getRandom(100) < DROPS[npcId][3] and (DROPS[npcId][4] == 0 or st.getQuestItemsCount(DROPS[npcId][4])>0) :
  374. st.giveItems(DROPS_29[npcId][1],1)
  375. st.playSound("ItemSound.quest_itemget")
  376. if DROPS_29[npcId][4] != 0:
  377. st.takeItems(DROPS_29[npcId][4],1)
  378. if npcId == ANGEL_KILLER :
  379. return "Ha, that was fun! If you wish to find the key, search the corpse"
  380. return
  381. # Quest class and state definition
  382. QUEST = Quest(QUEST_NUMBER, str(QUEST_NUMBER)+"_"+QUEST_NAME, QUEST_DESCRIPTION)
  383. QUEST.addStartNpc(HANELLIN)
  384. QUEST.addTalkId(HANELLIN)
  385. QUEST.addTalkId(ARK_GUARDIANS_CORPSE)
  386. for i in ARK_OWNERS.keys() + ARKS.keys() + BLOODY_OWNERS.keys() :
  387. QUEST.addTalkId(i)
  388. for i in DROPS.keys():
  389. QUEST.addKillId(i)
  390. QUEST.addAttackId(PLATINUM_TRIBE_SHAMAN)
  391. QUEST.addAttackId(PLATINUM_TRIBE_OVERLORD)