Q00337_AudienceWithTheLandDragon.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909
  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.Q00337_AudienceWithTheLandDragon;
  20. import com.l2jserver.gameserver.enums.QuestSound;
  21. import com.l2jserver.gameserver.model.actor.L2Npc;
  22. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  23. import com.l2jserver.gameserver.model.quest.Quest;
  24. import com.l2jserver.gameserver.model.quest.QuestState;
  25. import com.l2jserver.gameserver.util.Util;
  26. /**
  27. * Audience With The Land Dragon (337)
  28. * @author ivantotov
  29. */
  30. public final class Q00337_AudienceWithTheLandDragon extends Quest
  31. {
  32. // NPCs
  33. private static final int WAREHOUSE_CHIEF_MOKE = 30498;
  34. private static final int BLACKSMITH_HELTON = 30678;
  35. private static final int PREFECT_CHAKIRIS = 30705;
  36. private static final int MAGISTER_KAIENA = 30720;
  37. private static final int GABRIELLE = 30753;
  38. private static final int ANTHARAS_WATCHMAN_GILMORE = 30754;
  39. private static final int ANTHARAS_WATCHMAN_THEODRIC = 30755;
  40. private static final int MASTER_KENDRA = 30851;
  41. private static final int HIGH_PRIEST_ORVEN = 30857;
  42. // Items
  43. private static final int FEATHER_OF_GABRIELLE = 3852;
  44. private static final int MARSH_STALKER_HORN = 3853;
  45. private static final int MARSH_DRAKE_TALONS = 3854;
  46. private static final int KRANROT_SKIN = 3855;
  47. private static final int HAMRUT_LEG = 3856;
  48. private static final int REMAINS_OF_SACRAFICE = 3857;
  49. private static final int TOTEM_OF_LAND_DRAGON = 3858;
  50. private static final int FRAGMENT_OF_ABYSS_JEWEL_1ST = 3859;
  51. private static final int FRAGMENT_OF_ABYSS_JEWEL_2ND = 3860;
  52. private static final int FRAGMENT_OF_ABYSS_JEWEL_3RD = 3861;
  53. private static final int MARA_FANG = 3862;
  54. private static final int MUSFEL_FANG = 3863;
  55. private static final int MARK_OF_WATCHMAN = 3864;
  56. private static final int HERALD_OF_SLAYER = 3890;
  57. // Reward
  58. private static final int PORTAL_STONE = 3865;
  59. // Monster
  60. private static final int BLOOD_QUEEN = 18001;
  61. private static final int CAVE_MAIDEN = 20134;
  62. private static final int CAVE_KEEPER = 20246;
  63. private static final int CAVE_KEEPER_HOLD = 20277;
  64. private static final int CAVE_MAIDEN_HOLD = 20287;
  65. private static final int HARIT_LIZARDMAN_SHAMAN = 20644;
  66. private static final int HARIT_LIZARDMAN_MATRIARCH = 20645;
  67. private static final int HAMRUT = 20649;
  68. private static final int KRANROT = 20650;
  69. private static final int MARSH_STALKER = 20679;
  70. private static final int MARSH_DRAKE = 20680;
  71. // Quest Monster
  72. private static final int ABYSSAL_JEWEL_1 = 27165;
  73. private static final int ABYSSAL_JEWEL_2 = 27166;
  74. private static final int ABYSSAL_JEWEL_3 = 27167;
  75. private static final int JEWEL_GUARDIAN_MARA = 27168;
  76. private static final int JEWEL_GUARDIAN_MUSFEL = 27169;
  77. private static final int JEWEL_GUARDIAN_PYTON = 27170;
  78. private static final int GHOST_OF_OFFERING = 27171;
  79. private static final int HARIT_LIZARDMAN_ZEALOT = 27172;
  80. // Misc
  81. private static final int MIN_LEVEL = 50;
  82. public Q00337_AudienceWithTheLandDragon()
  83. {
  84. super(337, Q00337_AudienceWithTheLandDragon.class.getSimpleName(), "Audience With The Land Dragon");
  85. addStartNpc(GABRIELLE);
  86. addTalkId(GABRIELLE, WAREHOUSE_CHIEF_MOKE, BLACKSMITH_HELTON, PREFECT_CHAKIRIS, MAGISTER_KAIENA, ANTHARAS_WATCHMAN_GILMORE, ANTHARAS_WATCHMAN_THEODRIC, MASTER_KENDRA, HIGH_PRIEST_ORVEN);
  87. addKillId(BLOOD_QUEEN, CAVE_MAIDEN, CAVE_KEEPER, CAVE_KEEPER_HOLD, CAVE_MAIDEN_HOLD, HARIT_LIZARDMAN_SHAMAN, HARIT_LIZARDMAN_MATRIARCH, HAMRUT, KRANROT, MARSH_STALKER, MARSH_DRAKE, ABYSSAL_JEWEL_1, ABYSSAL_JEWEL_2, ABYSSAL_JEWEL_3, JEWEL_GUARDIAN_MARA, JEWEL_GUARDIAN_MUSFEL, JEWEL_GUARDIAN_PYTON, GHOST_OF_OFFERING, HARIT_LIZARDMAN_ZEALOT);
  88. addAttackId(ABYSSAL_JEWEL_1, ABYSSAL_JEWEL_2, ABYSSAL_JEWEL_3);
  89. registerQuestItems(FEATHER_OF_GABRIELLE, MARSH_STALKER_HORN, MARSH_DRAKE_TALONS, KRANROT_SKIN, HAMRUT_LEG, REMAINS_OF_SACRAFICE, TOTEM_OF_LAND_DRAGON, FRAGMENT_OF_ABYSS_JEWEL_1ST, FRAGMENT_OF_ABYSS_JEWEL_2ND, FRAGMENT_OF_ABYSS_JEWEL_3RD, MARA_FANG, MUSFEL_FANG, MARK_OF_WATCHMAN, HERALD_OF_SLAYER);
  90. }
  91. @Override
  92. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  93. {
  94. if ("DESPAWN".equals(event))
  95. {
  96. npc.deleteMe();
  97. return super.onAdvEvent(event, npc, player);
  98. }
  99. else if ("DESPAWN_240".equals(event))
  100. {
  101. npc.deleteMe();
  102. return super.onAdvEvent(event, npc, player);
  103. }
  104. final QuestState qs = getQuestState(player, false);
  105. if (qs == null)
  106. {
  107. return null;
  108. }
  109. String htmltext = null;
  110. switch (event)
  111. {
  112. case "30753-05.htm":
  113. {
  114. if (qs.isCreated())
  115. {
  116. giveItems(player, FEATHER_OF_GABRIELLE, 1);
  117. qs.startQuest();
  118. qs.setMemoState(20000);
  119. htmltext = event;
  120. }
  121. break;
  122. }
  123. case "30753-09.html":
  124. {
  125. takeItems(player, MARK_OF_WATCHMAN, -1);
  126. qs.setMemoState(40000);
  127. qs.setCond(2, true);
  128. htmltext = event;
  129. break;
  130. }
  131. case "30754-03.html":
  132. {
  133. qs.setMemoState(70000);
  134. qs.setCond(4, true);
  135. htmltext = event;
  136. break;
  137. }
  138. case "30755-05.html":
  139. {
  140. if (qs.isMemoState(70000) && hasQuestItems(player, FRAGMENT_OF_ABYSS_JEWEL_3RD))
  141. {
  142. giveItems(player, PORTAL_STONE, 1);
  143. qs.exitQuest(true, true);
  144. htmltext = event;
  145. }
  146. break;
  147. }
  148. case "30498-02.html":
  149. case "30678-01a.html":
  150. case "30753-01a.html":
  151. case "30753-03.htm":
  152. case "30753-04.htm":
  153. case "30753-06a.html":
  154. {
  155. htmltext = event;
  156. break;
  157. }
  158. }
  159. return htmltext;
  160. }
  161. @Override
  162. public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
  163. {
  164. final QuestState qs = getQuestState(attacker, false);
  165. if ((qs != null) && qs.isStarted())
  166. {
  167. switch (npc.getId())
  168. {
  169. case ABYSSAL_JEWEL_1:
  170. {
  171. if (qs.isMemoState(40000) || (qs.isMemoState(40001)))
  172. {
  173. if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.8)) && (npc.getVariables().getInt("i_quest0") == 0))
  174. {
  175. for (int i = 0; i < 20; i++)
  176. {
  177. addAttackPlayerDesire(addSpawn(JEWEL_GUARDIAN_MARA, npc, true, 180000), attacker);
  178. }
  179. npc.getVariables().set("i_quest0", 1);
  180. startQuestTimer("DESPAWN", 900000, npc, attacker);
  181. }
  182. if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.4)) && !hasQuestItems(attacker, FRAGMENT_OF_ABYSS_JEWEL_1ST))
  183. {
  184. giveItems(attacker, FRAGMENT_OF_ABYSS_JEWEL_1ST, 1);
  185. playSound(attacker, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  186. startQuestTimer("DESPAWN_240", 240000, npc, attacker);
  187. }
  188. }
  189. if (npc.getCurrentHp() < (npc.getMaxHp() * 0.1))
  190. {
  191. npc.deleteMe();
  192. }
  193. break;
  194. }
  195. case ABYSSAL_JEWEL_2:
  196. {
  197. if (qs.isMemoState(40000) || (qs.isMemoState(40010)))
  198. {
  199. if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.8)) && (npc.getVariables().getInt("i_quest0") == 0))
  200. {
  201. for (int i = 0; i < 20; i++)
  202. {
  203. addAttackPlayerDesire(addSpawn(JEWEL_GUARDIAN_MUSFEL, npc, true, 180000), attacker);
  204. }
  205. npc.getVariables().set("i_quest0", 1);
  206. startQuestTimer("DESPAWN", 900000, npc, attacker);
  207. }
  208. if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.4)) && !hasQuestItems(attacker, FRAGMENT_OF_ABYSS_JEWEL_2ND))
  209. {
  210. giveItems(attacker, FRAGMENT_OF_ABYSS_JEWEL_2ND, 1);
  211. playSound(attacker, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  212. startQuestTimer("DESPAWN_240", 240000, npc, attacker);
  213. }
  214. }
  215. if (npc.getCurrentHp() < (npc.getMaxHp() * 0.1))
  216. {
  217. npc.deleteMe();
  218. }
  219. break;
  220. }
  221. case ABYSSAL_JEWEL_3:
  222. {
  223. if (qs.isMemoState(70000))
  224. {
  225. if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.8)) && (npc.getVariables().getInt("i_quest0") == 0))
  226. {
  227. addAttackPlayerDesire(addSpawn(JEWEL_GUARDIAN_PYTON, npc, true, 180000), attacker);
  228. addAttackPlayerDesire(addSpawn(JEWEL_GUARDIAN_PYTON, npc, true, 180000), attacker);
  229. addAttackPlayerDesire(addSpawn(JEWEL_GUARDIAN_PYTON, npc, true, 180000), attacker);
  230. addAttackPlayerDesire(addSpawn(JEWEL_GUARDIAN_PYTON, npc, true, 180000), attacker);
  231. npc.getVariables().set("i_quest0", 1);
  232. }
  233. if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.4)) && !hasQuestItems(attacker, FRAGMENT_OF_ABYSS_JEWEL_3RD))
  234. {
  235. giveItems(attacker, FRAGMENT_OF_ABYSS_JEWEL_3RD, 1);
  236. playSound(attacker, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  237. }
  238. }
  239. if (npc.getCurrentHp() < (npc.getMaxHp() * 0.1))
  240. {
  241. npc.deleteMe();
  242. }
  243. break;
  244. }
  245. }
  246. }
  247. return super.onAttack(npc, attacker, damage, isSummon);
  248. }
  249. @Override
  250. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  251. {
  252. final QuestState qs = getQuestState(killer, false);
  253. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  254. {
  255. switch (npc.getId())
  256. {
  257. case BLOOD_QUEEN:
  258. {
  259. switch (qs.getMemoState())
  260. {
  261. case 21011:
  262. case 21010:
  263. case 21001:
  264. case 21000:
  265. case 20011:
  266. case 20010:
  267. case 20001:
  268. case 20000:
  269. {
  270. if (!hasQuestItems(killer, REMAINS_OF_SACRAFICE))
  271. {
  272. for (int i = 0; i < 8; i++)
  273. {
  274. addSpawn(GHOST_OF_OFFERING, npc, true, 180000);
  275. }
  276. }
  277. break;
  278. }
  279. }
  280. break;
  281. }
  282. case CAVE_MAIDEN:
  283. case CAVE_KEEPER:
  284. case CAVE_KEEPER_HOLD:
  285. case CAVE_MAIDEN_HOLD:
  286. {
  287. if (qs.isMemoState(70000) && !hasQuestItems(killer, FRAGMENT_OF_ABYSS_JEWEL_3RD))
  288. {
  289. if (getRandom(5) == 0)
  290. {
  291. addSpawn(ABYSSAL_JEWEL_3, npc, true, 180000);
  292. }
  293. }
  294. break;
  295. }
  296. case HARIT_LIZARDMAN_SHAMAN:
  297. {
  298. switch (qs.getMemoState())
  299. {
  300. case 21110:
  301. case 21100:
  302. case 21010:
  303. case 21000:
  304. case 20110:
  305. case 20100:
  306. case 20010:
  307. case 20000:
  308. {
  309. if (!hasQuestItems(killer, TOTEM_OF_LAND_DRAGON))
  310. {
  311. addAttackPlayerDesire(addSpawn(HARIT_LIZARDMAN_ZEALOT, npc, true, 180000), killer);
  312. addAttackPlayerDesire(addSpawn(HARIT_LIZARDMAN_ZEALOT, npc, true, 180000), killer);
  313. addAttackPlayerDesire(addSpawn(HARIT_LIZARDMAN_ZEALOT, npc, true, 180000), killer);
  314. }
  315. break;
  316. }
  317. }
  318. break;
  319. }
  320. case HARIT_LIZARDMAN_MATRIARCH:
  321. {
  322. switch (qs.getMemoState())
  323. {
  324. case 21110:
  325. case 21100:
  326. case 21010:
  327. case 21000:
  328. case 20110:
  329. case 20100:
  330. case 20010:
  331. case 20000:
  332. {
  333. if (!hasQuestItems(killer, TOTEM_OF_LAND_DRAGON))
  334. {
  335. if (getRandom(5) == 0)
  336. {
  337. addAttackPlayerDesire(addSpawn(HARIT_LIZARDMAN_ZEALOT, npc, true, 180000), killer);
  338. addAttackPlayerDesire(addSpawn(HARIT_LIZARDMAN_ZEALOT, npc, true, 180000), killer);
  339. addAttackPlayerDesire(addSpawn(HARIT_LIZARDMAN_ZEALOT, npc, true, 180000), killer);
  340. }
  341. }
  342. break;
  343. }
  344. }
  345. break;
  346. }
  347. case HAMRUT:
  348. {
  349. switch (qs.getMemoState())
  350. {
  351. case 21101:
  352. case 21100:
  353. case 21001:
  354. case 21000:
  355. case 20101:
  356. case 20100:
  357. case 20001:
  358. case 20000:
  359. {
  360. if (!hasQuestItems(killer, HAMRUT_LEG))
  361. {
  362. giveItems(killer, HAMRUT_LEG, 1);
  363. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  364. }
  365. break;
  366. }
  367. }
  368. break;
  369. }
  370. case KRANROT:
  371. {
  372. switch (qs.getMemoState())
  373. {
  374. case 21101:
  375. case 21100:
  376. case 21001:
  377. case 21000:
  378. case 20101:
  379. case 20100:
  380. case 20001:
  381. case 20000:
  382. {
  383. if (!hasQuestItems(killer, KRANROT_SKIN))
  384. {
  385. giveItems(killer, KRANROT_SKIN, 1);
  386. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  387. }
  388. break;
  389. }
  390. }
  391. break;
  392. }
  393. case MARSH_STALKER:
  394. {
  395. switch (qs.getMemoState())
  396. {
  397. case 20111:
  398. case 20110:
  399. case 20101:
  400. case 20100:
  401. case 20011:
  402. case 20010:
  403. case 20001:
  404. case 20000:
  405. {
  406. if (!hasQuestItems(killer, MARSH_STALKER_HORN))
  407. {
  408. giveItems(killer, MARSH_STALKER_HORN, 1);
  409. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  410. }
  411. break;
  412. }
  413. }
  414. break;
  415. }
  416. case MARSH_DRAKE:
  417. {
  418. switch (qs.getMemoState())
  419. {
  420. case 20111:
  421. case 20110:
  422. case 20101:
  423. case 20100:
  424. case 20011:
  425. case 20010:
  426. case 20001:
  427. case 20000:
  428. {
  429. if (!hasQuestItems(killer, MARSH_DRAKE_TALONS))
  430. {
  431. giveItems(killer, MARSH_DRAKE_TALONS, 1);
  432. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  433. }
  434. break;
  435. }
  436. }
  437. break;
  438. }
  439. case JEWEL_GUARDIAN_MARA:
  440. {
  441. if (qs.isMemoState(40000) || (qs.isMemoState(40001)))
  442. {
  443. if (!hasQuestItems(killer, MARA_FANG))
  444. {
  445. giveItems(killer, MARA_FANG, 1);
  446. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  447. }
  448. }
  449. break;
  450. }
  451. case JEWEL_GUARDIAN_MUSFEL:
  452. {
  453. if (qs.isMemoState(40000) || (qs.isMemoState(40010)))
  454. {
  455. if (!hasQuestItems(killer, MUSFEL_FANG))
  456. {
  457. giveItems(killer, MUSFEL_FANG, 1);
  458. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  459. }
  460. }
  461. break;
  462. }
  463. case GHOST_OF_OFFERING:
  464. {
  465. switch (qs.getMemoState())
  466. {
  467. case 21011:
  468. case 21010:
  469. case 21001:
  470. case 21000:
  471. case 20011:
  472. case 20010:
  473. case 20001:
  474. case 20000:
  475. {
  476. if (!hasQuestItems(killer, REMAINS_OF_SACRAFICE))
  477. {
  478. giveItems(killer, REMAINS_OF_SACRAFICE, 1);
  479. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  480. }
  481. break;
  482. }
  483. }
  484. break;
  485. }
  486. case HARIT_LIZARDMAN_ZEALOT:
  487. {
  488. switch (qs.getMemoState())
  489. {
  490. case 21110:
  491. case 21100:
  492. case 21010:
  493. case 21000:
  494. case 20110:
  495. case 20100:
  496. case 20010:
  497. case 20000:
  498. {
  499. if (!hasQuestItems(killer, TOTEM_OF_LAND_DRAGON))
  500. {
  501. giveItems(killer, TOTEM_OF_LAND_DRAGON, 1);
  502. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  503. }
  504. break;
  505. }
  506. }
  507. break;
  508. }
  509. }
  510. }
  511. return super.onKill(npc, killer, isSummon);
  512. }
  513. @Override
  514. public String onTalk(L2Npc npc, L2PcInstance player)
  515. {
  516. final QuestState qs = getQuestState(player, true);
  517. final int memoState = qs.getMemoState();
  518. String htmltext = getNoQuestMsg(player);
  519. if (qs.isCreated())
  520. {
  521. if (npc.getId() == GABRIELLE)
  522. {
  523. if (player.getLevel() < MIN_LEVEL)
  524. {
  525. htmltext = "30753-01.htm";
  526. }
  527. else
  528. {
  529. htmltext = "30753-02.htm";
  530. }
  531. }
  532. }
  533. else if (qs.isStarted())
  534. {
  535. switch (npc.getId())
  536. {
  537. case GABRIELLE:
  538. {
  539. if ((memoState >= 20000) && (memoState < 30000))
  540. {
  541. htmltext = "30753-06.html";
  542. }
  543. else if (memoState == 30000)
  544. {
  545. htmltext = "30753-08.html";
  546. }
  547. else if ((memoState >= 40000) && (memoState < 50000))
  548. {
  549. htmltext = "30753-10.html";
  550. }
  551. else if (memoState == 50000)
  552. {
  553. takeItems(player, FEATHER_OF_GABRIELLE, -1);
  554. takeItems(player, MARK_OF_WATCHMAN, -1);
  555. giveItems(player, HERALD_OF_SLAYER, 1);
  556. qs.setMemoState(60000);
  557. qs.setCond(3, true);
  558. htmltext = "30753-11.html";
  559. }
  560. else if (memoState == 60000)
  561. {
  562. htmltext = "30753-12.html";
  563. }
  564. else if (memoState == 70000)
  565. {
  566. htmltext = "30753-13.html";
  567. }
  568. break;
  569. }
  570. case WAREHOUSE_CHIEF_MOKE:
  571. {
  572. if ((memoState == 40000) || (memoState == 40001))
  573. {
  574. if (hasQuestItems(player, FRAGMENT_OF_ABYSS_JEWEL_1ST, MARA_FANG))
  575. {
  576. takeItems(player, FRAGMENT_OF_ABYSS_JEWEL_1ST, -1);
  577. takeItems(player, MARA_FANG, -1);
  578. giveItems(player, MARK_OF_WATCHMAN, 1);
  579. if (qs.getMemoState() == 40001)
  580. {
  581. qs.setMemoState(50000);
  582. }
  583. else
  584. {
  585. qs.setMemoState(40010);
  586. }
  587. htmltext = "30498-03.html";
  588. }
  589. else
  590. {
  591. htmltext = "30498-01.html";
  592. }
  593. }
  594. else if (memoState == 40010)
  595. {
  596. htmltext = "30498-04.html";
  597. }
  598. else if (memoState >= 50000)
  599. {
  600. htmltext = "30498-05.html";
  601. }
  602. break;
  603. }
  604. case BLACKSMITH_HELTON:
  605. {
  606. if ((memoState == 40000) || (memoState == 40010))
  607. {
  608. if (hasQuestItems(player, FRAGMENT_OF_ABYSS_JEWEL_2ND, MUSFEL_FANG))
  609. {
  610. takeItems(player, FRAGMENT_OF_ABYSS_JEWEL_2ND, -1);
  611. takeItems(player, MUSFEL_FANG, -1);
  612. giveItems(player, MARK_OF_WATCHMAN, 1);
  613. if (qs.getMemoState() == 40010)
  614. {
  615. qs.setMemoState(50000);
  616. }
  617. else
  618. {
  619. qs.setMemoState(40001);
  620. }
  621. htmltext = "30678-02.html";
  622. }
  623. else
  624. {
  625. htmltext = "30678-01.html";
  626. }
  627. }
  628. else if (memoState == 40001)
  629. {
  630. htmltext = "30678-03.html";
  631. }
  632. else if (memoState >= 50000)
  633. {
  634. htmltext = "30678-04.html";
  635. }
  636. break;
  637. }
  638. case PREFECT_CHAKIRIS:
  639. {
  640. switch (qs.getMemoState())
  641. {
  642. case 21101:
  643. case 21000:
  644. case 21100:
  645. case 21001:
  646. case 20101:
  647. case 20100:
  648. case 20001:
  649. case 20000:
  650. {
  651. if (hasQuestItems(player, KRANROT_SKIN, HAMRUT_LEG))
  652. {
  653. takeItems(player, KRANROT_SKIN, -1);
  654. takeItems(player, HAMRUT_LEG, -1);
  655. giveItems(player, MARK_OF_WATCHMAN, 1);
  656. if ((qs.getMemoState() + 10) == 21111)
  657. {
  658. qs.setMemoState(30000);
  659. }
  660. else
  661. {
  662. qs.setMemoState(qs.getMemoState() + 10);
  663. }
  664. htmltext = "30705-02.html";
  665. }
  666. else
  667. {
  668. htmltext = "30705-01.html";
  669. }
  670. break;
  671. }
  672. case 21110:
  673. case 21011:
  674. case 21010:
  675. case 20111:
  676. case 20110:
  677. case 20011:
  678. case 20010:
  679. {
  680. htmltext = "30705-03.html";
  681. break;
  682. }
  683. }
  684. if (memoState >= 30000)
  685. {
  686. htmltext = "30705-04.html";
  687. }
  688. break;
  689. }
  690. case MAGISTER_KAIENA:
  691. {
  692. switch (qs.getMemoState())
  693. {
  694. case 20111:
  695. case 20110:
  696. case 20101:
  697. case 20100:
  698. case 20010:
  699. case 20011:
  700. case 20001:
  701. case 20000:
  702. {
  703. if (hasQuestItems(player, MARSH_STALKER_HORN, MARSH_DRAKE_TALONS))
  704. {
  705. takeItems(player, MARSH_STALKER_HORN, -1);
  706. takeItems(player, MARSH_DRAKE_TALONS, -1);
  707. giveItems(player, MARK_OF_WATCHMAN, 1);
  708. if ((qs.getMemoState() + 1000) == 21111)
  709. {
  710. qs.setMemoState(30000);
  711. }
  712. else
  713. {
  714. qs.setMemoState(qs.getMemoState() + 1000);
  715. }
  716. htmltext = "30720-02.html";
  717. }
  718. else
  719. {
  720. htmltext = "30720-01.html";
  721. }
  722. break;
  723. }
  724. case 21110:
  725. case 21101:
  726. case 21100:
  727. case 21011:
  728. case 21010:
  729. case 21001:
  730. case 21000:
  731. {
  732. htmltext = "30720-03.html";
  733. break;
  734. }
  735. }
  736. if (memoState >= 30000)
  737. {
  738. htmltext = "30720-04.html";
  739. }
  740. break;
  741. }
  742. case ANTHARAS_WATCHMAN_GILMORE:
  743. {
  744. if (memoState < 60000)
  745. {
  746. htmltext = "30754-01.html";
  747. }
  748. else if (memoState == 60000)
  749. {
  750. htmltext = "30754-02.html";
  751. }
  752. else if (memoState == 70000)
  753. {
  754. if (hasQuestItems(player, FRAGMENT_OF_ABYSS_JEWEL_3RD))
  755. {
  756. htmltext = "30754-05.html";
  757. }
  758. else
  759. {
  760. htmltext = "30754-04.html";
  761. }
  762. }
  763. break;
  764. }
  765. case ANTHARAS_WATCHMAN_THEODRIC:
  766. {
  767. if (memoState < 60000)
  768. {
  769. htmltext = "30755-01.html";
  770. }
  771. else if (memoState == 60000)
  772. {
  773. htmltext = "30755-02.html";
  774. }
  775. else if (memoState == 70000)
  776. {
  777. if (!hasQuestItems(player, FRAGMENT_OF_ABYSS_JEWEL_3RD))
  778. {
  779. htmltext = "30755-03.html";
  780. }
  781. else
  782. {
  783. htmltext = "30755-04.html";
  784. }
  785. }
  786. break;
  787. }
  788. case MASTER_KENDRA:
  789. {
  790. switch (qs.getMemoState())
  791. {
  792. case 21110:
  793. case 21100:
  794. case 21010:
  795. case 21000:
  796. case 20110:
  797. case 20100:
  798. case 20010:
  799. case 20000:
  800. {
  801. if (!hasQuestItems(player, TOTEM_OF_LAND_DRAGON))
  802. {
  803. htmltext = "30851-01.html";
  804. }
  805. else
  806. {
  807. takeItems(player, TOTEM_OF_LAND_DRAGON, -1);
  808. giveItems(player, MARK_OF_WATCHMAN, 1);
  809. if ((qs.getMemoState() + 1) == 21111)
  810. {
  811. qs.setMemoState(30000);
  812. }
  813. else
  814. {
  815. qs.setMemoState(qs.getMemoState() + 1);
  816. }
  817. htmltext = "30851-02.html";
  818. }
  819. break;
  820. }
  821. case 21101:
  822. case 21011:
  823. case 21001:
  824. case 20111:
  825. case 20101:
  826. case 20011:
  827. case 20001:
  828. {
  829. htmltext = "30851-03.html";
  830. break;
  831. }
  832. }
  833. if (memoState >= 30000)
  834. {
  835. htmltext = "30851-04.html";
  836. }
  837. break;
  838. }
  839. case HIGH_PRIEST_ORVEN:
  840. {
  841. switch (qs.getMemoState())
  842. {
  843. case 21011:
  844. case 21010:
  845. case 21001:
  846. case 21000:
  847. case 20011:
  848. case 20010:
  849. case 20001:
  850. case 20000:
  851. {
  852. if (!hasQuestItems(player, REMAINS_OF_SACRAFICE))
  853. {
  854. htmltext = "30857-01.html";
  855. }
  856. else
  857. {
  858. takeItems(player, REMAINS_OF_SACRAFICE, -1);
  859. giveItems(player, MARK_OF_WATCHMAN, 1);
  860. if ((qs.getMemoState() + 100) == 21111)
  861. {
  862. qs.setMemoState(30000);
  863. }
  864. else
  865. {
  866. qs.setMemoState(qs.getMemoState() + 100);
  867. }
  868. htmltext = "30857-02.html";
  869. }
  870. break;
  871. }
  872. case 21110:
  873. case 21101:
  874. case 21100:
  875. case 20111:
  876. case 20110:
  877. case 20101:
  878. case 20100:
  879. {
  880. htmltext = "30857-03.html";
  881. break;
  882. }
  883. }
  884. if (memoState >= 30000)
  885. {
  886. htmltext = "30857-04.html";
  887. }
  888. break;
  889. }
  890. }
  891. }
  892. return htmltext;
  893. }
  894. }