Q00226_TestOfTheHealer.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  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.Q00226_TestOfTheHealer;
  20. import com.l2jserver.gameserver.enums.CategoryType;
  21. import com.l2jserver.gameserver.enums.QuestSound;
  22. import com.l2jserver.gameserver.model.actor.L2Npc;
  23. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  24. import com.l2jserver.gameserver.model.base.ClassId;
  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. * Test Of The Healer(226)
  31. * @author ivantotov
  32. */
  33. public final class Q00226_TestOfTheHealer extends Quest
  34. {
  35. // NPCs
  36. private static final int MASTER_SORIUS = 30327;
  37. private static final int ALLANA = 30424;
  38. private static final int PERRIN = 30428;
  39. private static final int PRIEST_BANDELLOS = 30473;
  40. private static final int FATHER_GUPU = 30658;
  41. private static final int ORPHAN_GIRL = 30659;
  42. private static final int WINDY_SHAORING = 30660;
  43. private static final int MYSTERIOUS_DARK_ELF = 30661;
  44. private static final int PIPER_LONGBOW = 30662;
  45. private static final int SLEIN_SHINING_BLADE = 30663;
  46. private static final int CAIN_FLYING_KNIFE = 30664;
  47. private static final int SAINT_KRISTINA = 30665;
  48. private static final int DAURIN_HAMMERCRUSH = 30674;
  49. // Items
  50. private static final int ADENA = 57;
  51. private static final int REPORT_OF_PERRIN = 2810;
  52. private static final int CRISTINAS_LETTER = 2811;
  53. private static final int PICTURE_OF_WINDY = 2812;
  54. private static final int GOLDEN_STATUE = 2813;
  55. private static final int WINDYS_PEBBLES = 2814;
  56. private static final int ORDER_OF_SORIUS = 2815;
  57. private static final int SECRET_LETTER1 = 2816;
  58. private static final int SECRET_LETTER2 = 2817;
  59. private static final int SECRET_LETTER3 = 2818;
  60. private static final int SECRET_LETTER4 = 2819;
  61. // Reward
  62. private static final int MARK_OF_HEALER = 2820;
  63. private static final int DIMENSIONAL_DIAMOND = 7562;
  64. // Quest Monster
  65. private static final int LERO_LIZARDMAN_AGENT = 27122;
  66. private static final int LERO_LIZARDMAN_LEADER = 27123;
  67. private static final int LERO_LIZARDMAN_ASSASSIN = 27124;
  68. private static final int LERO_LIZARDMAN_SNIPER = 27125;
  69. private static final int LERO_LIZARDMAN_WIZARD = 27126;
  70. private static final int LERO_LIZARDMAN_LORD = 27127;
  71. private static final int TATOMA = 27134;
  72. // Misc
  73. private static final int MIN_LEVEL = 39;
  74. public Q00226_TestOfTheHealer()
  75. {
  76. super(226, Q00226_TestOfTheHealer.class.getSimpleName(), "Test Of The Healer");
  77. addStartNpc(PRIEST_BANDELLOS);
  78. addTalkId(PRIEST_BANDELLOS, MASTER_SORIUS, ALLANA, PERRIN, FATHER_GUPU, ORPHAN_GIRL, WINDY_SHAORING, MYSTERIOUS_DARK_ELF, PIPER_LONGBOW, SLEIN_SHINING_BLADE, CAIN_FLYING_KNIFE, SAINT_KRISTINA, DAURIN_HAMMERCRUSH);
  79. addKillId(LERO_LIZARDMAN_AGENT, LERO_LIZARDMAN_LEADER, LERO_LIZARDMAN_ASSASSIN, LERO_LIZARDMAN_SNIPER, LERO_LIZARDMAN_WIZARD, LERO_LIZARDMAN_LORD, TATOMA);
  80. registerQuestItems(REPORT_OF_PERRIN, CRISTINAS_LETTER, PICTURE_OF_WINDY, GOLDEN_STATUE, WINDYS_PEBBLES, ORDER_OF_SORIUS, SECRET_LETTER1, SECRET_LETTER2, SECRET_LETTER3, SECRET_LETTER4);
  81. }
  82. @Override
  83. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  84. {
  85. final QuestState qs = getQuestState(player, false);
  86. if (qs == null)
  87. {
  88. return null;
  89. }
  90. String htmltext = null;
  91. switch (event)
  92. {
  93. case "ACCEPT":
  94. {
  95. if (qs.isCreated())
  96. {
  97. qs.startQuest();
  98. qs.setMemoState(1);
  99. playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  100. giveItems(player, REPORT_OF_PERRIN, 1);
  101. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  102. {
  103. if (player.getClassId() == ClassId.cleric)
  104. {
  105. giveItems(player, DIMENSIONAL_DIAMOND, 60);
  106. }
  107. else if (player.getClassId() == ClassId.knight)
  108. {
  109. giveItems(player, DIMENSIONAL_DIAMOND, 104);
  110. }
  111. else if (player.getClassId() == ClassId.oracle)
  112. {
  113. giveItems(player, DIMENSIONAL_DIAMOND, 45);
  114. }
  115. else
  116. {
  117. giveItems(player, DIMENSIONAL_DIAMOND, 72);
  118. }
  119. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  120. htmltext = "30473-04a.htm";
  121. }
  122. else
  123. {
  124. htmltext = "30473-04.htm";
  125. }
  126. }
  127. break;
  128. }
  129. case "30473-08.html":
  130. {
  131. if (qs.isMemoState(10) && hasQuestItems(player, GOLDEN_STATUE))
  132. {
  133. htmltext = event;
  134. }
  135. break;
  136. }
  137. case "30473-09.html":
  138. {
  139. if (qs.isMemoState(10) && hasQuestItems(player, GOLDEN_STATUE))
  140. {
  141. giveAdena(player, 233490, true);
  142. giveItems(player, MARK_OF_HEALER, 1);
  143. addExpAndSp(player, 738283, 50662);
  144. qs.exitQuest(false, true);
  145. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  146. htmltext = event;
  147. }
  148. break;
  149. }
  150. case "30428-02.html":
  151. {
  152. if (qs.isMemoState(1) && hasQuestItems(player, REPORT_OF_PERRIN))
  153. {
  154. qs.setCond(2, true);
  155. if (npc.getSummonedNpcCount() < 1)
  156. {
  157. addAttackPlayerDesire(addSpawn(npc, TATOMA, npc, true, 200000), player);
  158. }
  159. }
  160. htmltext = event;
  161. break;
  162. }
  163. case "30658-02.html":
  164. {
  165. if (qs.isMemoState(4) && !hasAtLeastOneQuestItem(player, PICTURE_OF_WINDY, WINDYS_PEBBLES, GOLDEN_STATUE))
  166. {
  167. if (getQuestItemsCount(player, ADENA) >= 100000)
  168. {
  169. takeItems(player, ADENA, 100000);
  170. giveItems(player, PICTURE_OF_WINDY, 1);
  171. qs.setCond(7, true);
  172. htmltext = event;
  173. }
  174. else
  175. {
  176. htmltext = "30658-05.html";
  177. }
  178. }
  179. break;
  180. }
  181. case "30658-03.html":
  182. {
  183. if (qs.isMemoState(4) && !hasAtLeastOneQuestItem(player, PICTURE_OF_WINDY, WINDYS_PEBBLES, GOLDEN_STATUE))
  184. {
  185. qs.setMemoState(5);
  186. htmltext = event;
  187. }
  188. break;
  189. }
  190. case "30658-07.html":
  191. {
  192. htmltext = event;
  193. break;
  194. }
  195. case "30660-02.html":
  196. {
  197. if (hasQuestItems(player, PICTURE_OF_WINDY))
  198. {
  199. htmltext = event;
  200. }
  201. break;
  202. }
  203. case "30660-03.html":
  204. {
  205. if (hasQuestItems(player, PICTURE_OF_WINDY))
  206. {
  207. takeItems(player, PICTURE_OF_WINDY, 1);
  208. giveItems(player, WINDYS_PEBBLES, 1);
  209. qs.setCond(8, true);
  210. npc.deleteMe();
  211. htmltext = event;
  212. }
  213. break;
  214. }
  215. case "30665-02.html":
  216. {
  217. if ((getQuestItemsCount(player, SECRET_LETTER1) + getQuestItemsCount(player, SECRET_LETTER2) + getQuestItemsCount(player, SECRET_LETTER3) + getQuestItemsCount(player, SECRET_LETTER4)) == 4)
  218. {
  219. giveItems(player, CRISTINAS_LETTER, 1);
  220. takeItems(player, SECRET_LETTER1, 1);
  221. takeItems(player, SECRET_LETTER2, 1);
  222. takeItems(player, SECRET_LETTER3, 1);
  223. takeItems(player, SECRET_LETTER4, 1);
  224. qs.setMemoState(9);
  225. qs.setCond(22, true);
  226. htmltext = event;
  227. }
  228. break;
  229. }
  230. case "30674-02.html":
  231. {
  232. if (qs.isMemoState(6))
  233. {
  234. qs.setCond(11);
  235. takeItems(player, ORDER_OF_SORIUS, 1);
  236. addSpawn(npc, LERO_LIZARDMAN_AGENT, npc, true, 200000);
  237. addSpawn(npc, LERO_LIZARDMAN_AGENT, npc, true, 200000);
  238. addSpawn(npc, LERO_LIZARDMAN_LEADER, npc, true, 200000);
  239. playSound(player, QuestSound.ITEMSOUND_QUEST_BEFORE_BATTLE);
  240. htmltext = event;
  241. }
  242. break;
  243. }
  244. }
  245. return htmltext;
  246. }
  247. @Override
  248. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  249. {
  250. final QuestState qs = getQuestState(killer, false);
  251. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  252. {
  253. switch (npc.getId())
  254. {
  255. case LERO_LIZARDMAN_LEADER:
  256. {
  257. if (qs.isMemoState(6) && !hasQuestItems(killer, SECRET_LETTER1))
  258. {
  259. giveItems(killer, SECRET_LETTER1, 1);
  260. qs.setCond(12, true);
  261. }
  262. break;
  263. }
  264. case LERO_LIZARDMAN_ASSASSIN:
  265. {
  266. if (qs.isMemoState(8) && hasQuestItems(killer, SECRET_LETTER1) && !hasQuestItems(killer, SECRET_LETTER2))
  267. {
  268. giveItems(killer, SECRET_LETTER2, 1);
  269. qs.setCond(15, true);
  270. }
  271. break;
  272. }
  273. case LERO_LIZARDMAN_SNIPER:
  274. {
  275. if (qs.isMemoState(8) && hasQuestItems(killer, SECRET_LETTER1) && !hasQuestItems(killer, SECRET_LETTER3))
  276. {
  277. giveItems(killer, SECRET_LETTER3, 1);
  278. qs.setCond(17, true);
  279. }
  280. break;
  281. }
  282. case LERO_LIZARDMAN_LORD:
  283. {
  284. if (qs.isMemoState(8) && hasQuestItems(killer, SECRET_LETTER1) && !hasQuestItems(killer, SECRET_LETTER4))
  285. {
  286. giveItems(killer, SECRET_LETTER4, 1);
  287. qs.setCond(19, true);
  288. }
  289. break;
  290. }
  291. case TATOMA:
  292. {
  293. if (qs.isMemoState(1))
  294. {
  295. qs.setMemoState(2);
  296. qs.setCond(3, true);
  297. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  298. }
  299. break;
  300. }
  301. }
  302. }
  303. return super.onKill(npc, killer, isSummon);
  304. }
  305. @Override
  306. public String onTalk(L2Npc npc, L2PcInstance player)
  307. {
  308. final QuestState qs = getQuestState(player, true);
  309. final int memoState = qs.getMemoState();
  310. String htmltext = getNoQuestMsg(player);
  311. if (qs.isCreated())
  312. {
  313. if (npc.getId() == PRIEST_BANDELLOS)
  314. {
  315. if (player.isInCategory(CategoryType.WHITE_MAGIC_GROUP))
  316. {
  317. if (player.getLevel() >= MIN_LEVEL)
  318. {
  319. htmltext = "30473-03.htm";
  320. }
  321. else
  322. {
  323. htmltext = "30473-01.html";
  324. }
  325. }
  326. else
  327. {
  328. htmltext = "30473-02.html";
  329. }
  330. }
  331. }
  332. else if (qs.isStarted())
  333. {
  334. switch (npc.getId())
  335. {
  336. case PRIEST_BANDELLOS:
  337. {
  338. if ((memoState >= 1) && (memoState < 10))
  339. {
  340. htmltext = "30473-05.html";
  341. }
  342. else if (memoState == 10)
  343. {
  344. if (hasQuestItems(player, GOLDEN_STATUE))
  345. {
  346. htmltext = "30473-07.html";
  347. }
  348. else
  349. {
  350. giveAdena(player, 266980, true);
  351. giveItems(player, MARK_OF_HEALER, 1);
  352. addExpAndSp(player, 1476566, 101324);
  353. qs.exitQuest(false, true);
  354. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  355. htmltext = "30473-06.html";
  356. }
  357. }
  358. break;
  359. }
  360. case MASTER_SORIUS:
  361. {
  362. if (memoState == 5)
  363. {
  364. giveItems(player, ORDER_OF_SORIUS, 1);
  365. qs.setMemoState(6);
  366. qs.setCond(10, true);
  367. htmltext = "30327-01.html";
  368. }
  369. else if ((memoState >= 6) && (memoState < 9))
  370. {
  371. htmltext = "30327-02.html";
  372. }
  373. else if (memoState == 9)
  374. {
  375. if (hasQuestItems(player, CRISTINAS_LETTER))
  376. {
  377. takeItems(player, CRISTINAS_LETTER, 1);
  378. qs.setMemoState(10);
  379. qs.setCond(23, true);
  380. htmltext = "30327-03.html";
  381. }
  382. }
  383. else if (memoState >= 10)
  384. {
  385. htmltext = "30327-04.html";
  386. }
  387. break;
  388. }
  389. case ALLANA:
  390. {
  391. if (memoState == 3)
  392. {
  393. qs.setMemoState(4);
  394. qs.setCond(5, true);
  395. htmltext = "30424-01.html";
  396. }
  397. else if (memoState == 4)
  398. {
  399. qs.setMemoState(4);
  400. htmltext = "30424-02.html";
  401. }
  402. break;
  403. }
  404. case PERRIN:
  405. {
  406. if (memoState == 1)
  407. {
  408. if (hasQuestItems(player, REPORT_OF_PERRIN))
  409. {
  410. htmltext = "30428-01.html";
  411. }
  412. }
  413. else if (memoState == 2)
  414. {
  415. takeItems(player, REPORT_OF_PERRIN, 1);
  416. qs.setMemoState(3);
  417. qs.setCond(4, true);
  418. htmltext = "30428-03.html";
  419. }
  420. else if (memoState == 3)
  421. {
  422. htmltext = "30428-04.html";
  423. }
  424. break;
  425. }
  426. case FATHER_GUPU:
  427. {
  428. if (memoState == 4)
  429. {
  430. if (!hasAtLeastOneQuestItem(player, PICTURE_OF_WINDY, WINDYS_PEBBLES, GOLDEN_STATUE))
  431. {
  432. qs.setCond(6, true);
  433. htmltext = "30658-01.html";
  434. }
  435. else if (hasQuestItems(player, PICTURE_OF_WINDY))
  436. {
  437. htmltext = "30658-04.html";
  438. }
  439. else if (hasQuestItems(player, WINDYS_PEBBLES))
  440. {
  441. giveItems(player, GOLDEN_STATUE, 1);
  442. takeItems(player, WINDYS_PEBBLES, 1);
  443. qs.setMemoState(5);
  444. htmltext = "30658-06.html";
  445. }
  446. }
  447. else if (memoState == 5)
  448. {
  449. qs.setCond(9, true);
  450. htmltext = "30658-07.html";
  451. }
  452. break;
  453. }
  454. case ORPHAN_GIRL:
  455. {
  456. switch (getRandom(5))
  457. {
  458. case 0:
  459. {
  460. htmltext = "30659-01.html";
  461. break;
  462. }
  463. case 1:
  464. {
  465. htmltext = "30659-02.html";
  466. break;
  467. }
  468. case 2:
  469. {
  470. htmltext = "30659-03.html";
  471. break;
  472. }
  473. case 3:
  474. {
  475. htmltext = "30659-04.html";
  476. break;
  477. }
  478. case 4:
  479. {
  480. htmltext = "30659-05.html";
  481. break;
  482. }
  483. }
  484. break;
  485. }
  486. case WINDY_SHAORING:
  487. {
  488. if (hasQuestItems(player, PICTURE_OF_WINDY))
  489. {
  490. htmltext = "30660-01.html";
  491. }
  492. else if (hasQuestItems(player, WINDYS_PEBBLES))
  493. {
  494. htmltext = "30660-04.html";
  495. }
  496. break;
  497. }
  498. case MYSTERIOUS_DARK_ELF:
  499. {
  500. if (memoState == 8)
  501. {
  502. if (hasQuestItems(player, SECRET_LETTER1) && !hasQuestItems(player, SECRET_LETTER2))
  503. {
  504. if (npc.getSummonedNpcCount() < 36)
  505. {
  506. addSpawn(npc, LERO_LIZARDMAN_ASSASSIN, npc, true, 200000);
  507. addSpawn(npc, LERO_LIZARDMAN_ASSASSIN, npc, true, 200000);
  508. addSpawn(npc, LERO_LIZARDMAN_ASSASSIN, npc, true, 200000);
  509. playSound(player, QuestSound.ITEMSOUND_QUEST_BEFORE_BATTLE);
  510. }
  511. qs.setCond(14);
  512. npc.deleteMe();
  513. htmltext = "30661-01.html";
  514. }
  515. else if (hasQuestItems(player, SECRET_LETTER1, SECRET_LETTER2) && !hasQuestItems(player, SECRET_LETTER3))
  516. {
  517. if (npc.getSummonedNpcCount() < 36)
  518. {
  519. addSpawn(npc, LERO_LIZARDMAN_SNIPER, npc, true, 200000);
  520. addSpawn(npc, LERO_LIZARDMAN_SNIPER, npc, true, 200000);
  521. addSpawn(npc, LERO_LIZARDMAN_SNIPER, npc, true, 200000);
  522. playSound(player, QuestSound.ITEMSOUND_QUEST_BEFORE_BATTLE);
  523. }
  524. qs.setCond(16);
  525. npc.deleteMe();
  526. htmltext = "30661-02.html";
  527. }
  528. else if (hasQuestItems(player, SECRET_LETTER1, SECRET_LETTER2, SECRET_LETTER3) && !hasQuestItems(player, SECRET_LETTER4))
  529. {
  530. if (npc.getSummonedNpcCount() < 36)
  531. {
  532. addSpawn(npc, LERO_LIZARDMAN_WIZARD, npc, true, 200000);
  533. addSpawn(npc, LERO_LIZARDMAN_WIZARD, npc, true, 200000);
  534. addSpawn(npc, LERO_LIZARDMAN_LORD, npc, true, 200000);
  535. playSound(player, QuestSound.ITEMSOUND_QUEST_BEFORE_BATTLE);
  536. }
  537. qs.setCond(18);
  538. npc.deleteMe();
  539. htmltext = "30661-03.html";
  540. }
  541. else if ((getQuestItemsCount(player, SECRET_LETTER1) + getQuestItemsCount(player, SECRET_LETTER2) + getQuestItemsCount(player, SECRET_LETTER3) + getQuestItemsCount(player, SECRET_LETTER4)) == 4)
  542. {
  543. qs.setCond(20, true);
  544. htmltext = "30661-04.html";
  545. }
  546. }
  547. break;
  548. }
  549. case PIPER_LONGBOW:
  550. {
  551. if (memoState == 8)
  552. {
  553. if (hasQuestItems(player, SECRET_LETTER1) && !hasQuestItems(player, SECRET_LETTER2))
  554. {
  555. htmltext = "30662-01.html";
  556. }
  557. else if (hasQuestItems(player, SECRET_LETTER2) && !hasQuestItems(player, SECRET_LETTER3, SECRET_LETTER4))
  558. {
  559. htmltext = "30662-02.html";
  560. }
  561. else if (hasQuestItems(player, SECRET_LETTER2, SECRET_LETTER3, SECRET_LETTER4))
  562. {
  563. qs.setCond(21, true);
  564. htmltext = "30662-03.html";
  565. }
  566. }
  567. break;
  568. }
  569. case SLEIN_SHINING_BLADE:
  570. {
  571. if (memoState == 8)
  572. {
  573. if (hasQuestItems(player, SECRET_LETTER1) && !hasQuestItems(player, SECRET_LETTER2))
  574. {
  575. htmltext = "30663-01.html";
  576. }
  577. else if (hasQuestItems(player, SECRET_LETTER2) && !hasQuestItems(player, SECRET_LETTER3, SECRET_LETTER4))
  578. {
  579. htmltext = "30663-02.html";
  580. }
  581. else if (hasQuestItems(player, SECRET_LETTER2, SECRET_LETTER3, SECRET_LETTER4))
  582. {
  583. qs.setCond(21, true);
  584. htmltext = "30663-03.html";
  585. }
  586. }
  587. break;
  588. }
  589. case CAIN_FLYING_KNIFE:
  590. {
  591. if (memoState == 8)
  592. {
  593. if (hasQuestItems(player, SECRET_LETTER1) && !hasQuestItems(player, SECRET_LETTER4))
  594. {
  595. htmltext = "30664-01.html";
  596. }
  597. else if (hasQuestItems(player, SECRET_LETTER2) && !hasQuestItems(player, SECRET_LETTER3, SECRET_LETTER4))
  598. {
  599. htmltext = "30664-02.html";
  600. }
  601. else if (hasQuestItems(player, SECRET_LETTER2, SECRET_LETTER3, SECRET_LETTER4))
  602. {
  603. qs.setCond(21, true);
  604. htmltext = "30664-03.html";
  605. }
  606. }
  607. break;
  608. }
  609. case SAINT_KRISTINA:
  610. {
  611. if ((getQuestItemsCount(player, SECRET_LETTER1) + getQuestItemsCount(player, SECRET_LETTER2) + getQuestItemsCount(player, SECRET_LETTER3) + getQuestItemsCount(player, SECRET_LETTER4)) == 4)
  612. {
  613. htmltext = "30665-01.html";
  614. }
  615. else if (memoState < 9)
  616. {
  617. if ((getQuestItemsCount(player, SECRET_LETTER1) + getQuestItemsCount(player, SECRET_LETTER2) + getQuestItemsCount(player, SECRET_LETTER3) + getQuestItemsCount(player, SECRET_LETTER4)) < 4)
  618. {
  619. htmltext = "30665-03.html";
  620. }
  621. }
  622. else if (memoState >= 9)
  623. {
  624. htmltext = "30665-04.html";
  625. }
  626. break;
  627. }
  628. case DAURIN_HAMMERCRUSH:
  629. {
  630. if (memoState == 6)
  631. {
  632. if (hasQuestItems(player, ORDER_OF_SORIUS))
  633. {
  634. htmltext = "30674-01.html";
  635. }
  636. else if (!hasAtLeastOneQuestItem(player, SECRET_LETTER1, ORDER_OF_SORIUS))
  637. {
  638. if (npc.getSummonedNpcCount() < 4)
  639. {
  640. addSpawn(npc, LERO_LIZARDMAN_AGENT, npc, true, 200000);
  641. addSpawn(npc, LERO_LIZARDMAN_LEADER, npc, true, 200000);
  642. }
  643. htmltext = "30674-02a.html";
  644. }
  645. else if (hasQuestItems(player, SECRET_LETTER1))
  646. {
  647. qs.setMemoState(8);
  648. qs.setCond(13, true);
  649. htmltext = "30674-03.html";
  650. }
  651. }
  652. else if (memoState >= 8)
  653. {
  654. htmltext = "30674-04.html";
  655. }
  656. break;
  657. }
  658. }
  659. }
  660. else if (qs.isCompleted())
  661. {
  662. if (npc.getId() == PRIEST_BANDELLOS)
  663. {
  664. htmltext = getAlreadyCompletedMsg(player);
  665. }
  666. }
  667. return htmltext;
  668. }
  669. }