Q00065_CertifiedSoulBreaker.java 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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.Q00065_CertifiedSoulBreaker;
  20. import com.l2jserver.gameserver.ai.CtrlIntention;
  21. import com.l2jserver.gameserver.enums.CategoryType;
  22. import com.l2jserver.gameserver.enums.Race;
  23. import com.l2jserver.gameserver.model.Location;
  24. import com.l2jserver.gameserver.model.actor.L2Npc;
  25. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  26. import com.l2jserver.gameserver.model.quest.Quest;
  27. import com.l2jserver.gameserver.model.quest.QuestState;
  28. import com.l2jserver.gameserver.network.NpcStringId;
  29. import com.l2jserver.gameserver.network.clientpackets.Say2;
  30. import com.l2jserver.gameserver.network.serverpackets.NpcSay;
  31. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  32. import com.l2jserver.gameserver.util.Util;
  33. /**
  34. * Certified Soul Breaker (65)
  35. * @author ivantotov
  36. */
  37. public final class Q00065_CertifiedSoulBreaker extends Quest
  38. {
  39. // NPCs
  40. private static final int CAPTAIN_LUCAS = 30071;
  41. private static final int JACOB = 30073;
  42. private static final int GUARD_HARLAN = 30074;
  43. private static final int GUARD_XABER = 30075;
  44. private static final int GUARD_LIAM = 30076;
  45. private static final int GUARD_VESA = 30123;
  46. private static final int GUARD_ZEROME = 30124;
  47. private static final int WHARF_MANAGER_FELTON = 30879;
  48. private static final int KEKROPUS = 32138;
  49. private static final int VICE_HIERARCH_CASCA = 32139;
  50. private static final int GRAND_MASTER_HOLST = 32199;
  51. private static final int GRAND_MASTER_VITUS = 32213;
  52. private static final int GRAND_MASTER_MELDINA = 32214;
  53. private static final int KATENAR = 32242;
  54. private static final int CARGO_BOX = 32243;
  55. private static final int SUSPICIOUS_MAN = 32244;
  56. // Items
  57. private static final int SEALED_DOCUMENT = 9803;
  58. private static final int WYRM_HEART = 9804;
  59. private static final int KEKROPUS_RECOMMENDATION = 9805;
  60. // Reward
  61. private static final int DIMENSIONAL_DIAMOND = 7562;
  62. private static final int SOUL_BREAKER_CERTIFICATE = 9806;
  63. // Monster
  64. private static final int WYRM = 20176;
  65. // Quest Monster
  66. private static final int GUARDIAN_ANGEL = 27332;
  67. // Misc
  68. private static final int MIN_LEVEL = 39;
  69. // Locations
  70. private static final Location SUSPICIOUS_SPAWN = new Location(16489, 146249, -3112);
  71. private static final Location MOVE_TO = new Location(16490, 145839, -3080);
  72. public Q00065_CertifiedSoulBreaker()
  73. {
  74. super(65, Q00065_CertifiedSoulBreaker.class.getSimpleName(), "Certified Soul Breaker");
  75. addStartNpc(GRAND_MASTER_VITUS);
  76. addTalkId(GRAND_MASTER_VITUS, CAPTAIN_LUCAS, JACOB, GUARD_HARLAN, GUARD_XABER, GUARD_LIAM, GUARD_VESA, GUARD_ZEROME, WHARF_MANAGER_FELTON, KEKROPUS, VICE_HIERARCH_CASCA, GRAND_MASTER_HOLST, GRAND_MASTER_MELDINA, KATENAR, CARGO_BOX, SUSPICIOUS_MAN);
  77. addKillId(WYRM, GUARDIAN_ANGEL);
  78. addSpawnId(GUARDIAN_ANGEL, SUSPICIOUS_MAN);
  79. registerQuestItems(SEALED_DOCUMENT, WYRM_HEART, KEKROPUS_RECOMMENDATION);
  80. }
  81. @Override
  82. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  83. {
  84. if ("DESPAWN_5".equals(event))
  85. {
  86. if (npc != null)
  87. {
  88. npc.deleteMe();
  89. }
  90. return super.onAdvEvent(event, npc, player);
  91. }
  92. else if ("DESPAWN_70".equals(event))
  93. {
  94. final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
  95. final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
  96. if (npc0 != null)
  97. {
  98. if (npc0.getVariables().getBoolean("SPAWNED"))
  99. {
  100. npc0.getVariables().set("SPAWNED", false);
  101. if (c0 != null)
  102. {
  103. npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.S1_I_WILL_BE_BACK_SOON_STAY_THERE_AND_DONT_YOU_DARE_WANDER_OFF).addStringParameter(c0.getAppearance().getVisibleName()));
  104. }
  105. }
  106. }
  107. npc.deleteMe();
  108. return super.onAdvEvent(event, npc, player);
  109. }
  110. final QuestState qs = getQuestState(player, false);
  111. if (qs == null)
  112. {
  113. return null;
  114. }
  115. String htmltext = null;
  116. switch (event)
  117. {
  118. case "ACCEPT":
  119. {
  120. if (qs.isCreated())
  121. {
  122. qs.startQuest();
  123. qs.setMemoState(1);
  124. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  125. {
  126. giveItems(player, DIMENSIONAL_DIAMOND, 47);
  127. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  128. htmltext = "32213-05.htm";
  129. }
  130. else
  131. {
  132. htmltext = "32213-06.htm";
  133. }
  134. }
  135. break;
  136. }
  137. case "32213-09.html":
  138. {
  139. htmltext = event;
  140. break;
  141. }
  142. case "32213-04.htm":
  143. {
  144. if ((player.getLevel() >= MIN_LEVEL) && player.isInCategory(CategoryType.KAMAEL_SECOND_CLASS_GROUP))
  145. {
  146. htmltext = event;
  147. }
  148. break;
  149. }
  150. case "30071-02.html":
  151. {
  152. if (qs.isMemoState(7))
  153. {
  154. qs.setMemoState(8);
  155. qs.setCond(8, true);
  156. htmltext = event;
  157. }
  158. break;
  159. }
  160. case "30879-02.html":
  161. {
  162. if (qs.isMemoState(11))
  163. {
  164. htmltext = event;
  165. }
  166. break;
  167. }
  168. case "30879-03.html":
  169. {
  170. if (qs.isMemoState(11))
  171. {
  172. qs.setMemoState(12);
  173. qs.setCond(12, true);
  174. htmltext = event;
  175. }
  176. break;
  177. }
  178. case "32138-02.html":
  179. case "32138-03.html":
  180. {
  181. if (qs.isMemoState(1))
  182. {
  183. htmltext = event;
  184. }
  185. break;
  186. }
  187. case "32138-04.html":
  188. {
  189. if (qs.isMemoState(1))
  190. {
  191. qs.setMemoState(2);
  192. qs.setCond(2, true);
  193. htmltext = event;
  194. }
  195. break;
  196. }
  197. case "32138-07.html":
  198. {
  199. if (qs.isMemoState(21))
  200. {
  201. qs.setMemoState(22);
  202. qs.setCond(15, true);
  203. htmltext = event;
  204. }
  205. break;
  206. }
  207. case "32138-10.html":
  208. case "32138-11.html":
  209. {
  210. if (qs.isMemoState(23))
  211. {
  212. htmltext = event;
  213. }
  214. break;
  215. }
  216. case "32138-12.html":
  217. {
  218. if (qs.isMemoState(23))
  219. {
  220. takeItems(player, WYRM_HEART, -1);
  221. giveItems(player, KEKROPUS_RECOMMENDATION, 1);
  222. qs.setMemoState(24);
  223. qs.setCond(17, true);
  224. htmltext = event;
  225. }
  226. break;
  227. }
  228. case "32139-02.html":
  229. {
  230. if (qs.isMemoState(2))
  231. {
  232. qs.setMemoState(3);
  233. qs.setCond(3, true);
  234. htmltext = event;
  235. }
  236. break;
  237. }
  238. case "32139-04.html":
  239. {
  240. if (qs.isMemoState(3))
  241. {
  242. qs.setMemoState(4);
  243. qs.setCond(4, true);
  244. htmltext = event;
  245. }
  246. break;
  247. }
  248. case "32139-07.html":
  249. {
  250. if (qs.isMemoState(14))
  251. {
  252. htmltext = event;
  253. }
  254. break;
  255. }
  256. case "32139-08.html":
  257. {
  258. if (qs.isMemoState(14))
  259. {
  260. takeItems(player, SEALED_DOCUMENT, -1);
  261. qs.setMemoState(21);
  262. qs.setCond(14, true);
  263. htmltext = event;
  264. }
  265. break;
  266. }
  267. case "32199-02.html":
  268. {
  269. if (qs.isMemoState(4))
  270. {
  271. qs.setMemoState(5);
  272. qs.setCond(5, true);
  273. addSpawn(npc, SUSPICIOUS_MAN, SUSPICIOUS_SPAWN, false, 0);
  274. htmltext = event;
  275. }
  276. break;
  277. }
  278. case "32214-02.html":
  279. {
  280. if (qs.isMemoState(10))
  281. {
  282. qs.setMemoState(11);
  283. qs.setCond(11, true);
  284. htmltext = event;
  285. }
  286. break;
  287. }
  288. }
  289. return htmltext;
  290. }
  291. @Override
  292. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  293. {
  294. final QuestState qs = getQuestState(killer, false);
  295. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  296. {
  297. switch (npc.getId())
  298. {
  299. case WYRM:
  300. {
  301. if (qs.isMemoState(22))
  302. {
  303. if (giveItemRandomly(killer, npc, WYRM_HEART, 1, 10, 0.20, true))
  304. {
  305. qs.setMemoState(23);
  306. qs.setCond(16, true);
  307. }
  308. }
  309. break;
  310. }
  311. case GUARDIAN_ANGEL:
  312. {
  313. final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
  314. final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
  315. if (killer == c0)
  316. {
  317. if (c0 != null)
  318. {
  319. if (qs.isMemoState(12))
  320. {
  321. L2Npc katenar = addSpawn(KATENAR, killer.getX() + 20, killer.getY() + 20, killer.getZ(), 0, false, 0);
  322. katenar.getVariables().set("player0", killer);
  323. katenar.getVariables().set("npc0", npc);
  324. qs.setMemoState(13);
  325. npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.GRR_IVE_BEEN_HIT));
  326. }
  327. }
  328. }
  329. else
  330. {
  331. if (npc0 != null)
  332. {
  333. if (npc0.getVariables().getBoolean("SPAWNED"))
  334. {
  335. npc0.getVariables().set("SPAWNED", false);
  336. }
  337. }
  338. npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.GRR_WHO_ARE_YOU_AND_WHY_HAVE_YOU_STOPPED_ME));
  339. }
  340. }
  341. }
  342. }
  343. return super.onKill(npc, killer, isSummon);
  344. }
  345. @Override
  346. public String onTalk(L2Npc npc, L2PcInstance player)
  347. {
  348. final QuestState qs = getQuestState(player, true);
  349. final int memoState = qs.getMemoState();
  350. String htmltext = getNoQuestMsg(player);
  351. if (qs.isCreated())
  352. {
  353. if (npc.getId() == GRAND_MASTER_VITUS)
  354. {
  355. if (player.getRace() == Race.KAMAEL)
  356. {
  357. if ((player.getLevel() >= MIN_LEVEL) && player.isInCategory(CategoryType.KAMAEL_SECOND_CLASS_GROUP))
  358. {
  359. htmltext = "32213-01.htm";
  360. }
  361. else
  362. {
  363. htmltext = "32213-03.html";
  364. }
  365. }
  366. else
  367. {
  368. htmltext = "32213-02.html";
  369. }
  370. }
  371. }
  372. else if (qs.isStarted())
  373. {
  374. switch (npc.getId())
  375. {
  376. case GRAND_MASTER_VITUS:
  377. {
  378. if (memoState == 1)
  379. {
  380. htmltext = "32213-07.html";
  381. }
  382. else if ((memoState > 1) && (memoState < 24))
  383. {
  384. htmltext = "32213-08.html";
  385. }
  386. else if (memoState == 24)
  387. {
  388. giveAdena(player, 71194, true);
  389. giveItems(player, SOUL_BREAKER_CERTIFICATE, 1);
  390. addExpAndSp(player, 393750, 27020);
  391. qs.exitQuest(false, true);
  392. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  393. htmltext = "32213-10.html";
  394. }
  395. break;
  396. }
  397. case CAPTAIN_LUCAS:
  398. {
  399. if (memoState == 7)
  400. {
  401. htmltext = "30071-01.html";
  402. }
  403. else if (memoState == 8)
  404. {
  405. htmltext = "30071-03.html";
  406. }
  407. break;
  408. }
  409. case JACOB:
  410. {
  411. if (memoState == 6)
  412. {
  413. if (qs.getMemoStateEx(1) == 0)
  414. {
  415. qs.setMemoStateEx(1, 10);
  416. htmltext = "30073-01.html";
  417. }
  418. else if (qs.getMemoStateEx(1) == 10)
  419. {
  420. htmltext = "30073-01a.html";
  421. }
  422. else if (qs.getMemoStateEx(1) == 1)
  423. {
  424. qs.setMemoState(7);
  425. qs.setMemoStateEx(1, 0);
  426. qs.setCond(7, true);
  427. htmltext = "30073-02.html";
  428. }
  429. }
  430. else if (memoState == 7)
  431. {
  432. htmltext = "30073-03.html";
  433. }
  434. break;
  435. }
  436. case GUARD_HARLAN:
  437. {
  438. if (memoState == 6)
  439. {
  440. if (qs.getMemoStateEx(1) == 0)
  441. {
  442. qs.setMemoStateEx(1, 1);
  443. htmltext = "30074-01.html";
  444. }
  445. else if (qs.getMemoStateEx(1) == 1)
  446. {
  447. htmltext = "30074-01a.html";
  448. }
  449. else if (qs.getMemoStateEx(1) == 10)
  450. {
  451. qs.setMemoState(7);
  452. qs.setMemoStateEx(1, 0);
  453. qs.setCond(7, true);
  454. htmltext = "30074-02.html";
  455. }
  456. }
  457. else if (memoState == 7)
  458. {
  459. htmltext = "30074-03.html";
  460. }
  461. break;
  462. }
  463. case GUARD_XABER:
  464. {
  465. if (memoState == 8)
  466. {
  467. if (qs.getMemoStateEx(1) == 0)
  468. {
  469. qs.setMemoStateEx(1, 1);
  470. htmltext = "30075-01.html";
  471. }
  472. else if (qs.getMemoStateEx(1) == 1)
  473. {
  474. htmltext = "30075-01a.html";
  475. }
  476. else if (qs.getMemoStateEx(1) == 10)
  477. {
  478. qs.setMemoState(9);
  479. qs.setMemoStateEx(1, 0);
  480. qs.setCond(9, true);
  481. htmltext = "30075-02.html";
  482. }
  483. }
  484. else if (memoState == 9)
  485. {
  486. htmltext = "30075-03.html";
  487. }
  488. break;
  489. }
  490. case GUARD_LIAM:
  491. {
  492. if (memoState == 8)
  493. {
  494. if (qs.getMemoStateEx(1) == 0)
  495. {
  496. qs.setMemoStateEx(1, 10);
  497. htmltext = "30076-01.html";
  498. }
  499. else if (qs.getMemoStateEx(1) == 10)
  500. {
  501. htmltext = "30076-01a.html";
  502. }
  503. else if (qs.getMemoStateEx(1) == 1)
  504. {
  505. qs.setMemoState(9);
  506. qs.setMemoStateEx(1, 0);
  507. qs.setCond(9, true);
  508. htmltext = "30076-02.html";
  509. }
  510. }
  511. else if (memoState == 9)
  512. {
  513. htmltext = "30076-03.html";
  514. }
  515. break;
  516. }
  517. case GUARD_VESA:
  518. {
  519. if (memoState == 9)
  520. {
  521. if (qs.getMemoStateEx(1) == 0)
  522. {
  523. qs.setMemoStateEx(1, 10);
  524. htmltext = "30123-01.html";
  525. }
  526. else if (qs.getMemoStateEx(1) == 10)
  527. {
  528. htmltext = "30123-01.html";
  529. }
  530. else if (qs.getMemoStateEx(1) == 1)
  531. {
  532. qs.setMemoState(10);
  533. qs.setMemoStateEx(1, 0);
  534. qs.setCond(10, true);
  535. htmltext = "30123-02.html";
  536. }
  537. }
  538. else if (memoState == 10)
  539. {
  540. htmltext = "30123-03.html";
  541. }
  542. break;
  543. }
  544. case GUARD_ZEROME:
  545. {
  546. if (memoState == 9)
  547. {
  548. if (qs.getMemoStateEx(1) == 0)
  549. {
  550. qs.setMemoStateEx(1, 1);
  551. htmltext = "30124-01.html";
  552. }
  553. else if (qs.getMemoStateEx(1) == 1)
  554. {
  555. htmltext = "30124-01.html";
  556. }
  557. else if (qs.getMemoStateEx(1) == 10)
  558. {
  559. qs.setMemoState(10);
  560. qs.setMemoStateEx(1, 0);
  561. qs.setCond(10, true);
  562. htmltext = "30124-02.html";
  563. }
  564. }
  565. else if (memoState == 10)
  566. {
  567. htmltext = "30124-03.html";
  568. }
  569. break;
  570. }
  571. case WHARF_MANAGER_FELTON:
  572. {
  573. if (memoState == 11)
  574. {
  575. htmltext = "30879-01.html";
  576. }
  577. else if (memoState == 12)
  578. {
  579. htmltext = "30879-04.html";
  580. }
  581. break;
  582. }
  583. case KEKROPUS:
  584. {
  585. if (memoState == 1)
  586. {
  587. htmltext = getHtm(player.getHtmlPrefix(), "32138-01.html");
  588. htmltext = htmltext.replaceAll("%name1%", player.getName());
  589. }
  590. else if (memoState == 2)
  591. {
  592. htmltext = "32138-05.html";
  593. }
  594. else if (memoState == 21)
  595. {
  596. htmltext = "32138-06.html";
  597. }
  598. else if (memoState == 22)
  599. {
  600. htmltext = "32138-08.html";
  601. }
  602. else if (memoState == 23)
  603. {
  604. htmltext = "32138-09.html";
  605. }
  606. else if (memoState == 24)
  607. {
  608. htmltext = "32138-13.html";
  609. }
  610. break;
  611. }
  612. case VICE_HIERARCH_CASCA:
  613. {
  614. if (memoState == 2)
  615. {
  616. htmltext = "32139-01.html";
  617. }
  618. else if (memoState == 3)
  619. {
  620. htmltext = "32139-03.html";
  621. }
  622. else if (memoState == 4)
  623. {
  624. htmltext = "32139-05.html";
  625. }
  626. else if (memoState == 14)
  627. {
  628. htmltext = "32139-06.html";
  629. }
  630. else if (memoState == 21)
  631. {
  632. htmltext = "32139-09.html";
  633. }
  634. break;
  635. }
  636. case GRAND_MASTER_HOLST:
  637. {
  638. if (memoState == 4)
  639. {
  640. htmltext = "32199-01.html";
  641. }
  642. else if (memoState == 5)
  643. {
  644. qs.setMemoState(6);
  645. qs.setCond(6, true);
  646. htmltext = "32199-03.html";
  647. }
  648. else if (memoState == 6)
  649. {
  650. htmltext = "32199-04.html";
  651. }
  652. break;
  653. }
  654. case GRAND_MASTER_MELDINA:
  655. {
  656. if (memoState == 10)
  657. {
  658. htmltext = "32214-01.html";
  659. }
  660. else if (memoState == 11)
  661. {
  662. htmltext = "32214-03.html";
  663. }
  664. break;
  665. }
  666. case CARGO_BOX:
  667. {
  668. if (memoState == 12)
  669. {
  670. if (!npc.getVariables().getBoolean("SPAWNED", false))
  671. {
  672. npc.getVariables().set("SPAWNED", true);
  673. npc.getVariables().set("PLAYER_ID", player.getObjectId());
  674. final L2Npc angel = addSpawn(GUARDIAN_ANGEL, 36110, 191921, -3712, 0, true, 0, false);
  675. angel.getVariables().set("npc0", npc);
  676. angel.getVariables().set("player0", player);
  677. addAttackPlayerDesire(angel, player);
  678. htmltext = "32243-01.html";
  679. }
  680. else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
  681. {
  682. htmltext = "32243-03.html";
  683. }
  684. else
  685. {
  686. htmltext = "32243-02.html";
  687. }
  688. }
  689. else if (memoState == 13)
  690. {
  691. if (!npc.getVariables().getBoolean("SPAWNED", false))
  692. {
  693. npc.getVariables().set("SPAWNED", true);
  694. npc.getVariables().set("PLAYER_ID", player.getObjectId());
  695. final L2Npc katenar = addSpawn(KATENAR, 36110, 191921, -3712, 0, false, 0);
  696. katenar.getVariables().set("player0", player);
  697. katenar.getVariables().set("npc0", npc);
  698. htmltext = "32243-06.html";
  699. }
  700. else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
  701. {
  702. htmltext = "32243-04.html";
  703. }
  704. else
  705. {
  706. htmltext = "32243-05.html";
  707. }
  708. }
  709. else if (memoState == 14)
  710. {
  711. htmltext = "32243-07.html";
  712. }
  713. break;
  714. }
  715. }
  716. }
  717. else if (qs.isCompleted())
  718. {
  719. if (npc.getId() == GRAND_MASTER_VITUS)
  720. {
  721. htmltext = getAlreadyCompletedMsg(player);
  722. }
  723. }
  724. return htmltext;
  725. }
  726. @Override
  727. public String onSpawn(L2Npc npc)
  728. {
  729. if (npc.getId() == SUSPICIOUS_MAN)
  730. {
  731. startQuestTimer("DESPAWN_5", 5000, npc, null);
  732. npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.DRATS_HOW_COULD_I_BE_SO_WRONG));
  733. npc.setIsRunning(true);
  734. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MOVE_TO);
  735. }
  736. else if (npc.getId() == GUARDIAN_ANGEL)
  737. {
  738. final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
  739. startQuestTimer("DESPAWN_70", 70000, npc, null);
  740. if (c0 != null)
  741. {
  742. npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.S1_STEP_BACK_FROM_THE_CONFOUNDED_BOX_I_WILL_TAKE_IT_MYSELF).addStringParameter(c0.getAppearance().getVisibleName()));
  743. }
  744. }
  745. return super.onSpawn(npc);
  746. }
  747. }