Q00223_TestOfTheChampion.java 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  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.Q00223_TestOfTheChampion;
  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.base.ClassId;
  24. import com.l2jserver.gameserver.model.quest.Quest;
  25. import com.l2jserver.gameserver.model.quest.QuestState;
  26. import com.l2jserver.gameserver.network.serverpackets.SocialAction;
  27. import com.l2jserver.gameserver.util.Util;
  28. /**
  29. * Test Of The Champion (223)
  30. * @author ivantotov
  31. */
  32. public final class Q00223_TestOfTheChampion extends Quest
  33. {
  34. // NPCs
  35. private static final int TRADER_GROOT = 30093;
  36. private static final int CAPTAIN_MOUEN = 30196;
  37. private static final int VETERAN_ASCALON = 30624;
  38. private static final int MASON = 30625;
  39. // Items
  40. private static final int ASCALONS_1ST_LETTER = 3277;
  41. private static final int MASONS_LETTER = 3278;
  42. private static final int IRON_ROSE_RING = 3279;
  43. private static final int ASCALONS_2ND_LETTER = 3280;
  44. private static final int WHITE_ROSE_INSIGNIA = 3281;
  45. private static final int GROOTS_LETTER = 3282;
  46. private static final int ASCALONS_3RD_LETTER = 3283;
  47. private static final int MOUENS_1ST_ORDER = 3284;
  48. private static final int MOUENS_2ND_ORDER = 3285;
  49. private static final int MOUENS_LETTER = 3286;
  50. private static final int HARPYS_EGG = 3287;
  51. private static final int MEDUSA_VENOM = 3288;
  52. private static final int WINDSUS_BILE = 3289;
  53. private static final int BLOODY_AXE_HEAD = 3290;
  54. private static final int ROAD_RATMAN_HEAD = 3291;
  55. private static final int LETO_LIZARDMAN_FANG = 3292;
  56. // Reward
  57. private static final int MARK_OF_CHAMPION = 3276;
  58. private static final int DIMENSIONAL_DIAMOND = 7562;
  59. // Monster
  60. private static final int HARPY = 20145;
  61. private static final int MEDUSA = 20158;
  62. private static final int ROAD_SCAVENGER = 20551;
  63. private static final int WINDSUS = 20553;
  64. private static final int LETO_LIZARDMAN = 20577;
  65. private static final int LETO_LIZARDMAN_ARCHER = 20578;
  66. private static final int LETO_LIZARDMAN_SOLDIER = 20579;
  67. private static final int LETO_LIZARDMAN_WARRIOR = 20580;
  68. private static final int LETO_LIZARDMAN_SHAMAN = 20581;
  69. private static final int LETO_LIZARDMAN_OCERLORD = 20582;
  70. private static final int BLOODY_AXE_ELITE = 20780;
  71. // Quest Monster
  72. private static final int HARPY_MATRIARCH = 27088;
  73. private static final int ROAD_COLLECTOR = 27089;
  74. // Misc
  75. private static final int MIN_LEVEL = 39;
  76. public Q00223_TestOfTheChampion()
  77. {
  78. super(223, Q00223_TestOfTheChampion.class.getSimpleName(), "Test Of The Champion");
  79. addStartNpc(VETERAN_ASCALON);
  80. addTalkId(VETERAN_ASCALON, TRADER_GROOT, CAPTAIN_MOUEN, MASON);
  81. addKillId(HARPY, MEDUSA, WINDSUS, ROAD_SCAVENGER, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OCERLORD, BLOODY_AXE_ELITE, HARPY_MATRIARCH, ROAD_COLLECTOR);
  82. addAttackId(HARPY, ROAD_SCAVENGER, BLOODY_AXE_ELITE);
  83. registerQuestItems(ASCALONS_1ST_LETTER, MASONS_LETTER, IRON_ROSE_RING, ASCALONS_2ND_LETTER, WHITE_ROSE_INSIGNIA, GROOTS_LETTER, ASCALONS_3RD_LETTER, MOUENS_1ST_ORDER, MOUENS_2ND_ORDER, MOUENS_LETTER, HARPYS_EGG, MEDUSA_VENOM, WINDSUS_BILE, BLOODY_AXE_HEAD, ROAD_RATMAN_HEAD, LETO_LIZARDMAN_FANG);
  84. }
  85. @Override
  86. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  87. {
  88. final QuestState qs = getQuestState(player, false);
  89. if (qs == null)
  90. {
  91. return null;
  92. }
  93. String htmltext = null;
  94. switch (event)
  95. {
  96. case "ACCEPT":
  97. {
  98. if (qs.isCreated())
  99. {
  100. qs.startQuest();
  101. playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  102. giveItems(player, ASCALONS_1ST_LETTER, 1);
  103. if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
  104. {
  105. if (player.getClassId() == ClassId.warrior)
  106. {
  107. giveItems(player, DIMENSIONAL_DIAMOND, 72);
  108. }
  109. else
  110. {
  111. giveItems(player, DIMENSIONAL_DIAMOND, 64);
  112. }
  113. player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
  114. htmltext = "30624-06a.htm";
  115. }
  116. else
  117. {
  118. htmltext = "30624-06.htm";
  119. }
  120. }
  121. break;
  122. }
  123. case "30624-05.htm":
  124. case "30196-02.html":
  125. case "30625-02.html":
  126. {
  127. htmltext = event;
  128. break;
  129. }
  130. case "30624-10.html":
  131. {
  132. if (hasQuestItems(player, MASONS_LETTER))
  133. {
  134. takeItems(player, MASONS_LETTER, 1);
  135. giveItems(player, ASCALONS_2ND_LETTER, 1);
  136. qs.setCond(5, true);
  137. htmltext = event;
  138. }
  139. break;
  140. }
  141. case "30624-14.html":
  142. {
  143. if (hasQuestItems(player, GROOTS_LETTER))
  144. {
  145. takeItems(player, GROOTS_LETTER, 1);
  146. giveItems(player, ASCALONS_3RD_LETTER, 1);
  147. qs.setCond(9, true);
  148. htmltext = event;
  149. }
  150. break;
  151. }
  152. case "30093-02.html":
  153. {
  154. if (hasQuestItems(player, ASCALONS_2ND_LETTER))
  155. {
  156. takeItems(player, ASCALONS_2ND_LETTER, 1);
  157. giveItems(player, WHITE_ROSE_INSIGNIA, 1);
  158. qs.setCond(6, true);
  159. htmltext = event;
  160. }
  161. break;
  162. }
  163. case "30196-03.html":
  164. {
  165. if (hasQuestItems(player, ASCALONS_3RD_LETTER))
  166. {
  167. takeItems(player, ASCALONS_3RD_LETTER, 1);
  168. giveItems(player, MOUENS_1ST_ORDER, 1);
  169. qs.setCond(10, true);
  170. htmltext = event;
  171. }
  172. break;
  173. }
  174. case "30196-06.html":
  175. {
  176. if (getQuestItemsCount(player, ROAD_RATMAN_HEAD) >= 10)
  177. {
  178. takeItems(player, MOUENS_1ST_ORDER, 1);
  179. giveItems(player, MOUENS_2ND_ORDER, 1);
  180. takeItems(player, ROAD_RATMAN_HEAD, -1);
  181. qs.setCond(12, true);
  182. htmltext = event;
  183. }
  184. break;
  185. }
  186. case "30625-03.html":
  187. {
  188. if (hasQuestItems(player, ASCALONS_1ST_LETTER))
  189. {
  190. takeItems(player, ASCALONS_1ST_LETTER, 1);
  191. giveItems(player, IRON_ROSE_RING, 1);
  192. qs.setCond(2, true);
  193. htmltext = event;
  194. }
  195. break;
  196. }
  197. }
  198. return htmltext;
  199. }
  200. @Override
  201. public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
  202. {
  203. final QuestState qs = getQuestState(attacker, false);
  204. if ((qs != null) && qs.isStarted())
  205. {
  206. switch (npc.getId())
  207. {
  208. case HARPY:
  209. {
  210. switch (npc.getScriptValue())
  211. {
  212. case 0:
  213. {
  214. npc.getVariables().set("lastAttacker", attacker.getObjectId());
  215. if (hasQuestItems(attacker, WHITE_ROSE_INSIGNIA) && (getQuestItemsCount(attacker, HARPYS_EGG) < 30))
  216. {
  217. if (getRandomBoolean())
  218. {
  219. if (getRandom(10) < 7)
  220. {
  221. addAttackPlayerDesire(addSpawn(HARPY_MATRIARCH, npc, true, 0, false), attacker);
  222. }
  223. else
  224. {
  225. addAttackPlayerDesire(addSpawn(HARPY_MATRIARCH, npc, true, 0, false), attacker);
  226. addAttackPlayerDesire(addSpawn(HARPY_MATRIARCH, npc, true, 0, false), attacker);
  227. }
  228. }
  229. }
  230. npc.setScriptValue(1);
  231. break;
  232. }
  233. case 1:
  234. {
  235. npc.setScriptValue(2);
  236. break;
  237. }
  238. }
  239. break;
  240. }
  241. case ROAD_SCAVENGER:
  242. {
  243. switch (npc.getScriptValue())
  244. {
  245. case 0:
  246. {
  247. npc.getVariables().set("lastAttacker", attacker.getObjectId());
  248. if (hasQuestItems(attacker, MOUENS_1ST_ORDER) && (getQuestItemsCount(attacker, ROAD_RATMAN_HEAD) < 10))
  249. {
  250. if (getRandomBoolean())
  251. {
  252. if (getRandom(10) < 7)
  253. {
  254. addAttackPlayerDesire(addSpawn(ROAD_COLLECTOR, npc, true, 0, false), attacker);
  255. }
  256. else
  257. {
  258. addAttackPlayerDesire(addSpawn(ROAD_COLLECTOR, npc, true, 0, false), attacker);
  259. addAttackPlayerDesire(addSpawn(ROAD_COLLECTOR, npc, true, 0, false), attacker);
  260. }
  261. }
  262. }
  263. npc.setScriptValue(1);
  264. break;
  265. }
  266. case 1:
  267. {
  268. npc.setScriptValue(2);
  269. break;
  270. }
  271. }
  272. break;
  273. }
  274. case BLOODY_AXE_ELITE:
  275. {
  276. switch (npc.getScriptValue())
  277. {
  278. case 0:
  279. {
  280. npc.getVariables().set("lastAttacker", attacker.getObjectId());
  281. if (hasQuestItems(attacker, IRON_ROSE_RING) && (getQuestItemsCount(attacker, BLOODY_AXE_HEAD) < 10))
  282. {
  283. if (getRandomBoolean())
  284. {
  285. addAttackPlayerDesire(addSpawn(BLOODY_AXE_ELITE, npc, true, 0, false), attacker);
  286. }
  287. }
  288. npc.setScriptValue(1);
  289. break;
  290. }
  291. case 1:
  292. {
  293. npc.setScriptValue(2);
  294. break;
  295. }
  296. }
  297. break;
  298. }
  299. }
  300. }
  301. return super.onAttack(npc, attacker, damage, isSummon);
  302. }
  303. @Override
  304. public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
  305. {
  306. final QuestState qs = getQuestState(killer, false);
  307. if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
  308. {
  309. switch (npc.getId())
  310. {
  311. case HARPY:
  312. case HARPY_MATRIARCH:
  313. {
  314. if (hasQuestItems(killer, WHITE_ROSE_INSIGNIA) && (getQuestItemsCount(killer, HARPYS_EGG) < 30))
  315. {
  316. if (getQuestItemsCount(killer, HARPYS_EGG) >= 28)
  317. {
  318. giveItems(killer, HARPYS_EGG, 2);
  319. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  320. if ((getQuestItemsCount(killer, MEDUSA_VENOM) >= 30) && (getQuestItemsCount(killer, WINDSUS_BILE) >= 30))
  321. {
  322. qs.setCond(7);
  323. }
  324. }
  325. else
  326. {
  327. giveItems(killer, HARPYS_EGG, 2);
  328. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  329. }
  330. }
  331. break;
  332. }
  333. case MEDUSA:
  334. {
  335. if (hasQuestItems(killer, WHITE_ROSE_INSIGNIA) && (getQuestItemsCount(killer, MEDUSA_VENOM) < 30))
  336. {
  337. if (getQuestItemsCount(killer, MEDUSA_VENOM) >= 27)
  338. {
  339. giveItems(killer, MEDUSA_VENOM, 3);
  340. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  341. if ((getQuestItemsCount(killer, HARPYS_EGG) >= 30) && (getQuestItemsCount(killer, WINDSUS_BILE) >= 30))
  342. {
  343. qs.setCond(7);
  344. }
  345. }
  346. else
  347. {
  348. giveItems(killer, MEDUSA_VENOM, 3);
  349. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  350. }
  351. }
  352. break;
  353. }
  354. case WINDSUS:
  355. {
  356. if (hasQuestItems(killer, WHITE_ROSE_INSIGNIA) && (getQuestItemsCount(killer, WINDSUS_BILE) < 30))
  357. {
  358. if (getQuestItemsCount(killer, WINDSUS_BILE) >= 27)
  359. {
  360. giveItems(killer, WINDSUS_BILE, 3);
  361. playSound(killer, QuestSound.ITEMSOUND_QUEST_MIDDLE);
  362. if ((getQuestItemsCount(killer, HARPYS_EGG) >= 30) && (getQuestItemsCount(killer, MEDUSA_VENOM) >= 30))
  363. {
  364. qs.setCond(7);
  365. }
  366. }
  367. else
  368. {
  369. giveItems(killer, WINDSUS_BILE, 3);
  370. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  371. }
  372. }
  373. break;
  374. }
  375. case ROAD_SCAVENGER:
  376. case ROAD_COLLECTOR:
  377. {
  378. if (hasQuestItems(killer, MOUENS_1ST_ORDER) && (getQuestItemsCount(killer, ROAD_RATMAN_HEAD) < 10))
  379. {
  380. if (getQuestItemsCount(killer, ROAD_RATMAN_HEAD) >= 9)
  381. {
  382. giveItems(killer, ROAD_RATMAN_HEAD, 1);
  383. qs.setCond(11, true);
  384. }
  385. else
  386. {
  387. giveItems(killer, ROAD_RATMAN_HEAD, 1);
  388. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  389. }
  390. }
  391. break;
  392. }
  393. case LETO_LIZARDMAN:
  394. case LETO_LIZARDMAN_ARCHER:
  395. case LETO_LIZARDMAN_SOLDIER:
  396. case LETO_LIZARDMAN_WARRIOR:
  397. case LETO_LIZARDMAN_SHAMAN:
  398. case LETO_LIZARDMAN_OCERLORD:
  399. {
  400. if (hasQuestItems(killer, MOUENS_2ND_ORDER) && (getQuestItemsCount(killer, LETO_LIZARDMAN_FANG) < 10))
  401. {
  402. if (getQuestItemsCount(killer, LETO_LIZARDMAN_FANG) >= 9)
  403. {
  404. giveItems(killer, LETO_LIZARDMAN_FANG, 1);
  405. qs.setCond(13, true);
  406. }
  407. else
  408. {
  409. giveItems(killer, LETO_LIZARDMAN_FANG, 1);
  410. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  411. }
  412. }
  413. break;
  414. }
  415. case BLOODY_AXE_ELITE:
  416. {
  417. if (hasQuestItems(killer, IRON_ROSE_RING) && (getQuestItemsCount(killer, BLOODY_AXE_HEAD) < 10))
  418. {
  419. if (getQuestItemsCount(killer, BLOODY_AXE_HEAD) >= 9)
  420. {
  421. giveItems(killer, BLOODY_AXE_HEAD, 1);
  422. qs.setCond(3, true);
  423. }
  424. else
  425. {
  426. giveItems(killer, BLOODY_AXE_HEAD, 1);
  427. playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
  428. }
  429. }
  430. break;
  431. }
  432. }
  433. }
  434. return super.onKill(npc, killer, isSummon);
  435. }
  436. @Override
  437. public String onTalk(L2Npc npc, L2PcInstance player)
  438. {
  439. final QuestState qs = getQuestState(player, true);
  440. String htmltext = getNoQuestMsg(player);
  441. if (qs.isCreated())
  442. {
  443. if (npc.getId() == VETERAN_ASCALON)
  444. {
  445. if ((player.getClassId() == ClassId.warrior) || (player.getClassId() == ClassId.orcRaider))
  446. {
  447. if (player.getLevel() >= MIN_LEVEL)
  448. {
  449. if (player.getClassId() == ClassId.warrior)
  450. {
  451. htmltext = "30624-03.htm";
  452. }
  453. else
  454. {
  455. htmltext = "30624-04.html";
  456. }
  457. }
  458. else
  459. {
  460. htmltext = "30624-01.html";
  461. }
  462. }
  463. else
  464. {
  465. htmltext = "30624-02.html";
  466. }
  467. }
  468. }
  469. else if (qs.isStarted())
  470. {
  471. switch (npc.getId())
  472. {
  473. case VETERAN_ASCALON:
  474. {
  475. if (hasQuestItems(player, ASCALONS_1ST_LETTER))
  476. {
  477. htmltext = "30624-07.html";
  478. }
  479. else if (hasQuestItems(player, IRON_ROSE_RING))
  480. {
  481. htmltext = "30624-08.html";
  482. }
  483. else if (hasQuestItems(player, MASONS_LETTER))
  484. {
  485. htmltext = "30624-09.html";
  486. }
  487. else if (hasQuestItems(player, ASCALONS_2ND_LETTER))
  488. {
  489. htmltext = "30624-11.html";
  490. }
  491. else if (hasQuestItems(player, WHITE_ROSE_INSIGNIA))
  492. {
  493. htmltext = "30624-12.html";
  494. }
  495. else if (hasQuestItems(player, GROOTS_LETTER))
  496. {
  497. htmltext = "30624-13.html";
  498. }
  499. else if (hasQuestItems(player, ASCALONS_3RD_LETTER))
  500. {
  501. htmltext = "30624-15.html";
  502. }
  503. else if (hasAtLeastOneQuestItem(player, MOUENS_1ST_ORDER, MOUENS_2ND_ORDER))
  504. {
  505. htmltext = "30624-16.html";
  506. }
  507. else if (hasQuestItems(player, MOUENS_LETTER))
  508. {
  509. giveAdena(player, 229764, true);
  510. giveItems(player, MARK_OF_CHAMPION, 1);
  511. addExpAndSp(player, 1270742, 87200);
  512. qs.exitQuest(false, true);
  513. player.sendPacket(new SocialAction(player.getObjectId(), 3));
  514. htmltext = "30624-17.html";
  515. }
  516. break;
  517. }
  518. case TRADER_GROOT:
  519. {
  520. if (hasQuestItems(player, ASCALONS_2ND_LETTER))
  521. {
  522. htmltext = "30093-01.html";
  523. }
  524. else if (hasQuestItems(player, WHITE_ROSE_INSIGNIA))
  525. {
  526. if ((getQuestItemsCount(player, HARPYS_EGG) >= 30) && (getQuestItemsCount(player, MEDUSA_VENOM) >= 30) && (getQuestItemsCount(player, WINDSUS_BILE) >= 30))
  527. {
  528. takeItems(player, WHITE_ROSE_INSIGNIA, 1);
  529. giveItems(player, GROOTS_LETTER, 1);
  530. takeItems(player, HARPYS_EGG, -1);
  531. takeItems(player, MEDUSA_VENOM, -1);
  532. takeItems(player, WINDSUS_BILE, -1);
  533. qs.setCond(8, true);
  534. htmltext = "30093-04.html";
  535. }
  536. else
  537. {
  538. htmltext = "30093-03.html";
  539. }
  540. }
  541. else if (hasQuestItems(player, GROOTS_LETTER))
  542. {
  543. htmltext = "30093-05.html";
  544. }
  545. else if (hasAtLeastOneQuestItem(player, ASCALONS_3RD_LETTER, MOUENS_1ST_ORDER, MOUENS_2ND_ORDER, MOUENS_LETTER))
  546. {
  547. htmltext = "30093-06.html";
  548. }
  549. break;
  550. }
  551. case CAPTAIN_MOUEN:
  552. {
  553. if (hasQuestItems(player, ASCALONS_3RD_LETTER))
  554. {
  555. htmltext = "30196-01.html";
  556. }
  557. else if (hasQuestItems(player, MOUENS_1ST_ORDER))
  558. {
  559. if (getQuestItemsCount(player, ROAD_RATMAN_HEAD) < 10)
  560. {
  561. htmltext = "30196-04.html";
  562. }
  563. else
  564. {
  565. htmltext = "30196-05.html";
  566. }
  567. }
  568. else if (hasQuestItems(player, MOUENS_2ND_ORDER))
  569. {
  570. if (getQuestItemsCount(player, LETO_LIZARDMAN_FANG) < 10)
  571. {
  572. htmltext = "30196-07.html";
  573. }
  574. else
  575. {
  576. takeItems(player, MOUENS_2ND_ORDER, 1);
  577. giveItems(player, MOUENS_LETTER, 1);
  578. takeItems(player, LETO_LIZARDMAN_FANG, -1);
  579. qs.setCond(14, true);
  580. htmltext = "30196-08.html";
  581. }
  582. }
  583. else if (hasQuestItems(player, MOUENS_LETTER))
  584. {
  585. htmltext = "30196-09.html";
  586. }
  587. break;
  588. }
  589. case MASON:
  590. {
  591. if (hasQuestItems(player, ASCALONS_1ST_LETTER))
  592. {
  593. htmltext = "30625-01.html";
  594. }
  595. else if (hasQuestItems(player, IRON_ROSE_RING))
  596. {
  597. if (getQuestItemsCount(player, BLOODY_AXE_HEAD) < 10)
  598. {
  599. htmltext = "30625-04.html";
  600. }
  601. else
  602. {
  603. giveItems(player, MASONS_LETTER, 1);
  604. takeItems(player, IRON_ROSE_RING, 1);
  605. takeItems(player, BLOODY_AXE_HEAD, -1);
  606. qs.setCond(4, true);
  607. htmltext = "30625-05.html";
  608. }
  609. }
  610. else if (hasQuestItems(player, MASONS_LETTER))
  611. {
  612. htmltext = "30625-06.html";
  613. }
  614. else if (hasAtLeastOneQuestItem(player, ASCALONS_2ND_LETTER, WHITE_ROSE_INSIGNIA, GROOTS_LETTER, ASCALONS_3RD_LETTER, MOUENS_1ST_ORDER, MOUENS_2ND_ORDER, MOUENS_LETTER))
  615. {
  616. htmltext = "30625-07.html";
  617. }
  618. break;
  619. }
  620. }
  621. }
  622. else if (qs.isCompleted())
  623. {
  624. if (npc.getId() == VETERAN_ASCALON)
  625. {
  626. htmltext = getAlreadyCompletedMsg(player);
  627. }
  628. }
  629. return htmltext;
  630. }
  631. }