Q00221_TestimonyOfProsperity.java 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980
  1. /*
  2. * Copyright (C) 2004-2015 L2J DataPack
  3. *
  4. * This file is part of L2J DataPack.
  5. *
  6. * L2J DataPack is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J DataPack is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package quests.Q00221_TestimonyOfProsperity;
  20. import com.l2jserver.gameserver.enums.CategoryType;
  21. import com.l2jserver.gameserver.enums.QuestSound;
  22. import com.l2jserver.gameserver.enums.Race;
  23. import com.l2jserver.gameserver.model.actor.L2Npc;
  24. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  25. import com.l2jserver.gameserver.model.quest.Quest;
  26. import com.l2jserver.gameserver.model.quest.QuestState;
  27. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  28. import com.l2jserver.gameserver.util.Util;
  29. /**
  30. * Testimony Of Prosperity (221)
  31. * @author ivantotov
  32. */
  33. public final class Q00221_TestimonyOfProsperity extends Quest
  34. {
  35. // NPCs
  36. private static final int WAREHOUSE_KEEPER_WILFORD = 30005;
  37. private static final int WAREHOUSE_KEEPER_PARMAN = 30104;
  38. private static final int LILITH = 30368;
  39. private static final int GUARD_BRIGHT = 30466;
  40. private static final int TRADER_SHARI = 30517;
  41. private static final int TRADER_MION = 30519;
  42. private static final int IRON_GATES_LOCKIRIN = 30531;
  43. private static final int GOLDEN_WHEELS_SPIRON = 30532;
  44. private static final int SILVER_SCALES_BALANKI = 30533;
  45. private static final int BRONZE_KEYS_KEEF = 30534;
  46. private static final int GRAY_PILLAR_MEMBER_FILAUR = 30535;
  47. private static final int BLACK_ANVILS_ARIN = 30536;
  48. private static final int MARYSE_REDBONNET = 30553;
  49. private static final int MINER_BOLTER = 30554;
  50. private static final int CARRIER_TOROCCO = 30555;
  51. private static final int MASTER_TOMA = 30556;
  52. private static final int PIOTUR = 30597;
  53. private static final int EMILY = 30620;
  54. private static final int MAESTRO_NIKOLA = 30621;
  55. private static final int BOX_OF_TITAN = 30622;
  56. // Items
  57. private static final int ADENA = 57;
  58. private static final int ANIMAL_SKIN = 1867;
  59. private static final int RECIPE_TITAN_KEY = 3023;
  60. private static final int KEY_OF_TITAN = 3030;
  61. private static final int RING_OF_TESTIMONY_1ST = 3239;
  62. private static final int RING_OF_TESTIMONY_2ND = 3240;
  63. private static final int OLD_ACCOUNT_BOOK = 3241;
  64. private static final int BLESSED_SEED = 3242;
  65. private static final int EMILYS_RECIPE = 3243;
  66. private static final int LILITHS_ELVEN_WAFER = 3244;
  67. private static final int MAPHR_TABLET_FRAGMENT = 3245;
  68. private static final int COLLECTION_LICENSE = 3246;
  69. private static final int LOCKIRINS_1ST_NOTICE = 3247;
  70. private static final int LOCKIRINS_2ND_NOTICE = 3248;
  71. private static final int LOCKIRINS_3RD_NOTICE = 3249;
  72. private static final int LOCKIRINS_4TH_NOTICE = 3250;
  73. private static final int LOCKIRINS_5TH_NOTICE = 3251;
  74. private static final int CONTRIBUTION_OF_SHARI = 3252;
  75. private static final int CONTRIBUTION_OF_MION = 3253;
  76. private static final int CONTRIBUTION_OF_MARYSE = 3254;
  77. private static final int MARYSES_REQUEST = 3255;
  78. private static final int CONTRIBUTION_OF_TOMA = 3256;
  79. private static final int RECEIPT_OF_BOLTER = 3257;
  80. private static final int RECEIPT_OF_CONTRIBUTION_1ST = 3258;
  81. private static final int RECEIPT_OF_CONTRIBUTION_2ND = 3259;
  82. private static final int RECEIPT_OF_CONTRIBUTION_3RD = 3260;
  83. private static final int RECEIPT_OF_CONTRIBUTION_4TH = 3261;
  84. private static final int RECEIPT_OF_CONTRIBUTION_5TH = 3262;
  85. private static final int PROCURATION_OF_TOROCCO = 3263;
  86. private static final int BRIGHTS_LIST = 3264;
  87. private static final int MANDRAGORA_PETAL = 3265;
  88. private static final int CRIMSON_MOSS = 3266;
  89. private static final int MANDRAGORA_BOUGUET = 3267;
  90. private static final int PARMANS_INSTRUCTIONS = 3268;
  91. private static final int PARMANS_LETTER = 3269;
  92. private static final int CLAY_DOUGH = 3270;
  93. private static final int PATTERN_OF_KEYHOLE = 3271;
  94. private static final int NIKOLAS_LIST = 3272;
  95. private static final int STAKATO_SHELL = 3273;
  96. private static final int TOAD_LORD_SAC = 3274;
  97. private static final int MARSH_SPIDER_THORN = 3275;
  98. private static final int CRYSTAL_BROOCH = 3428;
  99. // Reward
  100. private static final int MARK_OF_PROSPERITY = 3238;
  101. private static final int DIMENSIONAL_DIAMOND = 7562;
  102. // Monster
  103. private static final int MANDRAGORA_SPROUT1 = 20154;
  104. private static final int MANDRAGORA_SAPLING = 20155;
  105. private static final int MANDRAGORA_BLOSSOM = 20156;
  106. private static final int MARSH_STAKATO = 20157;
  107. private static final int MANDRAGORA_SPROUT2 = 20223;
  108. private static final int GIANT_CRIMSON_ANT = 20228;
  109. private static final int MARSH_STAKATO_WORKER = 20230;
  110. private static final int TOAD_LORD = 20231;
  111. private static final int MARSH_STAKATO_SOLDIER = 20232;
  112. private static final int MARSH_SPIDER = 20233;
  113. private static final int MARSH_STAKATO_DRONE = 20234;
  114. // Misc
  115. private static final int MIN_LEVEL = 37;
  116. public Q00221_TestimonyOfProsperity()
  117. {
  118. super(221, Q00221_TestimonyOfProsperity.class.getSimpleName(), "Testimony Of Prosperity");
  119. addStartNpc(WAREHOUSE_KEEPER_PARMAN);
  120. addTalkId(WAREHOUSE_KEEPER_PARMAN, WAREHOUSE_KEEPER_WILFORD, LILITH, GUARD_BRIGHT, TRADER_SHARI, TRADER_MION, IRON_GATES_LOCKIRIN, GOLDEN_WHEELS_SPIRON, SILVER_SCALES_BALANKI, BRONZE_KEYS_KEEF, GRAY_PILLAR_MEMBER_FILAUR, BLACK_ANVILS_ARIN, MARYSE_REDBONNET, MINER_BOLTER, CARRIER_TOROCCO, MASTER_TOMA, PIOTUR, EMILY, MAESTRO_NIKOLA, BOX_OF_TITAN);
  121. addKillId(MANDRAGORA_SPROUT1, MANDRAGORA_SAPLING, MANDRAGORA_BLOSSOM, MARSH_STAKATO, MANDRAGORA_SPROUT2, GIANT_CRIMSON_ANT, MARSH_STAKATO_WORKER, TOAD_LORD, MARSH_STAKATO_SOLDIER, MARSH_SPIDER, MARSH_STAKATO_DRONE);
  122. registerQuestItems(RECIPE_TITAN_KEY, KEY_OF_TITAN, RING_OF_TESTIMONY_1ST, RING_OF_TESTIMONY_2ND, OLD_ACCOUNT_BOOK, BLESSED_SEED, EMILYS_RECIPE, LILITHS_ELVEN_WAFER, MAPHR_TABLET_FRAGMENT, COLLECTION_LICENSE, LOCKIRINS_1ST_NOTICE, LOCKIRINS_2ND_NOTICE, LOCKIRINS_3RD_NOTICE, LOCKIRINS_4TH_NOTICE, LOCKIRINS_5TH_NOTICE, CONTRIBUTION_OF_SHARI, CONTRIBUTION_OF_MION, CONTRIBUTION_OF_MARYSE, MARYSES_REQUEST, CONTRIBUTION_OF_TOMA, RECEIPT_OF_BOLTER, RECEIPT_OF_CONTRIBUTION_1ST, RECEIPT_OF_CONTRIBUTION_2ND, RECEIPT_OF_CONTRIBUTION_3RD, RECEIPT_OF_CONTRIBUTION_4TH, RECEIPT_OF_CONTRIBUTION_5TH, PROCURATION_OF_TOROCCO, BRIGHTS_LIST, MANDRAGORA_PETAL, CRIMSON_MOSS, MANDRAGORA_BOUGUET, PARMANS_INSTRUCTIONS, PARMANS_LETTER, CLAY_DOUGH, PATTERN_OF_KEYHOLE, NIKOLAS_LIST, STAKATO_SHELL, TOAD_LORD_SAC, MARSH_SPIDER_THORN, CRYSTAL_BROOCH);
  123. }
  124. @Override
  125. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  126. {
  127. final QuestState qs = getQuestState(player, false);
  128. if (qs == null)
  129. {
  130. return null;
  131. }
  132. String htmltext = null;
  133. switch (event)
  134. {
  135. case "ACCEPT":
  136. {
  137. if (qs.isCreated())
  138. {
  139. qs.startQuest();
  140. if (!hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  141. {
  142. giveItems(player, RING_OF_TESTIMONY_1ST, 1);
  143. }
  144. playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  145. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  146. {
  147. giveItems(player, DIMENSIONAL_DIAMOND, 50);
  148. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  149. htmltext = "30104-04e.htm";
  150. }
  151. else
  152. {
  153. htmltext = "30104-04.htm";
  154. }
  155. }
  156. break;
  157. }
  158. case "30104-08.html":
  159. {
  160. takeItems(player, RING_OF_TESTIMONY_1ST, 1);
  161. giveItems(player, RING_OF_TESTIMONY_2ND, 1);
  162. takeItems(player, OLD_ACCOUNT_BOOK, 1);
  163. takeItems(player, BLESSED_SEED, 1);
  164. takeItems(player, EMILYS_RECIPE, 1);
  165. takeItems(player, LILITHS_ELVEN_WAFER, 1);
  166. giveItems(player, PARMANS_LETTER, 1);
  167. qs.setCond(4, true);
  168. htmltext = event;
  169. break;
  170. }
  171. case "30104-04a.html":
  172. case "30104-04b.html":
  173. case "30104-04c.html":
  174. case "30104-04d.html":
  175. case "30104-05.html":
  176. case "30104-08a.html":
  177. case "30104-08b.html":
  178. case "30104-08c.html":
  179. case "30005-02.html":
  180. case "30005-03.html":
  181. case "30368-02.html":
  182. case "30466-02.html":
  183. case "30531-02.html":
  184. case "30620-02.html":
  185. case "30621-02.html":
  186. case "30621-03.html":
  187. {
  188. htmltext = event;
  189. break;
  190. }
  191. case "30005-04.html":
  192. {
  193. giveItems(player, CRYSTAL_BROOCH, 1);
  194. htmltext = event;
  195. break;
  196. }
  197. case "30368-03.html":
  198. {
  199. if (hasQuestItems(player, CRYSTAL_BROOCH))
  200. {
  201. giveItems(player, LILITHS_ELVEN_WAFER, 1);
  202. takeItems(player, CRYSTAL_BROOCH, 1);
  203. if (hasQuestItems(player, OLD_ACCOUNT_BOOK, BLESSED_SEED, EMILYS_RECIPE))
  204. {
  205. qs.setCond(2, true);
  206. }
  207. htmltext = event;
  208. }
  209. break;
  210. }
  211. case "30466-03.html":
  212. {
  213. giveItems(player, BRIGHTS_LIST, 1);
  214. htmltext = event;
  215. break;
  216. }
  217. case "30531-03.html":
  218. {
  219. giveItems(player, COLLECTION_LICENSE, 1);
  220. giveItems(player, LOCKIRINS_1ST_NOTICE, 1);
  221. giveItems(player, LOCKIRINS_2ND_NOTICE, 1);
  222. giveItems(player, LOCKIRINS_3RD_NOTICE, 1);
  223. giveItems(player, LOCKIRINS_4TH_NOTICE, 1);
  224. giveItems(player, LOCKIRINS_5TH_NOTICE, 1);
  225. htmltext = event;
  226. break;
  227. }
  228. case "30534-03a.html":
  229. {
  230. if (getQuestItemsCount(player, ADENA) < 5000)
  231. {
  232. htmltext = event;
  233. }
  234. else if (hasQuestItems(player, PROCURATION_OF_TOROCCO))
  235. {
  236. takeItems(player, ADENA, 5000);
  237. giveItems(player, RECEIPT_OF_CONTRIBUTION_3RD, 1);
  238. takeItems(player, PROCURATION_OF_TOROCCO, 1);
  239. htmltext = "30534-03b.html";
  240. }
  241. break;
  242. }
  243. case "30555-02.html":
  244. {
  245. giveItems(player, PROCURATION_OF_TOROCCO, 1);
  246. htmltext = event;
  247. break;
  248. }
  249. case "30597-02.html":
  250. {
  251. giveItems(player, BLESSED_SEED, 1);
  252. if (hasQuestItems(player, OLD_ACCOUNT_BOOK, EMILYS_RECIPE, LILITHS_ELVEN_WAFER))
  253. {
  254. qs.setCond(2, true);
  255. }
  256. htmltext = event;
  257. break;
  258. }
  259. case "30620-03.html":
  260. {
  261. if (hasQuestItems(player, MANDRAGORA_BOUGUET))
  262. {
  263. giveItems(player, EMILYS_RECIPE, 1);
  264. takeItems(player, MANDRAGORA_BOUGUET, 1);
  265. if (hasQuestItems(player, OLD_ACCOUNT_BOOK, BLESSED_SEED, LILITHS_ELVEN_WAFER))
  266. {
  267. qs.setCond(2, true);
  268. }
  269. htmltext = event;
  270. }
  271. break;
  272. }
  273. case "30621-04.html":
  274. {
  275. giveItems(player, CLAY_DOUGH, 1);
  276. qs.setCond(5, true);
  277. htmltext = event;
  278. break;
  279. }
  280. case "30622-02.html":
  281. {
  282. if (hasQuestItems(player, CLAY_DOUGH))
  283. {
  284. takeItems(player, CLAY_DOUGH, 1);
  285. giveItems(player, PATTERN_OF_KEYHOLE, 1);
  286. qs.setCond(6, true);
  287. htmltext = event;
  288. }
  289. break;
  290. }
  291. case "30622-04.html":
  292. {
  293. if (hasQuestItems(player, KEY_OF_TITAN))
  294. {
  295. takeItems(player, KEY_OF_TITAN, 1);
  296. giveItems(player, MAPHR_TABLET_FRAGMENT, 1);
  297. takeItems(player, NIKOLAS_LIST, 1);
  298. takeItems(player, RECIPE_TITAN_KEY, 1);
  299. takeItems(player, STAKATO_SHELL, -1);
  300. takeItems(player, TOAD_LORD_SAC, -1);
  301. takeItems(player, MARSH_SPIDER_THORN, -1);
  302. qs.setCond(9, true);
  303. htmltext = event;
  304. }
  305. break;
  306. }
  307. }
  308. return htmltext;
  309. }
  310. @Override
  311. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  312. {
  313. final QuestState qs = getQuestState(killer, false);
  314. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  315. {
  316. switch (npc.getId())
  317. {
  318. case MANDRAGORA_SPROUT1:
  319. case MANDRAGORA_SAPLING:
  320. case MANDRAGORA_BLOSSOM:
  321. case MANDRAGORA_SPROUT2:
  322. {
  323. if (hasQuestItems(killer, RING_OF_TESTIMONY_1ST, BRIGHTS_LIST) && !hasQuestItems(killer, EMILYS_RECIPE))
  324. {
  325. if ((getQuestItemsCount(killer, MANDRAGORA_PETAL) < 20))
  326. {
  327. giveItems(killer, MANDRAGORA_PETAL, 1);
  328. if (getQuestItemsCount(killer, MANDRAGORA_PETAL) == 20)
  329. {
  330. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  331. }
  332. else
  333. {
  334. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  335. }
  336. }
  337. }
  338. break;
  339. }
  340. case MARSH_STAKATO:
  341. case MARSH_STAKATO_WORKER:
  342. case MARSH_STAKATO_SOLDIER:
  343. case MARSH_STAKATO_DRONE:
  344. {
  345. if (hasQuestItems(killer, RING_OF_TESTIMONY_2ND, NIKOLAS_LIST) && !hasAtLeastOneQuestItem(killer, CLAY_DOUGH, PATTERN_OF_KEYHOLE))
  346. {
  347. if ((getQuestItemsCount(killer, STAKATO_SHELL) < 20))
  348. {
  349. giveItems(killer, STAKATO_SHELL, 1);
  350. if (getQuestItemsCount(killer, STAKATO_SHELL) == 20)
  351. {
  352. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  353. if ((getQuestItemsCount(killer, TOAD_LORD_SAC) >= 10) && (getQuestItemsCount(killer, MARSH_SPIDER_THORN) >= 10))
  354. {
  355. qs.setCond(8);
  356. }
  357. }
  358. else
  359. {
  360. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  361. }
  362. }
  363. }
  364. break;
  365. }
  366. case GIANT_CRIMSON_ANT:
  367. {
  368. if (hasQuestItems(killer, RING_OF_TESTIMONY_1ST, BRIGHTS_LIST) && !hasQuestItems(killer, EMILYS_RECIPE))
  369. {
  370. if ((getQuestItemsCount(killer, CRIMSON_MOSS) < 10))
  371. {
  372. giveItems(killer, CRIMSON_MOSS, 1);
  373. if (getQuestItemsCount(killer, CRIMSON_MOSS) == 10)
  374. {
  375. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  376. }
  377. else
  378. {
  379. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  380. }
  381. }
  382. }
  383. break;
  384. }
  385. case TOAD_LORD:
  386. {
  387. if (hasQuestItems(killer, RING_OF_TESTIMONY_2ND, NIKOLAS_LIST) && !hasAtLeastOneQuestItem(killer, CLAY_DOUGH, PATTERN_OF_KEYHOLE))
  388. {
  389. if ((getQuestItemsCount(killer, TOAD_LORD_SAC) < 10))
  390. {
  391. giveItems(killer, TOAD_LORD_SAC, 1);
  392. if (getQuestItemsCount(killer, TOAD_LORD_SAC) == 10)
  393. {
  394. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  395. if ((getQuestItemsCount(killer, STAKATO_SHELL) >= 20) && (getQuestItemsCount(killer, MARSH_SPIDER_THORN) >= 10))
  396. {
  397. qs.setCond(8);
  398. }
  399. }
  400. else
  401. {
  402. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  403. }
  404. }
  405. }
  406. break;
  407. }
  408. case MARSH_SPIDER:
  409. {
  410. if (hasQuestItems(killer, RING_OF_TESTIMONY_2ND, NIKOLAS_LIST) && !hasAtLeastOneQuestItem(killer, CLAY_DOUGH, PATTERN_OF_KEYHOLE))
  411. {
  412. if ((getQuestItemsCount(killer, MARSH_SPIDER_THORN) < 10))
  413. {
  414. giveItems(killer, MARSH_SPIDER_THORN, 1);
  415. if (getQuestItemsCount(killer, MARSH_SPIDER_THORN) == 10)
  416. {
  417. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  418. if ((getQuestItemsCount(killer, STAKATO_SHELL) >= 20) && (getQuestItemsCount(killer, TOAD_LORD_SAC) >= 10))
  419. {
  420. qs.setCond(8);
  421. }
  422. }
  423. else
  424. {
  425. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  426. }
  427. }
  428. }
  429. break;
  430. }
  431. }
  432. }
  433. return super.onKill(npc, killer, isSummon);
  434. }
  435. @Override
  436. public String onTalk(L2Npc npc, L2PcInstance player)
  437. {
  438. final QuestState qs = getQuestState(player, true);
  439. String htmltext = getNoQuestMsg(player);
  440. if (qs.isCreated())
  441. {
  442. if (npc.getId() == WAREHOUSE_KEEPER_PARMAN)
  443. {
  444. if ((player.getRace() == Race.DWARF) && (player.getLevel() >= MIN_LEVEL) && player.isInCategory(CategoryType.DWARF_2ND_GROUP))
  445. {
  446. htmltext = "30104-03.htm";
  447. }
  448. else if ((player.getRace() == Race.DWARF) && (player.getLevel() >= MIN_LEVEL))
  449. {
  450. htmltext = "30104-01a.html";
  451. }
  452. else if ((player.getRace() == Race.DWARF))
  453. {
  454. htmltext = "30104-02.html";
  455. }
  456. else
  457. {
  458. htmltext = "30104-01.html";
  459. }
  460. }
  461. }
  462. else if (qs.isStarted())
  463. {
  464. switch (npc.getId())
  465. {
  466. case WAREHOUSE_KEEPER_PARMAN:
  467. {
  468. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  469. {
  470. if (hasQuestItems(player, OLD_ACCOUNT_BOOK, BLESSED_SEED, EMILYS_RECIPE, LILITHS_ELVEN_WAFER))
  471. {
  472. htmltext = "30104-06.html";
  473. }
  474. else
  475. {
  476. htmltext = "30104-05.html";
  477. }
  478. }
  479. else if (hasQuestItems(player, PARMANS_INSTRUCTIONS))
  480. {
  481. takeItems(player, PARMANS_INSTRUCTIONS, 1);
  482. giveItems(player, RING_OF_TESTIMONY_2ND, 1);
  483. giveItems(player, PARMANS_LETTER, 1);
  484. qs.setCond(4, true);
  485. htmltext = "30104-10.html";
  486. }
  487. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  488. {
  489. if (hasQuestItems(player, PARMANS_LETTER))
  490. {
  491. htmltext = "30104-11.html";
  492. }
  493. else if (hasAtLeastOneQuestItem(player, CLAY_DOUGH, PATTERN_OF_KEYHOLE, NIKOLAS_LIST))
  494. {
  495. htmltext = "30104-12.html";
  496. }
  497. else if (hasQuestItems(player, MAPHR_TABLET_FRAGMENT))
  498. {
  499. giveAdena(player, 217682, true);
  500. giveItems(player, MARK_OF_PROSPERITY, 1);
  501. addExpAndSp(player, 1199958, 80080);
  502. qs.exitQuest(false, true);
  503. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  504. htmltext = "30104-13.html";
  505. }
  506. }
  507. break;
  508. }
  509. case WAREHOUSE_KEEPER_WILFORD:
  510. {
  511. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  512. {
  513. if (!hasAtLeastOneQuestItem(player, LILITHS_ELVEN_WAFER, CRYSTAL_BROOCH))
  514. {
  515. htmltext = "30005-01.html";
  516. }
  517. else if (hasQuestItems(player, CRYSTAL_BROOCH) && !hasQuestItems(player, LILITHS_ELVEN_WAFER))
  518. {
  519. htmltext = "30005-05.html";
  520. }
  521. else if (hasQuestItems(player, LILITHS_ELVEN_WAFER))
  522. {
  523. htmltext = "30005-06.html";
  524. }
  525. }
  526. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  527. {
  528. htmltext = "30005-07.html";
  529. }
  530. break;
  531. }
  532. case LILITH:
  533. {
  534. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  535. {
  536. if (hasQuestItems(player, CRYSTAL_BROOCH) && !hasQuestItems(player, LILITHS_ELVEN_WAFER))
  537. {
  538. htmltext = "30368-01.html";
  539. }
  540. else
  541. {
  542. htmltext = "30368-04.html";
  543. }
  544. }
  545. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  546. {
  547. htmltext = "30368-05.html";
  548. }
  549. break;
  550. }
  551. case GUARD_BRIGHT:
  552. {
  553. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  554. {
  555. if (!hasAtLeastOneQuestItem(player, EMILYS_RECIPE, BRIGHTS_LIST, MANDRAGORA_BOUGUET))
  556. {
  557. htmltext = "30466-01.html";
  558. }
  559. else if (hasQuestItems(player, BRIGHTS_LIST) && !hasQuestItems(player, EMILYS_RECIPE))
  560. {
  561. if ((getQuestItemsCount(player, MANDRAGORA_PETAL) < 20) || (getQuestItemsCount(player, CRIMSON_MOSS) < 10))
  562. {
  563. htmltext = "30466-04.html";
  564. }
  565. else
  566. {
  567. takeItems(player, BRIGHTS_LIST, 1);
  568. takeItems(player, MANDRAGORA_PETAL, -1);
  569. takeItems(player, CRIMSON_MOSS, -1);
  570. giveItems(player, MANDRAGORA_BOUGUET, 1);
  571. htmltext = "30466-05.html";
  572. }
  573. }
  574. else if (hasQuestItems(player, MANDRAGORA_BOUGUET) && !hasAtLeastOneQuestItem(player, EMILYS_RECIPE, BRIGHTS_LIST))
  575. {
  576. htmltext = "30466-06.html";
  577. }
  578. else if (hasQuestItems(player, EMILYS_RECIPE))
  579. {
  580. htmltext = "30466-07.html";
  581. }
  582. }
  583. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  584. {
  585. htmltext = "30466-08.html";
  586. }
  587. break;
  588. }
  589. case TRADER_SHARI:
  590. {
  591. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  592. {
  593. if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_1ST, CONTRIBUTION_OF_SHARI, LOCKIRINS_1ST_NOTICE))
  594. {
  595. giveItems(player, CONTRIBUTION_OF_SHARI, 1);
  596. htmltext = "30517-01.html";
  597. }
  598. else if (hasQuestItems(player, CONTRIBUTION_OF_SHARI) && !hasAtLeastOneQuestItem(player, LOCKIRINS_1ST_NOTICE, RECEIPT_OF_CONTRIBUTION_1ST))
  599. {
  600. htmltext = "30517-02.html";
  601. }
  602. }
  603. break;
  604. }
  605. case TRADER_MION:
  606. {
  607. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  608. {
  609. if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_2ND, CONTRIBUTION_OF_MION, LOCKIRINS_2ND_NOTICE))
  610. {
  611. giveItems(player, CONTRIBUTION_OF_MION, 1);
  612. htmltext = "30519-01.html";
  613. }
  614. else if (hasQuestItems(player, CONTRIBUTION_OF_MION) && !hasAtLeastOneQuestItem(player, LOCKIRINS_2ND_NOTICE, RECEIPT_OF_CONTRIBUTION_2ND))
  615. {
  616. htmltext = "30519-02.html";
  617. }
  618. }
  619. break;
  620. }
  621. case IRON_GATES_LOCKIRIN:
  622. {
  623. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  624. {
  625. if (!hasAtLeastOneQuestItem(player, COLLECTION_LICENSE, OLD_ACCOUNT_BOOK))
  626. {
  627. htmltext = "30531-01.html";
  628. }
  629. else if (hasQuestItems(player, COLLECTION_LICENSE))
  630. {
  631. if (hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_1ST, RECEIPT_OF_CONTRIBUTION_2ND, RECEIPT_OF_CONTRIBUTION_3RD, RECEIPT_OF_CONTRIBUTION_4TH, RECEIPT_OF_CONTRIBUTION_5TH))
  632. {
  633. giveItems(player, OLD_ACCOUNT_BOOK, 1);
  634. takeItems(player, COLLECTION_LICENSE, 1);
  635. takeItems(player, RECEIPT_OF_CONTRIBUTION_1ST, 1);
  636. takeItems(player, RECEIPT_OF_CONTRIBUTION_2ND, 1);
  637. takeItems(player, RECEIPT_OF_CONTRIBUTION_3RD, 1);
  638. takeItems(player, RECEIPT_OF_CONTRIBUTION_4TH, 1);
  639. takeItems(player, RECEIPT_OF_CONTRIBUTION_5TH, 1);
  640. playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  641. if (hasQuestItems(player, BLESSED_SEED, EMILYS_RECIPE, LILITHS_ELVEN_WAFER))
  642. {
  643. qs.setCond(2, true);
  644. }
  645. htmltext = "30531-05.html";
  646. }
  647. else
  648. {
  649. htmltext = "30531-04.html";
  650. }
  651. }
  652. else if (hasQuestItems(player, OLD_ACCOUNT_BOOK) && !hasQuestItems(player, COLLECTION_LICENSE))
  653. {
  654. htmltext = "30531-06.html";
  655. }
  656. }
  657. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  658. {
  659. htmltext = "30531-07.html";
  660. }
  661. break;
  662. }
  663. case GOLDEN_WHEELS_SPIRON:
  664. {
  665. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  666. {
  667. if (hasQuestItems(player, LOCKIRINS_1ST_NOTICE) && !hasAtLeastOneQuestItem(player, CONTRIBUTION_OF_SHARI, RECEIPT_OF_CONTRIBUTION_1ST))
  668. {
  669. takeItems(player, LOCKIRINS_1ST_NOTICE, 1);
  670. htmltext = "30532-01.html";
  671. }
  672. else if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_1ST, CONTRIBUTION_OF_SHARI, LOCKIRINS_1ST_NOTICE))
  673. {
  674. htmltext = "30532-02.html";
  675. }
  676. else if (hasQuestItems(player, CONTRIBUTION_OF_SHARI) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_1ST, LOCKIRINS_1ST_NOTICE))
  677. {
  678. takeItems(player, CONTRIBUTION_OF_SHARI, 1);
  679. giveItems(player, RECEIPT_OF_CONTRIBUTION_1ST, 1);
  680. htmltext = "30532-03.html";
  681. }
  682. else if (hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_1ST) && !hasAtLeastOneQuestItem(player, CONTRIBUTION_OF_SHARI, LOCKIRINS_1ST_NOTICE))
  683. {
  684. htmltext = "30532-04.html";
  685. }
  686. }
  687. break;
  688. }
  689. case SILVER_SCALES_BALANKI:
  690. {
  691. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  692. {
  693. if (hasQuestItems(player, LOCKIRINS_2ND_NOTICE) && !hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_2ND) && ((getQuestItemsCount(player, CONTRIBUTION_OF_MION) + getQuestItemsCount(player, CONTRIBUTION_OF_MARYSE)) < 2))
  694. {
  695. takeItems(player, LOCKIRINS_2ND_NOTICE, 1);
  696. htmltext = "30533-01.html";
  697. }
  698. else if (!hasAtLeastOneQuestItem(player, LOCKIRINS_2ND_NOTICE, RECEIPT_OF_CONTRIBUTION_2ND) && ((getQuestItemsCount(player, CONTRIBUTION_OF_MION) + getQuestItemsCount(player, CONTRIBUTION_OF_MARYSE)) < 2))
  699. {
  700. htmltext = "30533-02.html";
  701. }
  702. else if (!hasAtLeastOneQuestItem(player, LOCKIRINS_2ND_NOTICE, RECEIPT_OF_CONTRIBUTION_2ND) && hasQuestItems(player, CONTRIBUTION_OF_MION, CONTRIBUTION_OF_MARYSE))
  703. {
  704. takeItems(player, CONTRIBUTION_OF_MION, 1);
  705. takeItems(player, CONTRIBUTION_OF_MARYSE, 1);
  706. giveItems(player, RECEIPT_OF_CONTRIBUTION_2ND, 1);
  707. htmltext = "30533-03.html";
  708. }
  709. else if (!hasQuestItems(player, LOCKIRINS_2ND_NOTICE) && hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_2ND) && !hasQuestItems(player, CONTRIBUTION_OF_MION, CONTRIBUTION_OF_MARYSE))
  710. {
  711. htmltext = "30533-04.html";
  712. }
  713. }
  714. break;
  715. }
  716. case BRONZE_KEYS_KEEF:
  717. {
  718. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  719. {
  720. if (hasQuestItems(player, LOCKIRINS_3RD_NOTICE) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_3RD, PROCURATION_OF_TOROCCO))
  721. {
  722. takeItems(player, LOCKIRINS_3RD_NOTICE, 1);
  723. htmltext = "30534-01.html";
  724. }
  725. else if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_3RD, PROCURATION_OF_TOROCCO, LOCKIRINS_3RD_NOTICE))
  726. {
  727. htmltext = "30534-02.html";
  728. }
  729. else if (hasQuestItems(player, PROCURATION_OF_TOROCCO) && !hasAtLeastOneQuestItem(player, LOCKIRINS_3RD_NOTICE, RECEIPT_OF_CONTRIBUTION_3RD))
  730. {
  731. htmltext = "30534-03.html";
  732. }
  733. else if (hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_3RD) && !hasAtLeastOneQuestItem(player, PROCURATION_OF_TOROCCO, LOCKIRINS_3RD_NOTICE))
  734. {
  735. htmltext = "30534-04.html";
  736. }
  737. }
  738. break;
  739. }
  740. case GRAY_PILLAR_MEMBER_FILAUR:
  741. {
  742. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  743. {
  744. if (hasQuestItems(player, LOCKIRINS_4TH_NOTICE) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_4TH, RECEIPT_OF_BOLTER))
  745. {
  746. takeItems(player, LOCKIRINS_4TH_NOTICE, 1);
  747. htmltext = "30535-01.html";
  748. }
  749. else if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_4TH, RECEIPT_OF_BOLTER, LOCKIRINS_4TH_NOTICE))
  750. {
  751. htmltext = "30535-02.html";
  752. }
  753. else if (hasQuestItems(player, RECEIPT_OF_BOLTER) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_4TH, LOCKIRINS_4TH_NOTICE))
  754. {
  755. takeItems(player, RECEIPT_OF_BOLTER, 1);
  756. giveItems(player, RECEIPT_OF_CONTRIBUTION_4TH, 1);
  757. htmltext = "30535-03.html";
  758. }
  759. else if (hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_4TH) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_BOLTER, LOCKIRINS_4TH_NOTICE))
  760. {
  761. htmltext = "30535-04.html";
  762. }
  763. }
  764. break;
  765. }
  766. case BLACK_ANVILS_ARIN:
  767. {
  768. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  769. {
  770. if (hasQuestItems(player, LOCKIRINS_5TH_NOTICE) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_5TH, CONTRIBUTION_OF_TOMA))
  771. {
  772. takeItems(player, LOCKIRINS_5TH_NOTICE, 1);
  773. htmltext = "30536-01.html";
  774. }
  775. else if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_5TH, CONTRIBUTION_OF_TOMA, LOCKIRINS_5TH_NOTICE))
  776. {
  777. htmltext = "30536-02.html";
  778. }
  779. else if (hasQuestItems(player, CONTRIBUTION_OF_TOMA) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_5TH, LOCKIRINS_5TH_NOTICE))
  780. {
  781. takeItems(player, CONTRIBUTION_OF_TOMA, 1);
  782. giveItems(player, RECEIPT_OF_CONTRIBUTION_5TH, 1);
  783. htmltext = "30536-03.html";
  784. }
  785. else if (hasQuestItems(player, RECEIPT_OF_CONTRIBUTION_5TH) && !hasAtLeastOneQuestItem(player, CONTRIBUTION_OF_TOMA, LOCKIRINS_5TH_NOTICE))
  786. {
  787. htmltext = "30536-04.html";
  788. }
  789. }
  790. break;
  791. }
  792. case MARYSE_REDBONNET:
  793. {
  794. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  795. {
  796. if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_2ND, CONTRIBUTION_OF_MARYSE, LOCKIRINS_2ND_NOTICE, MARYSES_REQUEST))
  797. {
  798. giveItems(player, MARYSES_REQUEST, 1);
  799. htmltext = "30553-01.html";
  800. }
  801. else if (hasQuestItems(player, MARYSES_REQUEST) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_2ND, CONTRIBUTION_OF_MARYSE, LOCKIRINS_2ND_NOTICE))
  802. {
  803. if (getQuestItemsCount(player, ANIMAL_SKIN) < 10)
  804. {
  805. htmltext = "30553-02.html";
  806. }
  807. else
  808. {
  809. takeItems(player, ANIMAL_SKIN, 10);
  810. giveItems(player, CONTRIBUTION_OF_MARYSE, 1);
  811. takeItems(player, MARYSES_REQUEST, 1);
  812. htmltext = "30553-03.html";
  813. }
  814. }
  815. else if (hasQuestItems(player, CONTRIBUTION_OF_MARYSE) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_2ND, LOCKIRINS_2ND_NOTICE, MARYSES_REQUEST))
  816. {
  817. htmltext = "30553-04.html";
  818. }
  819. }
  820. break;
  821. }
  822. case MINER_BOLTER:
  823. {
  824. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  825. {
  826. if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_4TH, RECEIPT_OF_BOLTER, LOCKIRINS_4TH_NOTICE))
  827. {
  828. giveItems(player, RECEIPT_OF_BOLTER, 1);
  829. htmltext = "30554-01.html";
  830. }
  831. else if (hasQuestItems(player, RECEIPT_OF_BOLTER) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_4TH, LOCKIRINS_4TH_NOTICE))
  832. {
  833. htmltext = "30554-02.html";
  834. }
  835. }
  836. break;
  837. }
  838. case CARRIER_TOROCCO:
  839. {
  840. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  841. {
  842. if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_3RD, PROCURATION_OF_TOROCCO, LOCKIRINS_3RD_NOTICE))
  843. {
  844. htmltext = "30555-01.html";
  845. }
  846. else if (hasQuestItems(player, PROCURATION_OF_TOROCCO) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_3RD, LOCKIRINS_3RD_NOTICE))
  847. {
  848. htmltext = "30555-03.html";
  849. }
  850. }
  851. break;
  852. }
  853. case MASTER_TOMA:
  854. {
  855. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST, COLLECTION_LICENSE))
  856. {
  857. if (!hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_5TH, CONTRIBUTION_OF_TOMA, LOCKIRINS_5TH_NOTICE))
  858. {
  859. giveItems(player, CONTRIBUTION_OF_TOMA, 1);
  860. htmltext = "30556-01.html";
  861. }
  862. else if (hasQuestItems(player, CONTRIBUTION_OF_TOMA) && !hasAtLeastOneQuestItem(player, RECEIPT_OF_CONTRIBUTION_5TH, LOCKIRINS_5TH_NOTICE))
  863. {
  864. htmltext = "30556-02.html";
  865. }
  866. }
  867. break;
  868. }
  869. case PIOTUR:
  870. {
  871. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  872. {
  873. if (!hasQuestItems(player, BLESSED_SEED))
  874. {
  875. htmltext = "30597-01.html";
  876. }
  877. else
  878. {
  879. htmltext = "30597-03.html";
  880. }
  881. }
  882. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  883. {
  884. htmltext = "30597-04.html";
  885. }
  886. break;
  887. }
  888. case EMILY:
  889. {
  890. if (hasQuestItems(player, RING_OF_TESTIMONY_1ST))
  891. {
  892. if (hasQuestItems(player, MANDRAGORA_BOUGUET) && !hasAtLeastOneQuestItem(player, EMILYS_RECIPE, BRIGHTS_LIST))
  893. {
  894. htmltext = "30620-01.html";
  895. }
  896. else if (hasQuestItems(player, EMILYS_RECIPE))
  897. {
  898. htmltext = "30620-04.html";
  899. }
  900. }
  901. else if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  902. {
  903. htmltext = "30620-05.html";
  904. }
  905. break;
  906. }
  907. case MAESTRO_NIKOLA:
  908. {
  909. if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  910. {
  911. if (!hasAtLeastOneQuestItem(player, CLAY_DOUGH, PATTERN_OF_KEYHOLE, NIKOLAS_LIST, MAPHR_TABLET_FRAGMENT))
  912. {
  913. takeItems(player, PARMANS_LETTER, 1);
  914. htmltext = "30621-01.html";
  915. }
  916. else if (hasQuestItems(player, CLAY_DOUGH) && !hasAtLeastOneQuestItem(player, PATTERN_OF_KEYHOLE, NIKOLAS_LIST, MAPHR_TABLET_FRAGMENT))
  917. {
  918. htmltext = "30621-05.html";
  919. }
  920. else if (hasQuestItems(player, PATTERN_OF_KEYHOLE) && !hasAtLeastOneQuestItem(player, CLAY_DOUGH, NIKOLAS_LIST, MAPHR_TABLET_FRAGMENT))
  921. {
  922. giveItems(player, RECIPE_TITAN_KEY, 1);
  923. takeItems(player, PATTERN_OF_KEYHOLE, 1);
  924. giveItems(player, NIKOLAS_LIST, 1);
  925. qs.setCond(7, true);
  926. htmltext = "30621-06.html";
  927. }
  928. else if (hasQuestItems(player, NIKOLAS_LIST) && !hasAtLeastOneQuestItem(player, CLAY_DOUGH, PATTERN_OF_KEYHOLE, MAPHR_TABLET_FRAGMENT, KEY_OF_TITAN))
  929. {
  930. htmltext = "30621-07.html";
  931. }
  932. else if (hasQuestItems(player, NIKOLAS_LIST, KEY_OF_TITAN) && !hasAtLeastOneQuestItem(player, CLAY_DOUGH, PATTERN_OF_KEYHOLE, MAPHR_TABLET_FRAGMENT))
  933. {
  934. htmltext = "30621-08.html";
  935. }
  936. else if (hasQuestItems(player, MAPHR_TABLET_FRAGMENT) && !hasAtLeastOneQuestItem(player, CLAY_DOUGH, PATTERN_OF_KEYHOLE, NIKOLAS_LIST))
  937. {
  938. htmltext = "30621-09.html";
  939. }
  940. }
  941. break;
  942. }
  943. case BOX_OF_TITAN:
  944. {
  945. if (hasQuestItems(player, RING_OF_TESTIMONY_2ND))
  946. {
  947. if (hasQuestItems(player, CLAY_DOUGH) && !hasQuestItems(player, PATTERN_OF_KEYHOLE))
  948. {
  949. htmltext = "30622-01.html";
  950. }
  951. else if (hasQuestItems(player, KEY_OF_TITAN) && !hasQuestItems(player, MAPHR_TABLET_FRAGMENT))
  952. {
  953. htmltext = "30622-03.html";
  954. }
  955. else if (!hasAtLeastOneQuestItem(player, KEY_OF_TITAN, CLAY_DOUGH))
  956. {
  957. htmltext = "30622-05.html";
  958. }
  959. }
  960. break;
  961. }
  962. }
  963. }
  964. else if (qs.isCompleted())
  965. {
  966. if (npc.getId() == WAREHOUSE_KEEPER_PARMAN)
  967. {
  968. htmltext = getAlreadyCompletedMsg(player);
  969. }
  970. }
  971. return htmltext;
  972. }
  973. }